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.Object
Abstract childConfigurationItem
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractItem.ConfigurableContext<R extends Model,O>
Context for the configurable parent.class
AbstractItem.IdeChildrenGroup
IDEChildrenGroup
.class
AbstractItem.IdeConnection<C extends ConnectionModel>
class
AbstractItem.IdeConnectionTarget<C extends ConnectionModel,T extends Model,TE extends java.lang.Enum<TE>>
IDE targetAdaptedConnectionBuilder
.class
AbstractItem.IdeExtractor
Extracts theModel
instances.class
AbstractItem.IdeLabeller
Labels the configuration item.class
AbstractItem.IdeStyle
ConvenienceClass
to build style.static interface
AbstractItem.PreferenceListener
Listener 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 void
children(java.util.List<AbstractItem.IdeChildrenGroup> childGroups)
Loads theAbstractItem.IdeChildrenGroup
instances.protected void
connections(java.util.List<AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>> connections)
Loads theAbstractItem.IdeConnectionTarget
instances (created fromAbstractItem.IdeConnection
instances).AdaptedChildBuilder<R,O,M,E>
createChild(ChildrenGroupBuilder<R,O> childrenGroup)
Creates theAdaptedChildBuilder
.abstract AbstractItem.IdeExtractor
extract()
protected void
furtherAdapt(AdaptedChildBuilder<R,O,M,E> builder)
Further adapt theAdaptedChildBuilder
.AdaptedChildBuilder<R,O,M,E>
getBuilder()
Obtains theAdaptedChildBuilder
for theAbstractItem
.AbstractItem.IdeChildrenGroup[]
getChildrenGroups()
Obtains theAbstractItem.IdeChildrenGroup
instances.AbstractItem.ConfigurableContext<R,O>
getConfigurableContext()
Obtains theAbstractItem.ConfigurableContext
.AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>[]
getConnections()
Obtains theAbstractItem.IdeConnection
instances.java.lang.String
getPreferenceStyleId()
Obtains the preference identifier for styling thisAbstractItem
.void
init(AbstractItem.ConfigurableContext<R,O> context)
Initialise withAbstractItem.ConfigurableContext
.abstract AbstractItem.IdeLabeller
label()
Obtains theAbstractItem.IdeLabeller
for theModel
.protected void
loadStyles(java.util.List<AbstractItem.IdeStyle> styles)
Default implementation ofstyle()
will invoke this to load styles.abstract void
loadToParent(P parentModel, M itemModel)
abstract M
prototype()
Creates the prototype for the item.java.lang.String
style()
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.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.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> 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
.abstract javafx.scene.Node
visual(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
-Function
to extract the name from the property item.getValue
-Function
to 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
-Function
to 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 theModel
to 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:
Node
for the visual.
-
label
public abstract AbstractItem.IdeLabeller label()
Obtains theAbstractItem.IdeLabeller
for 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
-List
to be loaded with theAbstractItem.IdeStyle
instances.
-
furtherAdapt
protected void furtherAdapt(AdaptedChildBuilder<R,O,M,E> builder)
Further adapt theAdaptedChildBuilder
.- Parameters:
builder
-AdaptedChildBuilder
.
-
getChildrenGroups
public final AbstractItem.IdeChildrenGroup[] getChildrenGroups()
Obtains theAbstractItem.IdeChildrenGroup
instances.- Returns:
AbstractItem.IdeChildrenGroup
instances.
-
children
protected void children(java.util.List<AbstractItem.IdeChildrenGroup> childGroups)
Loads theAbstractItem.IdeChildrenGroup
instances.- Parameters:
childGroups
-AbstractItem.IdeChildrenGroup
instances.
-
getConnections
public final AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>[] getConnections()
Obtains theAbstractItem.IdeConnection
instances.- Returns:
AbstractItem.IdeConnection
instances.
-
connections
protected void connections(java.util.List<AbstractItem.IdeConnectionTarget<? extends ConnectionModel,?,?>> connections)
Loads theAbstractItem.IdeConnectionTarget
instances (created fromAbstractItem.IdeConnection
instances).- Parameters:
connections
-AbstractItem.IdeConnection
instances.
-
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 theAdaptedChildBuilder
for theAbstractItem
.- Returns:
AdaptedChildBuilder
for theAbstractItem
.
-
getPreferenceStyleId
public final java.lang.String getPreferenceStyleId()
Obtains the preference identifier for styling thisAbstractItem
.- Returns:
- Preference identifier for styling this
AbstractItem
.
-
-