Package net.officefloor.gef.ide.editor
Class AbstractItem<R extends Model,O,P extends Model,PE extends java.lang.Enum<PE>,M extends Model,E extends java.lang.Enum<E>>
- java.lang.Object
-
- net.officefloor.gef.ide.editor.AbstractItem<R,O,P,PE,M,E>
-
- Direct Known Subclasses:
AbstractConfigurableItem,ActivityProcedureNextItem,ActivityProcedureOutputItem,ActivitySectionInputItem,ActivitySectionOutputItem,FunctionEscalationItem,FunctionFlowItem,ManagedFunctionItem,ManagedFunctionObjectItem,ManagedObjectDependencyItem,SubSectionInputItem,SubSectionOutputItem,WoofProcedureNextItem,WoofProcedureOutputItem,WoofSectionInputItem,WoofSectionOutputItem,WoofSecurityOutputItem,WoofTemplateOutputItem
public abstract class AbstractItem<R extends Model,O,P extends Model,PE extends java.lang.Enum<PE>,M extends Model,E extends java.lang.Enum<E>> extends java.lang.ObjectAbstract childConfigurationItem.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractItem.ConfigurableContext<R extends Model,O>Context for the configurable parent.classAbstractItem.IdeChildrenGroupIDEChildrenGroup.classAbstractItem.IdeConnection<C extends ConnectionModel>classAbstractItem.IdeConnectionTarget<C extends ConnectionModel,T extends Model,TE extends java.lang.Enum<TE>>IDE targetAdaptedConnectionBuilder.classAbstractItem.IdeExtractorExtracts theModelinstances.classAbstractItem.IdeLabellerLabels the configuration item.classAbstractItem.IdeStyleConvenienceClassto build style.static interfaceAbstractItem.PreferenceListenerListener to change of a preference.
-
Constructor Summary
Constructors Constructor Description AbstractItem()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidchildren(java.util.List<AbstractItem.IdeChildrenGroup> childGroups)Loads theAbstractItem.IdeChildrenGroupinstances.protected voidconnections(java.util.List<AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>> connections)Loads theAbstractItem.IdeConnectionTargetinstances (created fromAbstractItem.IdeConnectioninstances).AdaptedChildBuilder<R,O,M,E>createChild(ChildrenGroupBuilder<R,O> childrenGroup)Creates theAdaptedChildBuilder.abstract AbstractItem.IdeExtractorextract()protected voidfurtherAdapt(AdaptedChildBuilder<R,O,M,E> builder)Further adapt theAdaptedChildBuilder.AdaptedChildBuilder<R,O,M,E>getBuilder()Obtains theAdaptedChildBuilderfor theAbstractItem.AbstractItem.IdeChildrenGroup[]getChildrenGroups()Obtains theAbstractItem.IdeChildrenGroupinstances.AbstractItem.ConfigurableContext<R,O>getConfigurableContext()Obtains theAbstractItem.ConfigurableContext.AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>[]getConnections()Obtains theAbstractItem.IdeConnectioninstances.java.lang.StringgetPreferenceStyleId()Obtains the preference identifier for styling thisAbstractItem.voidinit(AbstractItem.ConfigurableContext<R,O> context)Initialise withAbstractItem.ConfigurableContext.abstract AbstractItem.IdeLabellerlabel()Obtains theAbstractItem.IdeLabellerfor theModel.protected voidloadStyles(java.util.List<AbstractItem.IdeStyle> styles)Default implementation ofstyle()will invoke this to load styles.abstract voidloadToParent(P parentModel, M itemModel)abstract Mprototype()Creates the prototype for the item.java.lang.Stringstyle()Obtains the style for the display of theModel.protected <CSVI> java.util.List<CSVI>translateFromCommaSeparatedList(java.lang.String text, java.util.function.Function<java.lang.String,CSVI> getItem)Convenience method to translate comma separated text into a list.protected <CSVI> java.lang.StringtranslateToCommaSeparateList(java.util.List<CSVI> items, java.util.function.Function<CSVI,java.lang.String> getValue)Convenience method to translate list of items to a comma separated list.protected <I> java.util.Map<java.lang.String,java.lang.String>translateToNameMappings(I[] items, java.util.function.Function<I,java.lang.String> getName)Translate the list of items to name mapping.protected <PI> PropertyListtranslateToPropertyList(java.util.List<PI> properties, java.util.function.Function<PI,java.lang.String> getName, java.util.function.Function<PI,java.lang.String> getValue)Convenience method to translate list of property items to aPropertyList.abstract javafx.scene.Nodevisual(M model, AdaptedChildVisualFactoryContext<M> context)Creates the visual for theModel.
-
-
-
Method Detail
-
init
public final void init(AbstractItem.ConfigurableContext<R,O> context)
Initialise withAbstractItem.ConfigurableContext.- Parameters:
context-AbstractItem.ConfigurableContext.
-
getConfigurableContext
public final AbstractItem.ConfigurableContext<R,O> getConfigurableContext()
Obtains theAbstractItem.ConfigurableContext.- Returns:
AbstractItem.ConfigurableContext.
-
translateToPropertyList
protected final <PI> PropertyList translateToPropertyList(java.util.List<PI> properties, java.util.function.Function<PI,java.lang.String> getName, java.util.function.Function<PI,java.lang.String> getValue)
Convenience method to translate list of property items to aPropertyList.- Type Parameters:
PI- Property item type.- Parameters:
properties- Property items.getName-Functionto extract the name from the property item.getValue-Functionto extract the value from the property item.- Returns:
PropertyList.
-
translateToCommaSeparateList
protected final <CSVI> java.lang.String translateToCommaSeparateList(java.util.List<CSVI> items, java.util.function.Function<CSVI,java.lang.String> getValue)Convenience method to translate list of items to a comma separated list.- Type Parameters:
CSVI- Comma separated item type.- Parameters:
items- Items.getValue- Obtains the value for the comma separate list from the item.- Returns:
- Comma separate text for the items.
-
translateFromCommaSeparatedList
protected final <CSVI> java.util.List<CSVI> translateFromCommaSeparatedList(java.lang.String text, java.util.function.Function<java.lang.String,CSVI> getItem)Convenience method to translate comma separated text into a list.- Type Parameters:
CSVI- Comma separated item type.- Parameters:
text- Comma separated text.getItem- Creates the item from the comma separated value.- Returns:
- List of items.
-
translateToNameMappings
protected final <I> java.util.Map<java.lang.String,java.lang.String> translateToNameMappings(I[] items, java.util.function.Function<I,java.lang.String> getName)Translate the list of items to name mapping.- Type Parameters:
I- Item types.- Parameters:
items- Items.getName-Functionto extract the name from the item.- Returns:
- Name mapping.
-
prototype
public abstract M prototype()
Creates the prototype for the item.- Returns:
- Prototype.
-
extract
public abstract AbstractItem.IdeExtractor extract()
- Returns:
AbstractItem.IdeExtractor.
-
loadToParent
public abstract void loadToParent(P parentModel, M itemModel)
Loads theModelto the parentModel. This allows for constructing a prototype model for editing preferences of theAbstractAdaptedIdeEditor.
-
visual
public abstract javafx.scene.Node visual(M model, AdaptedChildVisualFactoryContext<M> context)
Creates the visual for theModel.- Parameters:
model-Model.context-AdaptedChildVisualFactoryContext.- Returns:
Nodefor the visual.
-
label
public abstract AbstractItem.IdeLabeller label()
Obtains theAbstractItem.IdeLabellerfor theModel.- Returns:
AbstractItem.IdeLabeller.
-
style
public java.lang.String style()
Obtains the style for the display of theModel.- Returns:
- Style for the display of the
Model.
-
loadStyles
protected void loadStyles(java.util.List<AbstractItem.IdeStyle> styles)
Default implementation ofstyle()will invoke this to load styles.- Parameters:
styles-Listto be loaded with theAbstractItem.IdeStyleinstances.
-
furtherAdapt
protected void furtherAdapt(AdaptedChildBuilder<R,O,M,E> builder)
Further adapt theAdaptedChildBuilder.- Parameters:
builder-AdaptedChildBuilder.
-
getChildrenGroups
public final AbstractItem.IdeChildrenGroup[] getChildrenGroups()
Obtains theAbstractItem.IdeChildrenGroupinstances.- Returns:
AbstractItem.IdeChildrenGroupinstances.
-
children
protected void children(java.util.List<AbstractItem.IdeChildrenGroup> childGroups)
Loads theAbstractItem.IdeChildrenGroupinstances.- Parameters:
childGroups-AbstractItem.IdeChildrenGroupinstances.
-
getConnections
public final AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>[] getConnections()
Obtains theAbstractItem.IdeConnectioninstances.- Returns:
AbstractItem.IdeConnectioninstances.
-
connections
protected void connections(java.util.List<AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>> connections)
Loads theAbstractItem.IdeConnectionTargetinstances (created fromAbstractItem.IdeConnectioninstances).- Parameters:
connections-AbstractItem.IdeConnectioninstances.
-
createChild
public final AdaptedChildBuilder<R,O,M,E> createChild(ChildrenGroupBuilder<R,O> childrenGroup)
Creates theAdaptedChildBuilder.- Parameters:
childrenGroup-ChildrenGroupBuilder.- Returns:
- Child
AdaptedChildBuilder.
-
getBuilder
public final AdaptedChildBuilder<R,O,M,E> getBuilder()
Obtains theAdaptedChildBuilderfor theAbstractItem.- Returns:
AdaptedChildBuilderfor theAbstractItem.
-
getPreferenceStyleId
public final java.lang.String getPreferenceStyleId()
Obtains the preference identifier for styling thisAbstractItem.- Returns:
- Preference identifier for styling this
AbstractItem.
-
-