Java 类org.openide.util.HelpCtx 实例源码

项目:incubator-netbeans    文件:IssuePanel.java   
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());
    }
}
项目:incubator-netbeans    文件:QCommitPanel.java   
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));
        }
    });
}
项目:incubator-netbeans    文件:CustomizerPane.java   
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;
    */
}
项目:incubator-netbeans    文件:HelpTest.java   
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 );
}
项目:incubator-netbeans    文件:AttachDialog.java   
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);
}
项目:incubator-netbeans    文件:DialogDisplayer128399Test.java   
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 ();
}
项目:incubator-netbeans    文件:SourceWizardPanel.java   
/** 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);
    }        
}
项目:incubator-netbeans    文件:ParamsPanel.java   
/** 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);
}
项目:incubator-netbeans    文件:FilterEditor.java   
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;
}
项目:incubator-netbeans    文件:URLPresenter.java   
/**
 * 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());
}
项目:incubator-netbeans    文件:TemplateSelector.java   
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;
}
项目:incubator-netbeans    文件:BuildOptionsPanel.java   
@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");
}
项目:incubator-netbeans    文件:OptionsAction.java   
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;
}
项目:incubator-netbeans    文件:PropertySheet.java   
public void actionPerformed(ActionEvent e) {
    HelpCtx ctx = getContext();

    if (ctx == null || !ctx.display()) {
        Toolkit.getDefaultToolkit().beep();
    }
}
项目:incubator-netbeans    文件:SectionNode.java   
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());
    }
}
项目:incubator-netbeans    文件:FindActionTest.java   
/** 
 * Test getHelpCtx method. 
 */ 
public void testGetHelpCtx() { 
    HelpCtx expected = new HelpCtx(FindAction.class);; 
    HelpCtx result   = instance.getHelpCtx(); 

    assertEquals(expected, result); 
}
项目:incubator-netbeans    文件:HelpTest.java   
public void testPalettePanelCustom() throws Exception {
        FileObject item1 = getItemFile( categoryNames[0], itemNames[0][0] );
        FileObject cat2 = getCategoryFile( categoryNames[1] );

        item1.setAttribute( PaletteController.ATTR_HELP_ID, "DummyItemHelpId" );
        cat2.setAttribute( PaletteController.ATTR_HELP_ID, "DummyCategoryHelpId" );
        paletteRootFolder.setAttribute( PaletteController.ATTR_HELP_ID, "DummyRootHelpId" );

        PaletteController pc = PaletteFactory.createPalette( getRootFolderName(), new DummyActions() );
        Model model = pc.getModel();
        PalettePanel panel = PalettePanel.getDefault();
        panel.setContent( pc, model, pc.getSettings() );
        panel.refresh();

        HelpCtx help = panel.getHelpCtx();
        assertNotNull( help );
        assertEquals( "No category, no item selected", "DummyRootHelpId", help.getHelpID() );

        //UI is not fully initialized at this point
//        pc.setSelectedItem( model.getCategories()[1].getLookup(), model.getCategories()[1].getItems()[0].getLookup() );
//        help = panel.getHelpCtx();
//        assertNotNull( help );
//        assertEquals( "Category selected, selected item has no custom help", "DummyCategoryHelpId", help.getHelpID() );

        pc.setSelectedItem( model.getCategories()[0].getLookup(), model.getCategories()[0].getItems()[0].getLookup() );
        help = panel.getHelpCtx();
        assertNotNull( help );
        assertEquals( "Category selected, selected item has custom help", "DummyItemHelpId", help.getHelpID() );
    }
项目:incubator-netbeans    文件:PluginManagerUI.java   
private HelpCtx getHelpCtx() {
    String id = PluginManagerUI.class.getName ();
    Component c = tpTabs.getSelectedComponent ();
    if (c instanceof UnitTab) {
        id = ((UnitTab) c).getHelpId ();
    } else if (c instanceof SettingsTab) {
        id = SettingsTab.class.getName ();
    }
    return new HelpCtx (id);
}
项目:incubator-netbeans    文件:WinSysOptionsPanelController.java   
@Override
public HelpCtx getHelpCtx() {
    return new HelpCtx( "org.netbeans.core.windows.options.WinSysOptionsPanelController" ); //NOI18N
}
项目:incubator-netbeans    文件:ProjectTemplatePanel.java   
@Override
public HelpCtx getHelp() {
    return new HelpCtx( ProjectTemplatePanel.class );
}
项目:incubator-netbeans    文件:PickIconAction.java   
public @Override HelpCtx getHelpCtx() {
    return null;
}
项目:incubator-netbeans    文件:BasicWizardPanel.java   
public HelpCtx getHelp() {
    return null;
}
项目:incubator-netbeans    文件:AttachDialog.java   
@Override
public HelpCtx getHelpCtx() {
    return HELP_CTX;
}
项目:incubator-netbeans    文件:PanelConfigureProject.java   
public HelpCtx getHelp() {
    return new HelpCtx(PanelConfigureProject.class.getName() + '_' + type);
}
项目:incubator-netbeans    文件:RegisterServerAction.java   
@Override
public HelpCtx getHelpCtx() {
    return new HelpCtx(RegisterServerAction.class);
}
项目:incubator-netbeans    文件:DefaultSizeAction.java   
@Override
public HelpCtx getHelpCtx() {
    return HelpCtx.DEFAULT_HELP;
}
项目:incubator-netbeans    文件:DashboardTopComponent.java   
@Override
public HelpCtx getHelpCtx() {
    return new HelpCtx("org.netbeans.modules.bugtracking.tasks.DashboardTopComponent"); //NOI18N
}
项目:NBANDROID-V2    文件:SetLocationAction.java   
@Override
public HelpCtx getHelpCtx() {
    return null;
}
项目:incubator-netbeans    文件:CategorySupport.java   
public HelpCtx getHelpCtx() {
    return null;
}
项目:incubator-netbeans    文件:EntityDataObject.java   
/**
 */
@Override
public HelpCtx getHelpCtx() {
    //return new HelpCtx (EntityDataObject.class);
    return HelpCtx.DEFAULT_HELP;
}
项目:incubator-netbeans    文件:SvnVersioningTopComponent.java   
public HelpCtx getHelpCtx() {
    return new HelpCtx(getClass());
}
项目:incubator-netbeans    文件:JavaSrc.java   
public HelpCtx getHelpCtx () {
    return new HelpCtx (Object.class);
}
项目:incubator-netbeans    文件:AddColumnAction.java   
@Override
public HelpCtx getHelpCtx() {
    return new HelpCtx(AddColumnAction.class);
}
项目:incubator-netbeans    文件:JavaHintLocationPanel.java   
@Override
protected HelpCtx getHelp() {
    return null;
}
项目:incubator-netbeans    文件:CustomizeProfilingPointAction.java   
@Override
public HelpCtx getHelpCtx() {
    return new HelpCtx(CustomizeProfilingPointAction.class);
}
项目:incubator-netbeans    文件:ResetResultsAction.java   
@Override
public HelpCtx getHelpCtx() {
    return null;
}
项目:incubator-netbeans    文件:OptionsPanel0.java   
protected HelpCtx getHelp() {
    return new HelpCtx(OptionsPanel0.class);
}
项目:incubator-netbeans    文件:SourceFoldersPanel.java   
public HelpCtx getHelpCtx() {
    return new HelpCtx( SourceFoldersPanel.class );
}
项目:openjdk-jdk10    文件:CloneGraphAction.java   
@Override
public HelpCtx getHelpCtx() {
    return HelpCtx.DEFAULT_HELP;
}
项目:incubator-netbeans    文件:UndoRedoAction.java   
@Override
public HelpCtx getHelpCtx() {
    return new HelpCtx(UndoRedoAction.class);
}