Class FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>
- java.lang.Object
-
- io.github.factoryfx.factory.attribute.Attribute<F,FactoryViewAttribute<R,L,F>>
-
- io.github.factoryfx.factory.attribute.dependency.FactoryViewAttribute<R,L,F>
-
- Type Parameters:
R- rootL- live object factoryF- factory
- All Implemented Interfaces:
AttributeCopy<F>,AttributeMatch<F>,AttributeMerger<F>,AttributeValue<F>,FactoryChildrenEnclosingAttribute<R,Attribute<F,FactoryViewAttribute<R,L,F>>>,RunLaterAble
public class FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>> extends Attribute<F,FactoryViewAttribute<R,L,F>> implements RunLaterAble, FactoryChildrenEnclosingAttribute<R,Attribute<F,FactoryViewAttribute<R,L,F>>>
Allows to programmatically define a dependency
This should only be used in exceptional cases. e.g. if the customer demand an unsuitable destructure
It should not be used to model singletons. (instead us theFactoryTreeBuilder)
-
-
Constructor Summary
Constructors Constructor Description FactoryViewAttribute(java.util.function.Function<R,F> view)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Fget()java.lang.StringgetDisplayText()java.util.Optional<F>getOptional()Linstance()voidinternal_addBackReferences(FactoryBase<?,?> root, FactoryBase<?,?> parent)voidinternal_addListener(AttributeChangeListener<F,FactoryViewAttribute<R,L,F>> listener)voidinternal_copyTo(AttributeCopy<F> copyAttribute, int level, int maxLevel, java.util.List<FactoryBase<?,?>> oldData, FactoryBase<?,?> parent, FactoryBase<?,?> root)voidinternal_endUsage()<RL extends FactoryBase<?,RL>>
voidinternal_fixDuplicateObjects(java.util.Map<java.util.UUID,FactoryBase<?,RL>> idToDataMap)voidinternal_merge(F newFactory)booleaninternal_mergeMatch(AttributeMatch<F> value)alternative to equals on value, type-safe , less verbose, without worrying about hidden contracts indented for merge some with some serial case e.g ObjectValueAttributevoidinternal_removeListener(AttributeChangeListener<F,FactoryViewAttribute<R,L,F>> listener)remove added Listener or Listener inside WeakAttributeChangeListenervoidinternal_reset()voidinternal_semanticCopyTo(AttributeCopy<F> copyAttribute)voidinternal_setReferenceClass(java.lang.Class<?> clazz)setup value selection and new value adding for user editingvoidinternal_visitChildren(java.util.function.Consumer<FactoryBase<?,R>> consumer, boolean includeViews)voidrunLater(java.lang.Runnable runnable)voidset(F value)voidsetRunlaterExecutor(java.util.function.Consumer<java.lang.Runnable> runlaterExecutor)-
Methods inherited from class io.github.factoryfx.factory.attribute.Attribute
addonText, createAttributeStorageMetadata, de, en, es, fr, internal_getAddonText, internal_getListeners, internal_getPreferredLabelText, internal_getPreferredTooltipText, internal_hasWritePermission, internal_isUserReadOnly, internal_removeAllListener, internal_required, internal_validate, it, labelText, labelText, listenersEmpty, permission, pt, tooltipDe, tooltipEn, updateListeners, userReadOnly, userReadOnly, validation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.factoryfx.factory.attribute.AttributeMatch
internal_referenceEquals, internal_referenceListEquals
-
Methods inherited from interface io.github.factoryfx.factory.attribute.AttributeMerger
internal_mergeFactoryList
-
-
-
-
Field Detail
-
view
protected final java.util.function.Function<R extends FactoryBase<?,R>,F extends FactoryBase<L,R>> view
-
-
Method Detail
-
instance
public L instance()
-
internal_merge
public void internal_merge(F newFactory)
- Specified by:
internal_mergein interfaceAttributeMerger<R extends FactoryBase<?,R>>- Overrides:
internal_mergein classAttribute<F extends FactoryBase<L,R>,FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>>
-
internal_mergeMatch
public boolean internal_mergeMatch(AttributeMatch<F> value)
Description copied from interface:AttributeMatchalternative to equals on value, type-safe , less verbose, without worrying about hidden contracts indented for merge some with some serial case e.g ObjectValueAttribute- Specified by:
internal_mergeMatchin interfaceAttributeMatch<R extends FactoryBase<?,R>>- Parameters:
value- compare value- Returns:
- true if equals
-
internal_fixDuplicateObjects
public <RL extends FactoryBase<?,RL>> void internal_fixDuplicateObjects(java.util.Map<java.util.UUID,FactoryBase<?,RL>> idToDataMap)
- Specified by:
internal_fixDuplicateObjectsin interfaceFactoryChildrenEnclosingAttribute<R extends FactoryBase<?,R>,L>
-
get
public F get()
- Specified by:
getin interfaceAttributeValue<R extends FactoryBase<?,R>>
-
set
public void set(F value)
- Specified by:
setin interfaceAttributeCopy<R extends FactoryBase<?,R>>- Specified by:
setin interfaceAttributeValue<R extends FactoryBase<?,R>>
-
internal_addBackReferences
public void internal_addBackReferences(FactoryBase<?,?> root, FactoryBase<?,?> parent)
- Specified by:
internal_addBackReferencesin interfaceAttributeCopy<R extends FactoryBase<?,R>>- Specified by:
internal_addBackReferencesin interfaceFactoryChildrenEnclosingAttribute<R extends FactoryBase<?,R>,L>- Parameters:
root- factory tree rootparent- data that contains the attribute
-
internal_setReferenceClass
public void internal_setReferenceClass(java.lang.Class<?> clazz)
Description copied from interface:FactoryChildrenEnclosingAttributesetup value selection and new value adding for user editing- Specified by:
internal_setReferenceClassin interfaceFactoryChildrenEnclosingAttribute<R extends FactoryBase<?,R>,L>- Parameters:
clazz- class
-
internal_copyTo
public void internal_copyTo(AttributeCopy<F> copyAttribute, int level, int maxLevel, java.util.List<FactoryBase<?,?>> oldData, FactoryBase<?,?> parent, FactoryBase<?,?> root)
- Specified by:
internal_copyToin interfaceAttributeCopy<R extends FactoryBase<?,R>>
-
internal_semanticCopyTo
public void internal_semanticCopyTo(AttributeCopy<F> copyAttribute)
- Specified by:
internal_semanticCopyToin interfaceAttributeCopy<R extends FactoryBase<?,R>>
-
setRunlaterExecutor
public void setRunlaterExecutor(java.util.function.Consumer<java.lang.Runnable> runlaterExecutor)
- Specified by:
setRunlaterExecutorin interfaceRunLaterAble
-
runLater
public void runLater(java.lang.Runnable runnable)
-
internal_addListener
public void internal_addListener(AttributeChangeListener<F,FactoryViewAttribute<R,L,F>> listener)
- Overrides:
internal_addListenerin classAttribute<F extends FactoryBase<L,R>,FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>>
-
internal_removeListener
public void internal_removeListener(AttributeChangeListener<F,FactoryViewAttribute<R,L,F>> listener)
Description copied from class:Attributeremove added Listener or Listener inside WeakAttributeChangeListener- Overrides:
internal_removeListenerin classAttribute<F extends FactoryBase<L,R>,FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>>- Parameters:
listener- listener to remove
-
getOptional
public java.util.Optional<F> getOptional()
-
getDisplayText
public java.lang.String getDisplayText()
- Specified by:
getDisplayTextin classAttribute<F extends FactoryBase<L,R>,FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>>
-
internal_reset
public void internal_reset()
- Specified by:
internal_resetin classAttribute<F extends FactoryBase<L,R>,FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>>
-
internal_endUsage
public void internal_endUsage()
- Overrides:
internal_endUsagein classAttribute<F extends FactoryBase<L,R>,FactoryViewAttribute<R extends FactoryBase<?,R>,L,F extends FactoryBase<L,R>>>
-
internal_visitChildren
public void internal_visitChildren(java.util.function.Consumer<FactoryBase<?,R>> consumer, boolean includeViews)
- Specified by:
internal_visitChildrenin interfaceFactoryChildrenEnclosingAttribute<R extends FactoryBase<?,R>,L>
-
-