Class PrometheusFieldSet<T>
java.lang.Object
io.github.tonywasher.joceanus.prometheus.ui.fieldset.PrometheusFieldSet<T>
- Type Parameters:
T- the item type
- All Implemented Interfaces:
OceanusEventRegistrar.OceanusEventProvider<TethysUIEvent>,PrometheusFieldSetControl<T>
public class PrometheusFieldSet<T>
extends Object
implements PrometheusFieldSetControl<T>, OceanusEventRegistrar.OceanusEventProvider<TethysUIEvent>
FieldSet.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddField(MetisDataItem.MetisDataFieldId pFieldId, TethysUIDataEditField<?> pField, Function<T, Object> pValueFactory) Add field to current panel.voidAdjust changed indications.voidAdjust tab visibility.Obtain the component.Obtain registration object for listeners.booleanisChanged(T pItem, MetisDataItem.MetisDataFieldId pField) Is the cell changed?voidnewData(MetisDataItem.MetisDataFieldId pFieldId, Object pNewValue) Notify listeners of new data.voidSwitch to subsidiary panel.voidnewTable(String pName, PrometheusFieldSetTableTab.PrometheusFieldSetTable<T> pTable) Add a table tab.voidnewTextArea(String pName, MetisDataItem.MetisDataFieldId pFieldId, TethysUIDataEditField.TethysUICharArrayTextAreaField pField, Function<T, char[]> pValueFactory) Add a textArea tab.voidregisterField(MetisDataItem.MetisDataFieldId pFieldId, PrometheusFieldSetPanel<T> pPanel) Register a field.voidsetChanged(BiPredicate<T, MetisDataItem.MetisDataFieldId> pChanged) Set the changed predicate.voidsetEditable(boolean isEditable) Set editable item.voidsetFieldEditable(MetisDataItem.MetisDataFieldId pFieldId, boolean pEditable) Set field editability.voidsetFieldVisible(MetisDataItem.MetisDataFieldId pFieldId, boolean pVisible) Set field visibility.voidSet item.voidsetPreferredWidthAndHeight(int pWidth, int pHeight) Set preferred width and height.voidsetReporter(Consumer<String> pReporter) Set reporter.
-
Constructor Details
-
PrometheusFieldSet
Constructor.- Parameters:
pFactory- the gui factory
-
-
Method Details
-
getComponent
Obtain the component.- Returns:
- the component
-
getEventRegistrar
Description copied from interface:OceanusEventRegistrar.OceanusEventProviderObtain registration object for listeners.- Specified by:
getEventRegistrarin interfaceOceanusEventRegistrar.OceanusEventProvider<T>- Returns:
- the registrar
-
newPanel
Switch to subsidiary panel.- Parameters:
pName- the name of the tab.
-
newTextArea
public void newTextArea(String pName, MetisDataItem.MetisDataFieldId pFieldId, TethysUIDataEditField.TethysUICharArrayTextAreaField pField, Function<T, char[]> pValueFactory) Add a textArea tab.- Parameters:
pName- the name of the tab.pFieldId- the fieldIdpField- the edit fieldpValueFactory- the valueFactory
-
newTable
Add a table tab.- Parameters:
pName- the name of the tab.pTable- the table
-
addField
public void addField(MetisDataItem.MetisDataFieldId pFieldId, TethysUIDataEditField<?> pField, Function<T, Object> pValueFactory) Add field to current panel.- Parameters:
pFieldId- the fieldIdpField- the edit fieldpValueFactory- the valueFactory
-
setChanged
Set the changed predicate.- Parameters:
pChanged- the changed predicate
-
isChanged
Description copied from interface:PrometheusFieldSetControlIs the cell changed?- Specified by:
isChangedin interfacePrometheusFieldSetControl<T>- Parameters:
pItem- the itempField- the field id- Returns:
- true/false
-
setEditable
public void setEditable(boolean isEditable) Set editable item.- Parameters:
isEditable- true/false
-
adjustChanged
public void adjustChanged()Adjust changed indications. -
setItem
Set item.- Parameters:
pItem- the item.
-
registerField
public void registerField(MetisDataItem.MetisDataFieldId pFieldId, PrometheusFieldSetPanel<T> pPanel) Description copied from interface:PrometheusFieldSetControlRegister a field.- Specified by:
registerFieldin interfacePrometheusFieldSetControl<T>- Parameters:
pFieldId- the field.pPanel- the panel.
-
setFieldVisible
Set field visibility.- Parameters:
pFieldId- the field.pVisible- is visible true/false?
-
adjustTabVisibility
public void adjustTabVisibility()Adjust tab visibility. -
setFieldEditable
Set field editability.- Parameters:
pFieldId- the fieldId.pEditable- is editable true/false?
-
newData
Description copied from interface:PrometheusFieldSetControlNotify listeners of new data.- Specified by:
newDatain interfacePrometheusFieldSetControl<T>- Parameters:
pFieldId- the fieldId.pNewValue- the new value
-
setPreferredWidthAndHeight
public void setPreferredWidthAndHeight(int pWidth, int pHeight) Set preferred width and height.- Parameters:
pWidth- the width.pHeight- the height
-
setReporter
Set reporter.- Parameters:
pReporter- the reporter
-