本文整理匯總了Java中org.openide.util.HelpCtx.setHelpIDString方法的典型用法代碼示例。如果您正苦於以下問題:Java HelpCtx.setHelpIDString方法的具體用法?Java HelpCtx.setHelpIDString怎麽用?Java HelpCtx.setHelpIDString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.util.HelpCtx
的用法示例。
在下文中一共展示了HelpCtx.setHelpIDString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateHelp
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void updateHelp() {
//System.err.println ("Updating help for NbDialog...");
HelpCtx help = getHelpCtx();
// Handle help from the inner component automatically (see docs
// in DialogDescriptor):
if (HelpCtx.DEFAULT_HELP.equals(help)) {
Object msg = descriptor.getMessage();
if (msg instanceof Component) {
help = HelpCtx.findHelp((Component) msg);
}
if (HelpCtx.DEFAULT_HELP.equals(help)) help = null;
}
if (! Utilities.compareObjects(currentHelp, help)) {
currentHelp = help;
if (help != null && help.getHelpID() != null) {
//System.err.println ("New help ID for root pane: " + help.getHelpID ());
HelpCtx.setHelpIDString(getRootPane(), help.getHelpID());
}
// Refresh button list if it had already been created.
if (haveCalledInitializeButtons) initializeButtons();
}
}
示例2: SourceWizardPanel
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Creates new form SourceChooserPanel.
* @param it's panel wizard descriptor */
private SourceWizardPanel(Panel descPanel, boolean testRole) {
this.descPanel = descPanel;
this.testRole = testRole;
initComponents();
initAccessibility ();
setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);
initList();
putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(0));
if (testRole) {
setName(Util.getString("TXT_SelecTestSources")); //NOI18N
HelpCtx.setHelpIDString(this, Util.HELP_ID_SELECTTESTSOURCES);
} else {
setName(Util.getString("TXT_SelectSources")); //NOI18N
HelpCtx.setHelpIDString(this, Util.HELP_ID_SELECTSOURCES);
}
}
示例3: HelpStringCustomEditor
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Creates new form CodeCustomEditor.
* @param value value to be customized
* @param items for sleecteing in combo box
* @param helpItems patterns described in list
* @param comboText label for the combo-box, optionally with an ampersand marking the mnemonic character
*/
public HelpStringCustomEditor(String value, List items, List helpItems, String comboText, String helpID) {
initComponents();
combo.setModel(new DefaultComboBoxModel(items.toArray()));
combo.setSelectedItem(value);
list.setListData(helpItems.toArray());
list.setBackground(javax.swing.UIManager.getDefaults().getColor("TextField..disabledBackground")); // NOI18N
// list.setBackground(new Color(SystemColor.window.getRGB()));
Mnemonics.setLocalizedText(comboLabel, comboText);
Mnemonics.setLocalizedText(listLabel, I18nUtil.getBundle().getString("LBL_Arguments"));
initAccessibility ();
HelpCtx.setHelpIDString(this, helpID);
}
示例4: addNotify
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override
public void addNotify () {
super.addNotify ();
//show progress for initialize method
final Window w = findWindowParent ();
if (w != null) {
w.addWindowListener (new WindowAdapter (){
@Override
public void windowOpened (WindowEvent e) {
final WindowAdapter waa = this;
setWaitingState (true);
Utilities.startAsWorkerThread (PluginManagerUI.this,
new Runnable () {
@Override
public void run () {
try {
initTask.waitFinished ();
w.removeWindowListener (waa);
} finally {
setWaitingState (false);
}
}
},
NbBundle.getMessage (PluginManagerUI.class, "UnitTab_InitAndCheckingForUpdates"),
Utilities.getTimeOfInitialization ());
}
});
}
HelpCtx.setHelpIDString (this, PluginManagerUI.class.getName ());
tpTabs.addChangeListener (new ChangeListener () {
@Override
public void stateChanged (ChangeEvent evt) {
HelpCtx.setHelpIDString (PluginManagerUI.this, getHelpCtx ().getHelpID ());
}
});
}
示例5: CustomEditor
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Constructor. */
public CustomEditor(I18nString i18nString, Project project, FileObject file) {
super(i18nString.getSupport().getPropertyPanel(), false, project, file);
setI18nString(i18nString);
bundle = NbBundle.getBundle(FormI18nMnemonicEditor.class);
env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
env.addVetoableChangeListener(this);
HelpCtx.setHelpIDString(this, I18nUtil.HELP_ID_FORMED);
}
示例6: createAnchoringSubmenu
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void createAnchoringSubmenu(JMenu menu) {
Node[] nodes = getActivatedNodes();
List components = FormUtils.getSelectedLayoutComponents(nodes);
if ((components == null) || (components.size() < 1)) {
return;
}
if (!(menu.getMenuComponentCount() > 0)) {
ResourceBundle bundle = NbBundle.getBundle(SetAnchoringAction.class);
JCheckBoxMenuItem leftItem = new AnchoringMenuItem(
bundle.getString("CTL_AnchorLeft"), // NOI18N
components,
0);
JCheckBoxMenuItem rightItem = new AnchoringMenuItem(
bundle.getString("CTL_AnchorRight"), // NOI18N
components,
1);
JCheckBoxMenuItem topItem = new AnchoringMenuItem(
bundle.getString("CTL_AnchorTop"), // NOI18N
components,
2);
JCheckBoxMenuItem bottomItem = new AnchoringMenuItem(
bundle.getString("CTL_AnchorBottom"), // NOI18N
components,
3);
items = new JCheckBoxMenuItem[] {leftItem, rightItem, topItem, bottomItem};
for (int i=0; i<4; i++) {
items[i].addActionListener(getMenuItemListener());
HelpCtx.setHelpIDString(items[i], SetAnchoringAction.class.getName());
menu.add(items[i]);
}
}
updateState(components);
}
示例7: getPopupPresenter
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
JMenu layoutMenu = new LayoutMenu(getName());
layoutMenu.setEnabled(isEnabled());
HelpCtx.setHelpIDString(layoutMenu, SelectLayoutAction.class.getName());
return layoutMenu;
}
示例8: CustomEditor
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Constructor. */
public CustomEditor(I18nString i18nString, Project project, FileObject file) {
super(i18nString.getSupport().getPropertyPanel(), false, project, file);
bundle = NbBundle.getBundle(FormI18nIntegerEditor.class);
setI18nString(i18nString);
env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
env.addVetoableChangeListener(this);
HelpCtx.setHelpIDString(this, I18nUtil.HELP_ID_FORMED);
}
示例9: createResizabilitySubmenu
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void createResizabilitySubmenu(JMenu menu) {
Node[] nodes = getActivatedNodes();
List components = FormUtils.getSelectedLayoutComponents(nodes);
if ((components == null) || (components.size() < 1)) {
return;
}
if (!(menu.getMenuComponentCount() > 0)) {
ResourceBundle bundle = NbBundle.getBundle(SetResizabilityAction.class);
JCheckBoxMenuItem hItem = new ResizabilityMenuItem(
bundle.getString("CTL_ResizabilityH"), // NOI18N
components,
0);
JCheckBoxMenuItem vItem = new ResizabilityMenuItem(
bundle.getString("CTL_ResizabilityV"), // NOI18N
components,
1);
items = new JCheckBoxMenuItem[] {hItem, vItem};
for (int i=0; i<2; i++) {
items[i].addActionListener(getMenuItemListener());
HelpCtx.setHelpIDString(items[i], SetResizabilityAction.class.getName());
menu.add(items[i]);
}
}
updateState(components);
}
示例10: getPopupPresenter
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/**
* Returns a JMenuItem that presents this action in a Popup Menu.
* @return the JMenuItem representation for the action
*/
@Override
public JMenuItem getPopupPresenter() {
JMenu popupMenu = new JMenu(
NbBundle.getMessage(DesignParentAction.class, "ACT_DesignParentAction")); // NOI18N
popupMenu.setEnabled(isEnabled());
HelpCtx.setHelpIDString(popupMenu, DesignParentAction.class.getName());
createSubmenu(popupMenu);
return popupMenu;
}
示例11: testFindHelpHierarchically
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
public void testFindHelpHierarchically() throws Exception {
ExplorerPanel p = new ExplorerPanel();
p.setLayout(new BorderLayout());
BeanTreeView b = new BeanTreeView();
p.add(b, BorderLayout.CENTER);
JLabel l1 = new JLabel("test1");
HelpCtx.setHelpIDString(l1, "test");
p.add(l1, BorderLayout.NORTH);
JLabel l2 = new JLabel("test2");
assertEquals(HelpCtx.DEFAULT_HELP, HelpCtx.findHelp(l2));
p.add(l2, BorderLayout.SOUTH);
ExplorerManager m = p.getExplorerManager();
m.setRootContext(root);
assertEquals(Collections.EMPTY_LIST, Arrays.asList(m.getSelectedNodes()));
HelpCtx base = new HelpCtx(ExplorerPanel.class);
assertEquals(base, HelpCtx.findHelp(b));
m.setSelectedNodes(new Node[] {nodes[0]});
assertEquals(base, HelpCtx.findHelp(b));
m.setSelectedNodes(new Node[] {nodes[1]});
assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(b));
m.setSelectedNodes(new Node[] {nodes[1], nodes[2]});
assertEquals(base, HelpCtx.findHelp(b));
m.setSelectedNodes(new Node[] {nodes[1], nodes[3]});
assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(b));
assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(p));
assertEquals(new HelpCtx("test"), HelpCtx.findHelp(l1));
assertEquals(new HelpCtx("foo"), HelpCtx.findHelp(l2));
}
示例12: updateHelpAndAccessibleDescription
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
private void updateHelpAndAccessibleDescription() {
HelpCtx.setHelpIDString(this, null);
int i = editorsCombo.getSelectedIndex();
HelpCtx helpCtx = i < 0 ? null : HelpCtx.findHelp(cardPanel.getComponent(i));
String helpID = helpCtx != null && helpCtx != HelpCtx.DEFAULT_HELP ? helpCtx.getHelpID() : "f1_mat_prop_html"; // NOI18N
HelpCtx.setHelpIDString(this, helpID);
updateAccessibleDescription(i < 0 ? null : cardPanel.getComponent(i));
}
示例13: 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);
}
}
示例14: ConditionsPanel
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
/** Creates new form ConditionsPanel */
public ConditionsPanel(String helpId) {
initComponents();
HelpCtx.setHelpIDString(tfCondition, helpId);
tfConditionFieldForUI = new javax.swing.JTextField();
tfConditionFieldForUI.setEnabled(false);
tfConditionFieldForUI.setToolTipText(tfCondition.getToolTipText());
classFilterCheckBoxActionPerformed(null);
conditionCheckBoxActionPerformed(null);
cbWhenHitCountActionPerformed(null);
int preferredHeight = tfConditionFieldForUI.getPreferredSize().height;
Dimension spDim = spCondition.getPreferredSize();
if (spDim.height > preferredHeight) {
preferredHeight = spDim.height;
tfConditionFieldForUI.setPreferredSize(new java.awt.Dimension(tfConditionFieldForUI.getPreferredSize().width, preferredHeight));
}
Border b = spCondition.getBorder();
if (b instanceof WatchPanel.DelegatingBorder) {
Insets insets = ((WatchPanel.DelegatingBorder) b).getInsets();
insets.right = 1;
((WatchPanel.DelegatingBorder) b).setInsets(insets);
}
spCondition.setPreferredSize(spDim);
//spCondition.setMinimumSize(spDim);
tfHitCountFilter.setPreferredSize(
new Dimension(8*tfHitCountFilter.getFontMetrics(tfHitCountFilter.getFont()).charWidth('8'),
tfHitCountFilter.getPreferredSize().height));
cbHitStyle.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
NbBundle.getMessage(ConditionsPanel.class, "ConditionsPanel.cbWhenHitCount.equals"), // NOI18N
NbBundle.getMessage(ConditionsPanel.class, "ConditionsPanel.cbWhenHitCount.greater"), // NOI18N
NbBundle.getMessage(ConditionsPanel.class, "ConditionsPanel.cbWhenHitCount.multiple") // NOI18N
}));
conditionComboBox.setEditor(new ConditionComboBoxEditor());
Object[] conditions = getSavedConditions();
conditionComboBox.setModel(new DefaultComboBoxModel(conditions));
}
示例15: getMenuPresenter
import org.openide.util.HelpCtx; //導入方法依賴的package包/類
public JMenuItem getMenuPresenter() {
// beware, we shouldn't cache menu intstance, because getMenuPresenter
// can be legally called several times and menu component cannot be
// contained in more than one component hierarchy
JMenu menu = new org.openide.awt.JMenuPlus();
Mnemonics.setLocalizedText(menu, getName());
menu.setHorizontalTextPosition(JMenu.RIGHT);
menu.setHorizontalAlignment(JMenu.LEFT);
menu.setIcon(getIcon());
HelpCtx.setHelpIDString(menu, WorkspaceSwitchAction.class.getName());
final WindowManager pool = WindowManager.getDefault();
final Hashtable menu2Workspace = new Hashtable(10);
// ^ maps listener on workspace
final Hashtable workspace2Menu = new Hashtable(10);
// ^ maps workspace to menuitem
final Hashtable workspace2Listener = new Hashtable(10);
// ^ maps workspace to action listener
final Workspace[] currentDeskRef = new Workspace[1];
currentDeskRef[0] = pool.getCurrentWorkspace();
// attach all workspaces
Workspace[] workspaces = pool.getWorkspaces();
for (int i = 0; i < workspaces.length; i++) {
attachWorkspace(workspaces[i], currentDeskRef, workspace2Menu, menu2Workspace, workspace2Listener, menu);
}
// check on currently active workspace
JRadioButtonMenuItem curItem = (JRadioButtonMenuItem) workspace2Menu.get(currentDeskRef[0]);
if (curItem != null) {
curItem.setSelected(true);
}
// listen to the changes in workspaces
pool.addPropertyChangeListener(
getWorkspacePoolListener(workspace2Menu, menu2Workspace, workspace2Listener, currentDeskRef, menu)
);
return menu;
}