@Override public void setHelpCtx(final HelpCtx helpCtx) { isWizardWideHelpSet = null != helpCtx && !HelpCtx.DEFAULT_HELP.equals( helpCtx ); doSetHelpCtx( helpCtx ); }
/** Set new help context for this dialog descriptor. * Fires property change event if successful. * <p>The implementation should automatically display a help * button among the secondary options, without your needing to * specify it, if the help context on the descriptor is neither * <code>null</code> nor {@link HelpCtx#DEFAULT_HELP}. If the * descriptor is <code>null</code>, this feature will be disabled * (you can still add your own help button manually if you wish, * of course). If <code>DEFAULT_HELP</code> (the default), normally the button * will also be disabled, however if the inner pane is a component * and this component has an {@link HelpCtx#findHelp associated} * help ID, that will be used automatically. So most users should never * need to manually add a help button: call this method with the correct * context, or associate an ID with the displayed component. Note that to * set it to <code>null</code> you must explicitly call this method; passing * <code>null</code> in the constructor actually sets it to <code>DEFAULT_HELP</code>. * * @param helpCtx new help context, can be <code>null</code> (no help) * @see #getHelpCtx */ public void setHelpCtx(final HelpCtx helpCtx) { if ((this.helpCtx != null) && (this.helpCtx.equals(helpCtx))) { return; } HelpCtx oldHelpCtx = this.helpCtx; this.helpCtx = helpCtx; firePropertyChange(PROP_HELP_CTX, oldHelpCtx, helpCtx); }
/** @param comp component * @param action the action */ public Bridge(JComponent comp, Action action) { if(comp == null || action == null) { throw new IllegalArgumentException( "None of the arguments can be null: comp=" + comp + //NOI18N ", action=" + action); // NOI18N } this.comp = comp; this.action = action; actionL = WeakListeners.propertyChange(this, action); // associate context help, if applicable // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic HelpCtx help = findHelp(action); if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) { HelpCtx.setHelpIDString(comp, help.getHelpID()); } }
private void associateHelp(JComponent comp, HelpCtx help) { if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) { HelpCtx.setHelpIDString(comp, help.getHelpID()); } else { HelpCtx.setHelpIDString(comp, null); } } }
/** Utility method to get context help from a node selection. * Tries to find context helps for selected nodes. * If there are some, and they all agree, uses that. * In all other cases, uses the supplied generic help. * * @param sel a list of nodes to search for help in * @param def the default help to use if they have none or do not agree * @return a help context * @since 4.40 */ public static HelpCtx getHelpCtx (Node[] sel, HelpCtx def) { HelpCtx result = null; for (int i = 0; i < sel.length; i++) { HelpCtx attempt = sel[i].getHelpCtx (); if (attempt != null && ! attempt.equals (HelpCtx.DEFAULT_HELP)) { if (result == null || result.equals (attempt)) { result = attempt; } else { // More than one found, and they conflict. Get general help on the Explorer instead. result = null; break; } } } return result != null ? result : def; } }
/** Utility method to get context help from a node selection. * Tries to find context helps for selected nodes. * If there are some, and they all agree, uses that. * In all other cases, uses the supplied generic help. * * @param sel a list of nodes to search for help in * @param def the default help to use if they have none or do not agree * @return a help context * @since 4.40 */ public static HelpCtx getHelpCtx (Node[] sel, HelpCtx def) { HelpCtx result = null; for (int i = 0; i < sel.length; i++) { HelpCtx attempt = sel[i].getHelpCtx (); if (attempt != null && ! attempt.equals (HelpCtx.DEFAULT_HELP)) { if (result == null || result.equals (attempt)) { result = attempt; } else { // More than one found, and they conflict. Get general help on the Explorer instead. result = null; break; } } } return result != null ? result : def; } }
/** Set new help context for this dialog descriptor. * Fires property change event if successful. * <p>The implementation should automatically display a help * button among the secondary options, without your needing to * specify it, if the help context on the descriptor is neither * <code>null</code> nor {@link HelpCtx#DEFAULT_HELP}. If the * descriptor is <code>null</code>, this feature will be disabled * (you can still add your own help button manually if you wish, * of course). If <code>DEFAULT_HELP</code> (the default), normally the button * will also be disabled, however if the inner pane is a component * and this component has an {@link HelpCtx#findHelp associated} * help ID, that will be used automatically. So most users should never * need to manually add a help button: call this method with the correct * context, or associate an ID with the displayed component. Note that to * set it to <code>null</code> you must explicitly call this method; passing * <code>null</code> in the constructor actually sets it to <code>DEFAULT_HELP</code>. * * @param helpCtx new help context, can be <code>null</code> (no help) * @see #getHelpCtx */ public void setHelpCtx (final HelpCtx helpCtx) { if ((this.helpCtx != null) && (this.helpCtx.equals(helpCtx))) return; HelpCtx oldHelpCtx = this.helpCtx; this.helpCtx = helpCtx; firePropertyChange(PROP_HELP_CTX, oldHelpCtx, helpCtx); }
/** Set new help context for this dialog descriptor. * Fires property change event if successful. * <p>The implementation should automatically display a help * button among the secondary options, without your needing to * specify it, if the help context on the descriptor is neither * <code>null</code> nor {@link HelpCtx#DEFAULT_HELP}. If the * descriptor is <code>null</code>, this feature will be disabled * (you can still add your own help button manually if you wish, * of course). If <code>DEFAULT_HELP</code> (the default), normally the button * will also be disabled, however if the inner pane is a component * and this component has an {@link HelpCtx#findHelp associated} * help ID, that will be used automatically. So most users should never * need to manually add a help button: call this method with the correct * context, or associate an ID with the displayed component. Note that to * set it to <code>null</code> you must explicitly call this method; passing * <code>null</code> in the constructor actually sets it to <code>DEFAULT_HELP</code>. * * @param helpCtx new help context, can be <code>null</code> (no help) * @see #getHelpCtx */ public void setHelpCtx (final HelpCtx helpCtx) { if ((this.helpCtx != null) && (this.helpCtx.equals(helpCtx))) return; HelpCtx oldHelpCtx = this.helpCtx; this.helpCtx = helpCtx; firePropertyChange(PROP_HELP_CTX, oldHelpCtx, helpCtx); }
private void associateHelp (JComponent comp, HelpCtx help) { if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (comp, help.getHelpID ()); else HelpCtx.setHelpIDString (comp, null); }
private void associateHelp (JComponent comp, HelpCtx help) { if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (comp, help.getHelpID ()); else HelpCtx.setHelpIDString (comp, null); }
/** Constructor that permits specification of the action on the node, * and permits overriding the name and icon of the menu. * * @param node node to represent * @param action action called when node selected * @param setName <code>true</code> to automatically set the name and icon of the item */ public Menu (final Node node, NodeAcceptor action, boolean setName) { this.node = node; this.action = action; if (setName) { MenuItem.initialize (this, node); HelpCtx help = node.getHelpCtx (); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (this, help.getHelpID ()); } }
/** Constructor that permits specification of the action on the node, * and permits overriding the name and icon of the menu. * * @param node node to represent * @param action action called when node selected * @param setName <code>true</code> to automatically set the name and icon of the item */ public Menu (final Node node, NodeAcceptor action, boolean setName) { this.node = node; this.action = action; if (setName) { MenuItem.initialize (this, node); HelpCtx help = node.getHelpCtx (); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (this, help.getHelpID ()); } }
/** Constructor that permits specification of the action on the node, * and permits overriding the name and icon of the menu. * * @param node node to represent * @param action action called when node selected * @param setName <code>true</code> to automatically set the name and icon of the item */ public Menu(final Node node, NodeAcceptor action, boolean setName) { this.node = node; this.action = action; if (setName) { MenuItem.initialize(this, node); HelpCtx help = node.getHelpCtx(); if ((help != null) && !help.equals(HelpCtx.DEFAULT_HELP) && (help.getHelpID() != null)) { HelpCtx.setHelpIDString(this, help.getHelpID()); } } }
/** @param comp component * @param action the action */ public Bridge (JComponent comp, Action action) { this.comp = comp; this.action = action; // visibility listener Bridge.this.comp.addPropertyChangeListener(new VisL()); if (Bridge.this.comp.isShowing ()) { addNotify (); } // associate context help, if applicable // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic HelpCtx help = findHelp (action); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (comp, help.getHelpID ()); }
/** @param comp component * @param action the action */ public Bridge (JComponent comp, Action action) { this.comp = comp; this.action = action; // visibility listener Bridge.this.comp.addPropertyChangeListener(new VisL()); if (Bridge.this.comp.isShowing ()) { addNotify (); } // associate context help, if applicable // [PENDING] probably belongs in ButtonBridge.updateState to make it dynamic HelpCtx help = findHelp (action); if (help != null && ! help.equals (HelpCtx.DEFAULT_HELP) && help.getHelpID () != null) HelpCtx.setHelpIDString (comp, help.getHelpID ()); }