Class PrometheusDataItemPanel<T extends PrometheusTableItem & Comparable<? super T>,G extends Enum<G>>
java.lang.Object
io.github.tonywasher.joceanus.prometheus.ui.panel.PrometheusDataItemPanel<T,G>
- Type Parameters:
T- the item typeG- the goto id type
- All Implemented Interfaces:
OceanusEventRegistrar.OceanusEventProvider<PrometheusDataEvent>,PrometheusItemEditActions.PrometheusItemEditParent,TethysUIComponent
public abstract class PrometheusDataItemPanel<T extends PrometheusTableItem & Comparable<? super T>,G extends Enum<G>>
extends Object
implements OceanusEventRegistrar.OceanusEventProvider<PrometheusDataEvent>, TethysUIComponent, PrometheusItemEditActions.PrometheusItemEditParent
Class to enable display/editing of and individual dataItem.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrometheusDataItemPanel(TethysUIFactory<?> pFactory, PrometheusEditSet pEditSet, MetisErrorPanel pError) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidadjustFields(boolean isEditable) Adjust Editable Fields.protected abstract voidBuild goTo menu.protected PrometheusGoToEvent<G> createGoToEvent(G pGoToId, Object pDetails) Create a GoTo event.protected voidfire a state changed event.protected MetisFieldVersionValuesObtain the base Values.<L extends PrometheusDataList<X>,X extends PrometheusDataItem>
LgetDataList(MetisListKey pDataType, Class<L> pClass) Obtain the list for a class in base updateSet.protected PrometheusEditSetObtain the Update Set.protected intObtain the edit version.Obtain registration object for listeners.protected TethysUIFactory<?> Obtain the factory.protected PrometheusFieldSet<T> Obtain the field Set.protected OceanusDataFormatterObtain the formatter.protected TgetItem()Obtain the item.Obtain the selected item.Obtain the underlying component (if any).booleanDoes the parent have errors.booleanDoes the parent have updates.booleanIs the item deletable?booleanIs the item editable?booleanAre we editing?booleanIs the active item deleted.booleanisNew()Is the parent new.protected voidRefresh the item after an updateSet reWind.abstract voidRefresh data.voidsetEditable(boolean isEditable) Set editable item.voidsetEnabled(boolean pEnabled) Set Enabled status.voidSet readOnly item.voidsetNewItem(T pItem) Set new item.protected voidupdate the actions.protected abstract voidupdateField(PrometheusFieldSetEvent pUpdate) Update the field.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.tonywasher.joceanus.tethys.api.base.TethysUIComponent
getBorderPadding, getBorderTitle, getId, getNode, setBorderPadding, setBorderTitle, setPreferredHeight, setPreferredWidth, setVisible
-
Field Details
-
TAB_DETAILS
Details Tab Title. -
TAB_ACCOUNT
Account Tab Title. -
TAB_WEB
Web Tab Title. -
TAB_NOTES
Notes Tab Title. -
VERSION_READONLY
protected static final int VERSION_READONLYReadOnly EditVersion.- See Also:
-
-
Constructor Details
-
PrometheusDataItemPanel
protected PrometheusDataItemPanel(TethysUIFactory<?> pFactory, PrometheusEditSet pEditSet, MetisErrorPanel pError) Constructor.- Parameters:
pFactory- the GUI factorypEditSet- the edit setpError- the error panel
-
-
Method Details
-
getFactory
Obtain the factory.- Returns:
- the factory
-
getEventRegistrar
Description copied from interface:OceanusEventRegistrar.OceanusEventProviderObtain registration object for listeners.- Specified by:
getEventRegistrarin interfaceOceanusEventRegistrar.OceanusEventProvider<T extends PrometheusTableItem & Comparable<? super T>>- Returns:
- the registrar
-
getUnderlying
Description copied from interface:TethysUIComponentObtain the underlying component (if any).- Specified by:
getUnderlyingin interfaceTethysUIComponent- Returns:
- the underlying component
-
setEnabled
public void setEnabled(boolean pEnabled) Description copied from interface:TethysUIComponentSet Enabled status.- Specified by:
setEnabledin interfaceTethysUIComponent- Parameters:
pEnabled- true/false
-
getFormatter
Obtain the formatter.- Returns:
- the formatter
-
getFieldSet
Obtain the field Set.- Returns:
- the FieldSet
-
getEditSet
Obtain the Update Set.- Returns:
- the UpdateSet
-
getItem
Obtain the item.- Returns:
- the item
-
getSelectedItem
Obtain the selected item.- Returns:
- the selected item
-
getEditVersion
protected int getEditVersion()Obtain the edit version.- Returns:
- the edit version
-
isItemDeleted
public boolean isItemDeleted()Is the active item deleted.- Returns:
- true/false
-
isNew
public boolean isNew()Description copied from interface:PrometheusItemEditActions.PrometheusItemEditParentIs the parent new.- Specified by:
isNewin interfacePrometheusItemEditActions.PrometheusItemEditParent- Returns:
- true/false
-
getBaseValues
Obtain the base Values.- Returns:
- the values
-
setEditable
public void setEditable(boolean isEditable) Set editable item.- Parameters:
isEditable- true/false
-
updateActions
protected void updateActions()update the actions. -
setItem
Set readOnly item.- Parameters:
pItem- the item
-
setNewItem
Set new item.- Parameters:
pItem- the item
-
isEditable
public boolean isEditable()Description copied from interface:PrometheusItemEditActions.PrometheusItemEditParentIs the item editable?- Specified by:
isEditablein interfacePrometheusItemEditActions.PrometheusItemEditParent- Returns:
- true/false
-
isDeletable
public boolean isDeletable()Description copied from interface:PrometheusItemEditActions.PrometheusItemEditParentIs the item deletable?- Specified by:
isDeletablein interfacePrometheusItemEditActions.PrometheusItemEditParent- Returns:
- true/false
-
refreshData
public abstract void refreshData()Refresh data. -
adjustFields
protected abstract void adjustFields(boolean isEditable) Adjust Editable Fields.- Parameters:
isEditable- is the item editable?
-
updateField
Update the field.- Parameters:
pUpdate- the update- Throws:
OceanusException- on error
-
getDataList
public <L extends PrometheusDataList<X>,X extends PrometheusDataItem> L getDataList(MetisListKey pDataType, Class<L> pClass) Obtain the list for a class in base updateSet.- Type Parameters:
L- the list typeX- the object type- Parameters:
pDataType- the data typepClass- the list class- Returns:
- the list
-
isEditing
public boolean isEditing()Are we editing?- Returns:
- true/false
-
hasUpdates
public boolean hasUpdates()Description copied from interface:PrometheusItemEditActions.PrometheusItemEditParentDoes the parent have updates.- Specified by:
hasUpdatesin interfacePrometheusItemEditActions.PrometheusItemEditParent- Returns:
- true/false
-
hasErrors
public boolean hasErrors()Description copied from interface:PrometheusItemEditActions.PrometheusItemEditParentDoes the parent have errors.- Specified by:
hasErrorsin interfacePrometheusItemEditActions.PrometheusItemEditParent- Returns:
- true/false
-
refreshAfterUpdate
protected void refreshAfterUpdate()Refresh the item after an updateSet reWind. -
createGoToEvent
Create a GoTo event.- Parameters:
pGoToId- the Id of the eventpDetails- the details of the event- Returns:
- the action event
-
fireStateChanged
protected void fireStateChanged()fire a state changed event.
-