Package com.illumon.iris.gui.filterlink
Class FilterLinkHelper
java.lang.Object
com.illumon.iris.gui.filterlink.FilterLinkHelper
A helper class that implements basic Filter Link functionality. Classes that implement LinkSource or LinkTarget can
delegate many of their methods to this class.
-
Constructor Summary
ConstructorsConstructorDescriptionFilterLinkHelper
(com.fishlib.io.logger.Logger log, IrisView view, Linkable linkable) FilterLinkHelper
(com.fishlib.io.logger.Logger log, IrisView view, Linkable linkable, Consumer<ImageIcon> filterIconChangedHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTarget
(LinkTarget target) void
Opens the link editor dialog.void
Sends a link event to all targets.void
forEachTarget
(Consumer<LinkTarget> action) Execute the specified action against each target of this linkable.Get the appropriate link icon for the currently established set of links.getLinks()
getLinks
(LinkSource source) void
init()
boolean
isLinked()
void
makeLink
(LinkSource from, String sourceColumn, String targetColumn, Condition condition) void
If this helper was constructed with an iconChangedHandler it invokes that with the appropriate icon, otherwise it will update the view icon based on the current link status.void
void
removeAllLinks
(LinkSource from) void
removeBrokenLinks
(LinkTarget target) Search for and remove all links to the specified target that are broken (a column does not exist on one or both sides)void
removeLink
(LinkSource from, String srcColumn, String targetColumn, Condition condition) void
removeLink
(LinkTarget to, String srcColumn, String targetColumn, Condition condition) Remove the specified link from this object to the specified target.void
removeTarget
(LinkTarget target) void
tryLinkFrom
(Window win) Initiates the process of creating a link from another Linkable.void
Initiates the process of creating a link to another Linkable.
-
Constructor Details
-
FilterLinkHelper
-
FilterLinkHelper
-
-
Method Details
-
init
public void init() -
addTarget
- See Also:
-
removeTarget
- See Also:
-
getTargets
- See Also:
-
makeLink
public void makeLink(LinkSource from, String sourceColumn, String targetColumn, Condition condition) -
removeLink
-
removeLink
Remove the specified link from this object to the specified target.- Parameters:
to
- the target object of the linksrcColumn
- the source column of the linktargetColumn
- the target column of the linkcondition
- the link condition
-
removeAllLinks
- See Also:
-
getLinks
- See Also:
-
getLinks
- See Also:
-
removeAllLinks
public void removeAllLinks()- See Also:
-
isLinked
public boolean isLinked()- See Also:
-
getSourceLinkColumns
- See Also:
-
maybeUpdateIcon
public void maybeUpdateIcon()If this helper was constructed with an iconChangedHandler it invokes that with the appropriate icon, otherwise it will update the view icon based on the current link status. -
getLinkIcon
Get the appropriate link icon for the currently established set of links.- Returns:
- an
ImageIcon
representing the proper link state, or null if no links
-
tryLinkFrom
Initiates the process of creating a link from another Linkable.- Parameters:
win
- the parent window for the link dialog
-
tryLinkTo
Initiates the process of creating a link to another Linkable.- Parameters:
win
- the parent window for the link dialog
-
editLinks
Opens the link editor dialog.- Parameters:
win
- the parent window for the link dialog
-
fireEvent
Sends a link event to all targets. This may be hooked up to a double click. If any links are detected as broken it will notify the user with an option to ignore, repair, or break the suspect links.- Parameters:
event
- the link event to send
-
forEachTarget
Execute the specified action against each target of this linkable.- Parameters:
action
- the action to execute
-
removeBrokenLinks
Search for and remove all links to the specified target that are broken (a column does not exist on one or both sides)- Parameters:
target
- the target to remove broken links from
-