當前位置: 首頁>>代碼示例>>Java>>正文


Java HelpCtx類代碼示例

本文整理匯總了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());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:IssuePanel.java

示例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));
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:QCommitPanel.java

示例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;
    */
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:CustomizerPane.java

示例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 );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:HelpTest.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:AttachDialog.java

示例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 ();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:DialogDisplayer128399Test.java

示例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);
    }        
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:SourceWizardPanel.java

示例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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:ParamsPanel.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:FilterEditor.java

示例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());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:43,代碼來源:URLPresenter.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:TemplateSelector.java

示例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");
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:BuildOptionsPanel.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:OptionsAction.java

示例14: actionPerformed

import org.openide.util.HelpCtx; //導入依賴的package包/類
public void actionPerformed(ActionEvent e) {
    HelpCtx ctx = getContext();

    if (ctx == null || !ctx.display()) {
        Toolkit.getDefaultToolkit().beep();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:PropertySheet.java

示例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());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:SectionNode.java


注:本文中的org.openide.util.HelpCtx類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。