本文整理汇总了Java中org.openide.util.HelpCtx.equals方法的典型用法代码示例。如果您正苦于以下问题:Java HelpCtx.equals方法的具体用法?Java HelpCtx.equals怎么用?Java HelpCtx.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.HelpCtx
的用法示例。
在下文中一共展示了HelpCtx.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Bridge
import org.openide.util.HelpCtx; //导入方法依赖的package包/类
/** @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());
}
}
示例2: getHelpCtx
import org.openide.util.HelpCtx; //导入方法依赖的package包/类
public HelpCtx getHelpCtx () {
HelpCtx defaultHelp = new HelpCtx (HELP_ID);
HelpCtx help = org.openide.explorer.ExplorerUtils.getHelpCtx (
getExplorerManager ().getSelectedNodes (),
defaultHelp
);
// bugfix #23551, add help id to subnodes of Templates category
// this check prevents mixed help ids on more selected nodes
if (!defaultHelp.equals (help)) {
// try if selected node isn't template
Node node = getExplorerManager ().getSelectedNodes ()[0];
HelpCtx readHelpId = getHelpId (node);
if (readHelpId != null) return readHelpId;
// next bugfix #23551, children have same helpId as parent if no specific is declared
while (node != null && !TEMPLATES_DISPLAY_NAME.equals (node.getDisplayName ())) {
readHelpId = getHelpId (node);
if (readHelpId != null) return readHelpId;
node = node.getParentNode ();
}
if (node != null && TEMPLATES_DISPLAY_NAME.equals (node.getDisplayName ())) {
return new HelpCtx ("org.netbeans.core.actions.OptionsAction$TemplatesSubnode"); // NOI18N
}
}
return help;
}
示例3: Menu
import org.openide.util.HelpCtx; //导入方法依赖的package包/类
/** 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());
}
}
}
示例4: associateHelp
import org.openide.util.HelpCtx; //导入方法依赖的package包/类
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);
}
}