Package com.storedobject.ui.tools
Class JavaClassEditor
java.lang.Object
- All Implemented Interfaces:
Executable
,Reentrant
,HasLogic
,ObjectSetter<JavaClass>
,AlertHandler
,ObjectChangedListener<JavaClass>
,ObjectEditorListener
,ObjectProvider<JavaClass>
,Transactional
,TransactionCreator
,ClickHandler
,ExecutableView
,HasContainer
,ValueChangeHandler
,com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<? extends com.vaadin.flow.component.Component>>
,com.vaadin.flow.component.HasValue.ValueChangeListener
,Serializable
,Runnable
,EventListener
,Consumer<JavaClass>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.vaadin.AbstractDataEditor
AbstractDataEditor.DForm
Nested classes/interfaces inherited from class com.storedobject.vaadin.AbstractDataForm
AbstractDataForm.FieldError
Nested classes/interfaces inherited from interface com.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<C extends com.vaadin.flow.component.Component>
-
Field Summary
Fields inherited from class com.storedobject.ui.ObjectEditor
add, audit, buttonPanel, cancel, delete, edit, exit, ledger, print, report, save, search
Fields inherited from class com.storedobject.vaadin.AbstractDataForm
form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This method is invoked whenever an instance of the object is set.boolean
canAdd()
Check whether add operation is allowed or not.boolean
Check whether delete operation is allowed for the current object instance.boolean
canEdit()
Check whether edit operation is allowed for the current object instance.void
clicked
(com.vaadin.flow.component.Component c) Default implementation, does nothing.protected void
This method is invoked at the time of creating the UI and this is where extra buttons need t be created to display as extra buttons on theObjectEditor.buttonPanel
.protected com.vaadin.flow.component.HasValue
<?, ?> createField
(String fieldName, Class<?> fieldType, String label) Create the field for the particular name..protected void
customizeField
(String fieldName, com.vaadin.flow.component.HasValue<?, ?> field) Customize a field.protected int
getFieldOrder
(String fieldName) Get the order in which a field to appear in the form.protected boolean
includeField
(String fieldName) Check whether field should be included in the form or not.protected boolean
save()
Save the current instance to the database.void
Methods inherited from class com.storedobject.ui.ObjectEditor
acceptValueChange, actionAllowed, add, addExtraEditingButtons, addObject, addObject, addObject, addObjectChangedListener, addObjectEditorListener, addValidator, allowedActions, anchorFieldsCreated, anchorsCancelled, anchorsSet, attachField, attachLinkField, canAllowAction, canPostLedger, canSearch, canViewLedger, clean, create, create, create, create, createFormFieldEditor, createLinkFieldGrid, createNewInstance, createObjectInstance, customizeLinkField, delete, deleted, deleteObject, deleteObject, doAdd, doAudit, doCancel, doDelete, doEdit, doReport, doSave, doSearch, editingCancelled, editingEnded, editingStarted, editObject, editObject, editObject, enablePrintButtons, executeAnchorForm, executeAnchorForm, extraInfoCreated, extraInfoLoaded, extraLinks, fieldAttached, filterActions, getActionPrefix, getAlertCaption, getAlertIcon, getAnchorField, getAnchorFilter, getApplication, getAttachmentField, getContactField, getContainer, getExtraInfoField, getField, getFieldName, getGrid, getLinkField, getLogic, getObject, getObjectFieldType, getParentLinkType, getParentObject, getSearcher, getTabName, getTransaction, handleAlert, handleValueSetError, initUI, inserted, isBuffered, isDoNotSaveAllowed, isEditing, isFieldEditable, isReadOnly, isViewOnly, linkFields, postLedger, postLedger, refreshMe, reload, remove, removeObjectChangedListener, removeObjectEditorListener, removeSetNotAllowed, removeValidator, resetAnchor, save, saveObject, savingExtraInfo, setAllowDoNotSave, setAnchorFieldReadOnly, setBuffered, setCaption, setColumns, setContactData, setDeleter, setDoNotSave, setExtraInfo, setFieldContainerProvider, setLogic, setNewObjectGenerator, setNoTab, setObject, setParentObject, setRawObject, setSaver, setSearchFilter, setSearchFilter, setSetNotAllowed, setTab, setTransactionCreator, skipFirstFocus, trackValueChange, updated, validateAnchorValues, validateData, viewLedger, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject, viewObject
Methods inherited from class com.storedobject.vaadin.AbstractDataEditor
addField, addField, addField, addField, addField, addField, addField, addField, constructField, getDataClass, getFieldCreator, getFieldGetMethod, getFieldNames, getFieldSetMethod, getForm, getObjectClass, isFieldIncluded, newObject, setFixedValue, setFixedValue, setFixedValues, setObject
Methods inherited from class com.storedobject.vaadin.AbstractDataForm
addConstructedListener, addField, addField, addIncludeFieldChecker, addValidator, addValidator, clearAlerts, clearError, clearErrors, clearFields, commit, connect, connect, connect, createButtonLayout, createField, createField, createFieldContainer, createLayout, detachField, fieldDetached, fireFormConstructed, formConstructed, getColumns, getColumnSpan, getContent, getData, getErrorDisplay, getFieldLabel, getFieldLabel, getFieldName, getLabel, isFieldEditable, isFieldVisible, isFieldVisible, load, markError, newLine, removeAll, removeField, removeField, removeField, setColumnSpan, setErrorDisplay, setFieldCustomizer, setFieldEditable, setFieldEditable, setFieldHidden, setFieldHidden, setFieldLabel, setFieldLabel, setFieldReadOnly, setFieldReadOnly, setFieldReadOnly, setFieldReadOnly, setFieldVisible, setFieldVisible, setFieldVisible, setFieldVisible, setIncludeFieldChecker, setReadOnly, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, setRequired, streamFieldNamesCreated, streamFieldsCreated
Methods inherited from class com.storedobject.vaadin.View
abort, aborted, addClosedListener, addOpenedListener, close, createCloseableView, createWindow, decorateComponent, execute, execute, execute, executing, focus, focus, focusAny, getCaption, getComponent, getCreatedBy, getEmbeddedView, getMenuItem, getMenuItem, getView, invoke, isFullScreen, isScrollable, isWindowMode, select, setComponent, setCreatedBy, setDefaultPadding, setEmbeddedView, setFirstFocus, setFullScreen, setScrollable, setWindowMode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.ui.AlertHandler
handleAlert
Methods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClicked
Methods inherited from interface com.storedobject.common.Executable
act
Methods inherited from interface com.storedobject.vaadin.ExecutableView
abort, clearAlerts, close, createMenuItem, error, execute, getCaption, getMenuIconName, getMenuItem, getView, getView, invoke, isCloseable, isFullScreen, isHomeView, log, log, message, returnedFrom, run, setClickable, speak, tray, valueChanged, warning
Methods inherited from interface com.storedobject.ui.ObjectChangedListener
saved, undeleted
Methods inherited from interface com.storedobject.ui.ObjectProvider
getObjectClass, getObjectId
Methods inherited from interface com.storedobject.core.ObjectSetter
accept, getObjectClass, isAllowAny, setObject
Methods inherited from interface com.storedobject.common.Reentrant
isReentrant
Methods inherited from interface com.storedobject.ui.Transactional
commit, execute, getTransactionManager, run, transact, transact, transactControl, transactControl
Methods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
JavaClassEditor
public JavaClassEditor()
-
-
Method Details
-
includeField
Description copied from class:AbstractDataEditor
Check whether field should be included in the form or not.- Overrides:
includeField
in classAbstractDataEditor<JavaClass>
- Parameters:
fieldName
- Name of the field.- Returns:
- True or false. (Default return value is
true
).
-
getFieldOrder
Description copied from class:AbstractDataEditor
Get the order in which a field to appear in the form. Any integer value can be returned and the field is placed in the form in ascending order of the values returned by this method. Default implementation try to obtain the value from the "field creator" (ObjectFieldCreator.getFieldOrder(String)
).- Overrides:
getFieldOrder
in classAbstractDataEditor<JavaClass>
- Parameters:
fieldName
- Name of the field- Returns:
- Field order.
-
createField
protected com.vaadin.flow.component.HasValue<?,?> createField(String fieldName, Class<?> fieldType, String label) Description copied from class:AbstractDataEditor
Create the field for the particular name.. Default implementation try to obtain the value from the "field creator" (ObjectFieldCreator.createField(String, Class, String)
).- Overrides:
createField
in classAbstractDataEditor<JavaClass>
- Parameters:
fieldName
- Name of the fieldfieldType
- Type of the field's valuelabel
- Label- Returns:
- Field
-
customizeField
Description copied from class:AbstractDataEditor
Customize a field. This method is invoked when a field is created. One may do some customization here.- Overrides:
customizeField
in classAbstractDataEditor<JavaClass>
- Parameters:
fieldName
- Name of the fieldfield
- Field
-
getVersionInformation
-
createExtraButtons
protected void createExtraButtons()Description copied from class:ObjectEditor
This method is invoked at the time of creating the UI and this is where extra buttons need t be created to display as extra buttons on theObjectEditor.buttonPanel
.- Overrides:
createExtraButtons
in classObjectEditor<JavaClass>
-
addExtraButtons
protected void addExtraButtons()Description copied from class:ObjectEditor
This method is invoked whenever an instance of the object is set. Typically, "extra buttons" can be added to theObjectEditor.buttonPanel
by examining the object instance value.- Overrides:
addExtraButtons
in classObjectEditor<JavaClass>
-
getSource
-
setSource
-
clicked
public void clicked(com.vaadin.flow.component.Component c) Description copied from interface:ExecutableView
Default implementation, does nothing.- Specified by:
clicked
in interfaceClickHandler
- Specified by:
clicked
in interfaceExecutableView
- Overrides:
clicked
in classObjectEditor<JavaClass>
- Parameters:
c
- Component
-
save
Description copied from class:ObjectEditor
Save the current instance to the database. This method carries out the save operation set by theObjectEditor.setSaver(Function)
. If no such operation is specified, then, it invokesObjectEditor.save(Transaction)
to carry out the operation.- Overrides:
save
in classObjectEditor<JavaClass>
- Returns:
- True if the operation was successful. Otherwise, false is returned.
- Throws:
Exception
- Raises when save operation is not successful.
-
canAdd
public boolean canAdd()Description copied from class:ObjectEditor
Check whether add operation is allowed or not.- Overrides:
canAdd
in classObjectEditor<JavaClass>
- Returns:
- True if allowed.
-
canEdit
public boolean canEdit()Description copied from class:ObjectEditor
Check whether edit operation is allowed for the current object instance.- Overrides:
canEdit
in classObjectEditor<JavaClass>
- Returns:
- True if allowed.
-
canDelete
public boolean canDelete()Description copied from class:ObjectEditor
Check whether delete operation is allowed for the current object instance.- Overrides:
canDelete
in classObjectEditor<JavaClass>
- Returns:
- True if allowed.
-