本文整理匯總了Java中org.openide.util.HelpCtx類的典型用法代碼示例。如果您正苦於以下問題:Java HelpCtx類的具體用法?Java HelpCtx怎麽用?Java HelpCtx使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HelpCtx類屬於org.openide.util包,在下文中一共展示了HelpCtx類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: blocksButtonActionPerformed
import org.openide.util.HelpCtx; //導入依賴的package包/類
private void blocksButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_blocksButtonActionPerformed
Issue i = IssueQuickSearch.selectIssue(
NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.message"), // NOI18N
BugzillaUtil.getRepository(issue.getRepository()),
this,
new HelpCtx("org.netbeans.modules.bugzilla.blocksChooser")); // NOI18N
if (i != null) {
String newIssueID = i.getID();
StringBuilder sb = new StringBuilder();
if (!blocksField.getText().trim().equals("")) { // NOI18N
sb.append(blocksField.getText()).append(',').append(' ');
}
sb.append(newIssueID);
blocksField.setText(sb.toString());
}
}
示例2: createNewPanel
import org.openide.util.HelpCtx; //導入依賴的package包/類
public static QCommitPanel createNewPanel (final File[] roots, final File repository, String commitMessage,
final String helpCtxId) {
final Preferences preferences = HgModuleConfig.getDefault().getPreferences();
List<String> recentUsers = getRecentUsers(repository);
final DefaultCommitParameters parameters = new QCreatePatchParameters(preferences, commitMessage, null, recentUsers);
final Collection<HgQueueHook> hooks = VCSHooks.getInstance().getHooks(HgQueueHook.class);
return Mutex.EVENT.readAccess(new Mutex.Action<QCommitPanel>() {
@Override
public QCommitPanel run () {
DiffProvider diffProvider = new DiffProvider();
VCSCommitPanelModifier modifier = RefreshPanelModifier.getDefault("create"); //NOI18N
HgQueueHookContext hooksCtx = new HgQueueHookContext(roots, null, null);
return new QCommitPanel(new QCommitTable(modifier), roots, repository, parameters, preferences, hooks, hooksCtx, diffProvider, new ModifiedNodesProvider(),
new HelpCtx(helpCtxId));
}
});
}
示例3: getHelpCtx
import org.openide.util.HelpCtx; //導入依賴的package包/類
public HelpCtx getHelpCtx() {
return currentHelpCtx;
/*
System.out.println("Get Help Ctx");
Thread.dumpStack();
if ( currentCustomizer != null ) {
// System.out.println( "C " + HelpCtx.findHelp( currentCustomizer ) );
return HelpCtx.findHelp( currentCustomizer );
}
/*
else {
// System.out.println( "P " + HelpCtx.findHelp( currentCustomizer ) );
return HelpCtx.findHelp( customizerPanel );
}
// XXX
return null;
*/
}
示例4: testItemHelp
import org.openide.util.HelpCtx; //導入依賴的package包/類
public void testItemHelp() throws Exception {
FileObject item1 = getItemFile( categoryNames[0], itemNames[0][0] );
FileObject item2 = getItemFile( categoryNames[0], itemNames[0][1] );
item1.setAttribute( PaletteController.ATTR_HELP_ID, "DummyHelpId" );
PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), new DummyActions() );
Model model = pc.getModel();
Category[] categories = model.getCategories();
Item[] items = categories[0].getItems();
Node node1 = items[0].getLookup().lookup( Node.class );
Node node2 = items[1].getLookup().lookup( Node.class );
HelpCtx help1 = node1.getHelpCtx();
HelpCtx help2 = node2.getHelpCtx();
assertEquals( "Custom help", "DummyHelpId", help1.getHelpID() );
assertEquals( "Default help", HelpCtx.DEFAULT_HELP, help2 );
}
示例5: showDetails
import org.openide.util.HelpCtx; //導入依賴的package包/類
private static void showDetails(RunningVM vm) {
HTMLTextArea area = new HTMLTextArea();
JScrollPane areaScroll = new JScrollPane(area, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
areaScroll.setBorder(BorderFactory.createEmptyBorder());
areaScroll.setViewportBorder(BorderFactory.createEmptyBorder());
areaScroll.setPreferredSize(new Dimension(500, 260));
configureScrollBar(areaScroll.getVerticalScrollBar());
configureScrollBar(areaScroll.getHorizontalScrollBar());
area.setText(getDetails(vm));
area.setCaretPosition(0);
HelpCtx helpCtx = new HelpCtx("ProcessDetails.HelpCtx"); //NOI18N
JButton close = new JButton(Bundle.AttachDialog_BtnClose());
close.setDefaultCapable(true);
DialogDescriptor dd = new DialogDescriptor(areaScroll, Bundle.AttachDialog_DetailsCaption(getProcessName(vm.getMainClass())),
true, new Object[] { close }, close, DialogDescriptor.DEFAULT_ALIGN, helpCtx, null);
Dialog d = DialogDisplayer.getDefault().createDialog(dd);
d.pack();
d.setVisible(true);
}
示例6: testDefaultOptionWithStandardOk
import org.openide.util.HelpCtx; //導入依賴的package包/類
public void testDefaultOptionWithStandardOk () {
JButton testButton = new JButton ("for-test-only");
DialogDescriptor dd = new DialogDescriptor (
"Hello", // innerPane
"title", // title
false, // isModal
new Object[] { NotifyDescriptor.CANCEL_OPTION, NotifyDescriptor.OK_OPTION }, // options
NotifyDescriptor.OK_OPTION, // initialValue
DialogDescriptor.DEFAULT_ALIGN, // optionsAlign
HelpCtx.DEFAULT_HELP, // help
null); // action listener
dd.setAdditionalOptions (new JButton[] {testButton});
Dialog dlg = DialogDisplayer.getDefault ().createDialog (dd);
//dlg.setVisible (true);
assertEquals ("OK_OPTION is the default value.", NotifyDescriptor.OK_OPTION, dd.getDefaultValue ());
assertEquals ("OK_OPTION is the default button on dialog",
NbBundle.getBundle (NbPresenter.class).getString ("OK_OPTION_CAPTION"),
testButton.getRootPane ().getDefaultButton ().getText ());
//dlg.dispose ();
}
示例7: 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);
}
}
示例8: ParamsPanel
import org.openide.util.HelpCtx; //導入依賴的package包/類
/** Creates new form ParamsPanel */
public ParamsPanel() {
bundle = org.openide.util.NbBundle.getBundle(ParamsPanel.class);
initComponents ();
initAccessibility();
paramsList.setModel(getListModel());
paramsList.getSelectionModel().addListSelectionListener(
new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
if (paramsList.getSelectedIndex() != -1)
updateEditor(paramsList.getSelectedIndex());
removeParamButton.setEnabled(paramsList.getSelectedIndex() != -1);
}
}
);
removeParamButton.setEnabled(paramsList.getSelectedIndex() != -1);
HelpCtx.setHelpIDString(this, I18nUtil.HELP_ID_ADDPARAMS);
}
示例9: showWindow
import org.openide.util.HelpCtx; //導入依賴的package包/類
public boolean showWindow() {
DialogDescriptor dd = new DialogDescriptor(this, NbBundle.getMessage(FilterEditor.class, "LBL_FilterEditor"), true, //NOI18N
new Object[]{btnOk, btnCancel}, btnOk, DialogDescriptor.DEFAULT_ALIGN, HelpCtx.DEFAULT_HELP, null);
Dialog dlg = DialogDisplayer.getDefault().createDialog(dd);
dlg.setVisible(true);
if (btnOk.equals(dd.getValue())) {
updateFilters();
return true;
}
return false;
}
示例10: initialize
import org.openide.util.HelpCtx; //導入依賴的package包/類
/**
* Initializes a specified presenter.
*
* @param presenter presenter to initialize
*/
private void initialize(AbstractButton presenter, boolean useIcons) {
if (useIcons) {
// set the presenter's icon:
Image icon = ImageUtilities.loadImage(
"org/netbeans/modules/url/urlObject.png"); //NOI18N
try {
FileObject file = dataObject.getPrimaryFile();
icon = FileUIUtils.getImageDecorator(file.getFileSystem()).
annotateIcon(icon,
BeanInfo.ICON_COLOR_16x16,
dataObject.files());
} catch (FileStateInvalidException fsie) {
// OK, so we use the default icon
}
presenter.setIcon(new ImageIcon(icon));
}
/* set the presenter's text and ensure it is maintained up-to-date: */
NameChangeListener listener = new NameChangeListener(presenter);
presenter.addPropertyChangeListener(
WeakListeners.propertyChange(listener, dataObject));
updateName(presenter);
/*
* The above code works with the assumption that it is called
* from the AWT event dispatching thread (it manipulates
* the presenter's display name). The same applies to
* NameChangeListener's method propertyChange(...).
*
* At least, both mentioned parts of code should be called from
* the same thread since method updateText(...) is not thread-safe.
*/
presenter.addActionListener(this);
HelpCtx.setHelpIDString(presenter,
dataObject.getHelpCtx().getHelpID());
}
示例11: showPanel
import org.openide.util.HelpCtx; //導入依賴的package包/類
private boolean showPanel (String helpCtxId) {
DialogDescriptor descriptor = new DialogDescriptor (
getPanel(),
NbBundle.getMessage(TemplateSelector.class, "CTL_TemplateTitle"), // NOI18N
true,
new Object[] {DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION},
DialogDescriptor.OK_OPTION,
DialogDescriptor.DEFAULT_ALIGN,
new HelpCtx(helpCtxId),
null);
return DialogDisplayer.getDefault().notify(descriptor) == DialogDescriptor.OK_OPTION;
}
示例12: getHelp
import org.openide.util.HelpCtx; //導入依賴的package包/類
@Override
public HelpCtx getHelp() {
// Show no Help button for this panel:
return HelpCtx.DEFAULT_HELP;
// If you have context help:
// return new HelpCtx("help.key.here");
}
示例13: getHelpId
import org.openide.util.HelpCtx; //導入依賴的package包/類
private HelpCtx getHelpId (Node node) {
// it's template, return specific help id
DataObject dataObj = (DataObject)node.getCookie (DataObject.class);
if (dataObj != null) {
Object o = dataObj.getPrimaryFile ().getAttribute ("helpID"); // NOI18N
if (o != null) {
return new HelpCtx (o.toString ());
}
}
return null;
}
示例14: actionPerformed
import org.openide.util.HelpCtx; //導入依賴的package包/類
public void actionPerformed(ActionEvent e) {
HelpCtx ctx = getContext();
if (ctx == null || !ctx.display()) {
Toolkit.getDefaultToolkit().beep();
}
}
示例15: getHelpCtx
import org.openide.util.HelpCtx; //導入依賴的package包/類
public HelpCtx getHelpCtx() {
if (helpProvider) {
return new HelpCtx(getClass());
}
final Node parentNode = getParentNode();
if (parentNode instanceof SectionNode) {
return ((SectionNode) parentNode).getHelpCtx();
} else {
return new HelpCtx(sectionNodeView.getClass());
}
}