Class FactoryPolymorphicAttribute<R extends FactoryBase<?,R>,L>
- java.lang.Object
-
- io.github.factoryfx.factory.attribute.Attribute<U,A>
-
- io.github.factoryfx.factory.attribute.dependency.ReferenceBaseAttribute<R,F,F,A>
-
- io.github.factoryfx.factory.attribute.dependency.FactoryBaseAttribute<R,L,FactoryBase<? extends L,R>,FactoryPolymorphicAttribute<R,L>>
-
- io.github.factoryfx.factory.attribute.dependency.FactoryPolymorphicAttribute<R,L>
-
- Type Parameters:
L- the base interface/class
- All Implemented Interfaces:
AttributeCopy<FactoryBase<? extends L,R>>,AttributeMatch<FactoryBase<? extends L,R>>,AttributeMerger<FactoryBase<? extends L,R>>,AttributeValue<FactoryBase<? extends L,R>>,FactoryChildrenEnclosingAttribute<R,FactoryPolymorphicAttribute<R,L>>
public class FactoryPolymorphicAttribute<R extends FactoryBase<?,R>,L> extends FactoryBaseAttribute<R,L,FactoryBase<? extends L,R>,FactoryPolymorphicAttribute<R,L>>
Attribute for polymorphic Reference. Usually interface with different implementations
-
-
Field Summary
-
Fields inherited from class io.github.factoryfx.factory.attribute.dependency.ReferenceBaseAttribute
additionalDeleteAction, clazz, parent
-
-
Constructor Summary
Constructors Constructor Description FactoryPolymorphicAttribute()FactoryPolymorphicAttribute(java.lang.Class<L> liveObjectClass, java.lang.Class<? extends PolymorphicFactory<L>>... possibleFactoriesClasses)FactoryPolymorphicAttribute(java.util.function.Consumer<FactoryPolymorphicAttribute<R,L>> setup)Explanation see:FactoryAttribute(Consumer)}
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Class<?>>internal_possibleFactoriesClasses()intended to be used from code generatorsvoidinternal_setReferenceClass(java.lang.Class<?> clazz)setup value selection and new value adding for user editingFactoryPolymorphicAttribute<R,L>setup(java.lang.Class<L> liveObjectClass, java.lang.Class<? extends PolymorphicFactory<?>>... possibleFactoriesClasses)setup for select and new value editingFactoryPolymorphicAttribute<R,L>setupUnsafe(java.lang.Class liveObjectClass, java.lang.Class... possibleFactoriesClasses)workaround: if possibleFactoriesClasses has generic parameter the normal setup method doesn't work-
Methods inherited from class io.github.factoryfx.factory.attribute.dependency.FactoryBaseAttribute
get, getDisplayText, getOptional, getValue, instance, internal_copyTo, internal_deleteFactory, internal_fixDuplicateObjects, internal_merge, internal_mergeMatch, internal_required, internal_semanticCopyTo, internal_validate, internal_visitChildren, nullable, set, setValue
-
Methods inherited from class io.github.factoryfx.factory.attribute.dependency.ReferenceBaseAttribute
additionalDeleteAction, catalogueBased, createAttributeStorageMetadata, internal_addBackReferences, internal_createNewPossibleValues, internal_getCopySemantic, internal_getReferenceClass, internal_isCatalogueBased, internal_isUserCreatable, internal_isUserSelectable, internal_possibleValues, internal_reset, newValuesProvider, newValuesProvider, possibleValueProvider, setCopySemantic, userNotCreatable, userNotSelectable
-
Methods inherited from class io.github.factoryfx.factory.attribute.Attribute
addonText, de, en, es, fr, internal_addListener, internal_endUsage, internal_getAddonText, internal_getListeners, internal_getPreferredLabelText, internal_getPreferredTooltipText, internal_hasWritePermission, internal_isUserReadOnly, internal_removeAllListener, internal_removeListener, 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
-
-
-
-
Constructor Detail
-
FactoryPolymorphicAttribute
public FactoryPolymorphicAttribute()
-
FactoryPolymorphicAttribute
public FactoryPolymorphicAttribute(java.util.function.Consumer<FactoryPolymorphicAttribute<R,L>> setup)
Explanation see:FactoryAttribute(Consumer)}- Parameters:
setup- setup function
-
FactoryPolymorphicAttribute
@SafeVarargs public FactoryPolymorphicAttribute(java.lang.Class<L> liveObjectClass, java.lang.Class<? extends PolymorphicFactory<L>>... possibleFactoriesClasses)
-
-
Method Detail
-
setupUnsafe
@SafeVarargs public final FactoryPolymorphicAttribute<R,L> setupUnsafe(java.lang.Class liveObjectClass, java.lang.Class... possibleFactoriesClasses)
workaround: if possibleFactoriesClasses has generic parameter the normal setup method doesn't work- Parameters:
liveObjectClass- liveObjectClasspossibleFactoriesClasses- possibleFactoriesClasses- Returns:
- self
-
setup
@SafeVarargs public final FactoryPolymorphicAttribute<R,L> setup(java.lang.Class<L> liveObjectClass, java.lang.Class<? extends PolymorphicFactory<?>>... possibleFactoriesClasses)
setup for select and new value editing- Parameters:
liveObjectClass- type of liveobjectpossibleFactoriesClasses- possible factories that crate the liveobject, PolymorphicFactory<L> would be correct but doesn't work- Returns:
- self
-
internal_possibleFactoriesClasses
public java.util.List<java.lang.Class<?>> internal_possibleFactoriesClasses()
intended to be used from code generators- Returns:
- list of possible classes
-
internal_setReferenceClass
public void internal_setReferenceClass(java.lang.Class<?> clazz)
Description copied from class:ReferenceBaseAttributesetup value selection and new value adding for user editing- Specified by:
internal_setReferenceClassin interfaceFactoryChildrenEnclosingAttribute<R extends FactoryBase<?,R>,L>- Overrides:
internal_setReferenceClassin classReferenceBaseAttribute<R extends FactoryBase<?,R>,FactoryBase<? extends L,R extends FactoryBase<?,R>>,FactoryBase<? extends L,R extends FactoryBase<?,R>>,FactoryPolymorphicAttribute<R extends FactoryBase<?,R>,L>>- Parameters:
clazz- class
-
-