Package com.iizigo.link
Class LinkData
java.lang.Object
com.iizigo.link.LinkData
Data for the link operation, i.e. the target and the sources of the operation.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionLinkData
(IAdaptable target, GProp<?>[] props) Creates the link data information.LinkData
(IAdaptable target, List<IAdaptable> sources) Creates the link data information.LinkData
(IAdaptable target, IStructuredSelection selection) Creates the link data information.Method Summary
Modifier and TypeMethodDescription<T> T
adapt
(IAdaptable adaptable, Class<T> adaptToClass) Adapts an object if possible to the class.static ILinkCapable
Gets or creates an adapter for an object.void
assignProcessed
(ILinkCapable linkCapable, Collection<IAdaptable> sources) Assigns the set of sources that are processed by the link-capable processor.void
assignProcessed
(ILinkCapable linkCapable, IAdaptable source) Assigns the set of sources that are processed by the link-capable processor.void
assignProcessed
(ILinkCapable linkCapable, IAdaptable... sources) Assigns the set of sources that are processed by the link-capable processor.canLink()
Checks if the operation could link.Attempt to perform the link.Returns the list of possible ILinkCapable sources.getLinkTargets
(UIPanelBase panel, List<ILinkCapable> linkCapableList) Finds the list of UI components that this link capable component can be linked to in a panel.Returns the source properties.Returns the source.<T> ArrayList<T>
getSources
(Class<T> adaptedClass) Returns the source adapted to the requested class.Gets the target adaptable.GProp<?>
Gets the target property.static boolean
isLinkable
(ISelection sel) Checks if a selection is linkable.static boolean
Gets or creates an adapter for an object.
Constructor Details
LinkData
Creates the link data information.- Parameters:
target
- The target adaptable.props
- The properties.
LinkData
Creates the link data information.- Parameters:
target
- The target adaptable.selection
- The structured selection.
LinkData
Creates the link data information.- Parameters:
target
- The target adaptable.sources
- The unmodifiable list of adaptable sources.
Method Details
getTarget
Gets the target adaptable.- Returns:
- The target, never null.
getTargetProperty
Gets the target property.- Returns:
- A cached target property, may be null.
getSources
Returns the source.- Returns:
- The unmodifiable list of the properties. The list may be empty.
adapt
Adapts an object if possible to the class.- Parameters:
adaptable
- The object.adaptToClass
- The class to adapt to.- Returns:
- The adapted instance, or null if it couldn't be adapted.
getSources
Returns the source adapted to the requested class.- Parameters:
adaptedClass
- The class to adapt to.- Returns:
- A NEW list (that may be empty).
getSourceProperties
Returns the source properties.- Returns:
- The unmodifiable list of the properties. The list may be empty.
getLinkSources
Returns the list of possible ILinkCapable sources.- Returns:
- A cached unmodifiable list of the possible link capable sources.
assignProcessed
Assigns the set of sources that are processed by the link-capable processor. This makes it possible to verify that all sources are used once and not more, and that none are left out.This method can be called several times for the same link-capable processor, the list of sources will be increased.
- Parameters:
linkCapable
- The link-capable instance.source
- The source processed.
assignProcessed
Assigns the set of sources that are processed by the link-capable processor. This makes it possible to verify that all sources are used once and not more, and that none are left out.This method can be called several times for the same link-capable processor, the list of sources will be increased.
- Parameters:
linkCapable
- The link-capable instance.sources
- The sources processed.
assignProcessed
Assigns the set of sources that are processed by the link-capable processor. This makes it possible to verify that all sources are used once and not more, and that none are left out.This method can be called several times for the same link-capable processor, the list of sources will be increased.
- Parameters:
linkCapable
- The link-capable instance.sources
- The sources processed.
canLink
Checks if the operation could link.- Returns:
- A status.
doLink
Attempt to perform the link.- Parameters:
doPerform
- The perform operation flag.shell
- The shell is only needed when performing the operation.doDisplayDialog
- Flag to always display dialog.- Returns:
- The feedback.
adaptLinkCapable
Gets or creates an adapter for an object. Object types supported are: ILinkCapable, GProp, DesignerProp, IResource, IMethod, IAdaptable (IType).- Parameters:
o
- The object.- Returns:
- The link capable, or null if not link capable.
isLinkCapableAdaptable
Gets or creates an adapter for an object. Object types supported are: ILinkCapable, GProp, DesignerProp, IResource, IMethod, IAdaptable (IType).- Parameters:
o
- The object.- Returns:
- true if it could potentially become an ILinkCapable object if adapted.
isLinkable
Checks if a selection is linkable.getLinkTargets
Finds the list of UI components that this link capable component can be linked to in a panel.- Parameters:
panel
- The target panel.