/** * PRE: isTargetable(target) * @param target */ public void setTarget(T target) { T oldTarget = getTarget(); uninstallTarget(); this.target = target; installTarget(); firePropertyChange("target", oldTarget, getTarget()); }
/** * * @return visited state */ public boolean isVisited() { Boolean visited = (Boolean) getValue(VISITED_KEY); return Boolean.TRUE.equals(visited); }
/** * Set the visited property. * * @param visited */ public void setVisited(boolean visited) { putValue(VISITED_KEY, visited); }
/** * hook for subclasses to update internal state after * a new target has been set. <p> * * Subclasses are free to decide the details. * Here: * <ul> * <li> the text property is set to target.toString or empty String if * the target is null * <li> visited is set to false. * </ul> */ protected void installTarget() { setName(target != null ? target.toString() : "" ); setVisited(false); }
/** * {@inheritDoc} <p> * * PENDING JW: Needs to be overridden - doesn't comply to contract!. Not sure * how to do it without disturbing the hyperlinks current setting? * All hyperlink properties are defined by the LinkAction configured * with the target ... */ @Override public String getString(Object value) { if (isTargetable(value)) { Object oldTarget = linkAction.getTarget(); linkAction.setTarget(value); String text = linkAction.getName(); linkAction.setTarget(oldTarget); return text; } return super.getString(value); }
/** * Instantiates a LinkAction with a target of type targetClass. * The visited property is initialized as defined by * {@link AbstractHyperlinkAction#installTarget()} * * @param target the target this action should act on. */ public AbstractHyperlinkAction(T target) { setTarget(target); }
@Override protected void installTarget() { // doohh ... this is called from super's constructor before we are // fully initialized if (visitor == null) return; super.installTarget(); updateEnabled(); }
/** * {@inheritDoc} <p> * * PENDING JW: Needs to be overridden - doesn't comply to contract!. Not sure * how to do it without disturbing the hyperlinks current setting? * All hyperlink properties are defined by the LinkAction configured * with the target ... */ @Override public String getString(Object value) { if (isTargetable(value)) { Object oldTarget = linkAction.getTarget(); linkAction.setTarget(value); String text = linkAction.getName(); linkAction.setTarget(oldTarget); return text; } return super.getString(value); }
/** * hook for subclasses to update internal state after * a new target has been set. <p> * * Subclasses are free to decide the details. * Here: * <ul> * <li> the text property is set to target.toString or empty String if * the target is null * <li> visited is set to false. * </ul> */ protected void installTarget() { setName(target != null ? target.toString() : "" ); setVisited(false); }
/** * Instantiates a LinkAction with a target of type targetClass. * The visited property is initialized as defined by * {@link AbstractHyperlinkAction#installTarget()} * * @param target the target this action should act on. */ public AbstractHyperlinkAction(T target) { setTarget(target); }
@Override protected void installTarget() { // doohh ... this is called from super's constructor before we are // fully initialized if (visitor == null) return; super.installTarget(); updateEnabled(); }
/** * PRE: isTargetable(target) * @param target */ public void setTarget(T target) { T oldTarget = getTarget(); uninstallTarget(); this.target = target; installTarget(); firePropertyChange("target", oldTarget, getTarget()); }
/** * {@inheritDoc} <p> * * PENDING JW: Needs to be overridden - doesn't comply to contract!. Not sure * how to do it without disturbing the hyperlinks current setting? * All hyperlink properties are defined by the LinkAction configured * with the target ... */ @Override public String getString(Object value) { if (isTargetable(value)) { Object oldTarget = linkAction.getTarget(); linkAction.setTarget(value); String text = linkAction.getName(); linkAction.setTarget(oldTarget); return text; } return super.getString(value); }
/** * hook for subclasses to update internal state after * a new target has been set. <p> * * Subclasses are free to decide the details. * Here: * <ul> * <li> the text property is set to target.toString or empty String if * the target is null * <li> visited is set to false. * </ul> */ protected void installTarget() { setName(target != null ? target.toString() : "" ); setVisited(false); }
/** * * @return visited state */ public boolean isVisited() { Boolean visited = (Boolean) getValue(VISITED_KEY); return Boolean.TRUE.equals(visited); }
/** * Instantiates a LinkAction with a target of type targetClass. * The visited property is initialized as defined by * {@link AbstractHyperlinkAction#installTarget()} * * @param target the target this action should act on. */ public AbstractHyperlinkAction(T target) { setTarget(target); }
/** * Set the visited property. * * @param visited */ public void setVisited(boolean visited) { putValue(VISITED_KEY, visited); }