当前位置: 首页>>代码示例>>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;未经允许,请勿转载。