当前位置: 首页>>代码示例>>Java>>正文


Java Mnemonics类代码示例

本文整理汇总了Java中org.openide.awt.Mnemonics的典型用法代码示例。如果您正苦于以下问题:Java Mnemonics类的具体用法?Java Mnemonics怎么用?Java Mnemonics使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Mnemonics类属于org.openide.awt包,在下文中一共展示了Mnemonics类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CategoryButton

import org.openide.awt.Mnemonics; //导入依赖的package包/类
CategoryButton (final CategoryModel.Category category) {
       super (category.getIcon());
       this.category = category;
       Mnemonics.setLocalizedText (this, category.getCategoryName());
getAccessibleContext().setAccessibleName(category.getCategoryName());
getAccessibleContext().setAccessibleDescription(Bundle.CategoryButton_AccessibleDescription(category.getCategoryName()));
       setDisplayedMnemonic(0);            
       setOpaque (true);
       setVerticalTextPosition (BOTTOM);
       setHorizontalTextPosition (CENTER);
       setHorizontalAlignment (CENTER);
       addMouseListener (this);
       setFocusable (false);
       setFocusTraversalKeysEnabled (false);
       setForeground (getTabPanelForeground());
       
       if (isMac) {
           setFont(labelFontMac);
           setIconTextGap(2);
       }
       
       setNormal ();
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:OptionsPanel.java

示例2: getExtraButton

import org.openide.awt.Mnemonics; //导入依赖的package包/类
@NbBundle.Messages({
    "LBL_LineEnding=Line endin&g: ",
    "LBL_LineEnding.tooltip=Line ending sequence that is used in the text pane",
    "LBL_LineEnding.accName=Line ending sequence"
})
@Override
protected JComponent getExtraButton() {
    JPanel panel = new JPanel();
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, Bundle.LBL_LineEnding());
    final JComboBox<LineEnding> cbox = new JComboBox<LineEnding>(new LineEnding[]{});
    cbox.getAccessibleContext().setAccessibleName(Bundle.LBL_LineEnding_accName());
    cbox.setToolTipText(Bundle.LBL_LineEnding_tooltip());
    label.setLabelFor(cbox);
    panel.setLayout(new FlowLayout(FlowLayout.LEADING, 0, 0));
    panel.add(label);
    panel.add(cbox);
    loadLineEnding(cbox);
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:PatternSandbox.java

示例3: getPopupMenuItem

import org.openide.awt.Mnemonics; //导入依赖的package包/类
public @Override JMenuItem getPopupMenuItem(JTextComponent target) {
    String menuText = org.openide.util.NbBundle.getBundle (NbEditorKit.class).
        getString("Menu/View/CodeFolds");
    JMenu menu = new JMenu(menuText);
    Mnemonics.setLocalizedText(menu, menuText);
    setAddSeparatorBeforeNextAction(false);
    addAction(target, menu, BaseKit.collapseFoldAction);
    addAction(target, menu, BaseKit.expandFoldAction);
    setAddSeparatorBeforeNextAction(true);
    addAction(target, menu, BaseKit.collapseAllFoldsAction);
    addAction(target, menu, BaseKit.expandAllFoldsAction);
    // this is a hack, which assumes a certain action name from editor.fold.ui
    // if the action does not exist, nothing will be added to the menu.
    addAction(target, menu, "collapse-fold-tree"); // NOI18N
    addAction(target, menu, "expand-fold-tree"); // NOI18N
    // By default add separator before next actions (can be overriden if unwanted)
    setAddSeparatorBeforeNextAction(true);
    if (target != null) addAdditionalItems(target, menu);
    return menu;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:NbEditorKit.java

示例4: selectPatchName

import org.openide.awt.Mnemonics; //导入依赖的package包/类
public boolean selectPatchName () {
    Mnemonics.setLocalizedText(unshelveButton, NbBundle.getMessage(UnshelveChangesAction.class, "CTL_UnshelveChangesPanel.unshelveButton.text")); //NOI18N
    Mnemonics.setLocalizedText(removeButton, NbBundle.getMessage(UnshelveChangesAction.class, "CTL_UnshelveChangesPanel.removeButton.text")); //NOI18N
    DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(UnshelveChangesAction.class, "LBL_UnshelveChangesPanel.title"), //NOI18N
            true, new Object[] { unshelveButton, removeButton, DialogDescriptor.CANCEL_OPTION }, unshelveButton, DialogDescriptor.DEFAULT_ALIGN,
            new HelpCtx("org.netbeans.modules.versioning.shelve.impl.UnshelveChangesAction"), null); //NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setVisible(true);
    patchName = panel.cmbPatches.getSelectedItem() instanceof Patch ? ((Patch) panel.cmbPatches.getSelectedItem()).getPatchName().trim() : null;
    removePatchFile = !panel.cbKeepPatchFile.isSelected();
    if (patchName == null) {
        return false;
    } else if (dd.getValue() == unshelveButton) {
        return true;
    } else if (dd.getValue() == removeButton) {
        Utils.post(new Runnable() {
            @Override
            public void run () {
                PatchStorage.getInstance().removePatch(patchName, removePatchFile);
            }
        });
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:UnshelveChangesAction.java

示例5: AdvancedActionPanel

import org.openide.awt.Mnemonics; //导入依赖的package包/类
public AdvancedActionPanel(AntProjectCookie project, Set<TargetLister.Target> allTargets) {
    this.project = project;
    this.allTargets = allTargets;
    initComponents();
    
    getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(AdvancedActionPanel.class,"AdvancedActionsPanel.acsd.title"));
    
    Mnemonics.setLocalizedText(targetLabel, NbBundle.getMessage(AdvancedActionPanel.class, "AdvancedActionsPanel.targetLabel.text"));
    Mnemonics.setLocalizedText(targetDescriptionLabel, NbBundle.getMessage(AdvancedActionPanel.class, "AdvancedActionsPanel.targetDescriptionLabel.text"));
    Mnemonics.setLocalizedText(propertiesLabel, NbBundle.getMessage(AdvancedActionPanel.class, "AdvancedActionsPanel.propertiesLabel.text"));
    Mnemonics.setLocalizedText(verbosityLabel, NbBundle.getMessage(AdvancedActionPanel.class, "AdvancedActionsPanel.verbosityLabel.text"));
    // Hack; EditorKit does not permit "fallback" kits, so we have to
    // mimic what the IDE itself does:
    EditorKit kit = propertiesPane.getEditorKit();
    String clazz = kit.getClass().getName();
    if (clazz.equals("javax.swing.text.DefaultEditorKit") || // NOI18N
            clazz.equals("javax.swing.JEditorPane$PlainEditorKit")) { // NOI18N
        propertiesPane.setEditorKit(JEditorPane.createEditorKitForContentType("text/plain")); // NOI18N
    }
    // Make ENTER run OK, not change the combo box.
    targetComboBox.getInputMap().remove(KeyStroke.getKeyStroke("ENTER")); // NOI18N
    initializeFields();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:AdvancedActionPanel.java

示例6: DiffToRevision

import org.openide.awt.Mnemonics; //导入依赖的package包/类
@NbBundle.Messages({
    "CTL_DiffToRevision_okButton.text=&Diff",
    "CTL_DiffToRevision_okButton.ACSD=Diff selected revisions",
    "CTL_DiffToRevision_cancelButton.text=&Cancel",
    "CTL_DiffToRevision_cancelButton.ACSD=Cancel",
    "CTL_DiffToRevision_ACSD=Select revisions to diff"
})
public DiffToRevision (File repository, HgRevision base) {
    this.repository = repository;
    this.baseRevision = base;
    panel = new DiffToRevisionPanel();
    okButton = new JButton();
    Mnemonics.setLocalizedText(okButton, Bundle.CTL_DiffToRevision_okButton_text());
    okButton.getAccessibleContext().setAccessibleDescription(Bundle.CTL_DiffToRevision_okButton_ACSD());
    cancelButton = new JButton();
    Mnemonics.setLocalizedText(cancelButton, Bundle.CTL_DiffToRevision_cancelButton_text());
    cancelButton.getAccessibleContext().setAccessibleDescription(Bundle.CTL_DiffToRevision_cancelButton_ACSD());
    initializeSelections();
    attachListeners();
    panel.rbLocalToAny.doClick();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:DiffToRevision.java

示例7: getAccesoryPanel

import org.openide.awt.Mnemonics; //导入依赖的package包/类
@Messages("LBL_IconInfo=Selected icon [size]:")
private static JPanel getAccesoryPanel(final JTextField iconInfo) {
    iconInfo.setColumns(15);
    iconInfo.setEditable(false);
    
    JPanel accessoryPanel = new JPanel();
    JPanel inner = new JPanel();
    JLabel iconInfoLabel = new JLabel();
    accessoryPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0));
    
    inner.setLayout(new GridLayout(2, 1, 0, 6));
    
    iconInfoLabel.setLabelFor(iconInfo);
    Mnemonics.setLocalizedText(iconInfoLabel, LBL_IconInfo());
    inner.add(iconInfoLabel);
    
    inner.add(iconInfo);
    
    accessoryPanel.add(inner);
    return accessoryPanel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:UIUtil.java

示例8: transformValue

import org.openide.awt.Mnemonics; //导入依赖的package包/类
@Override
public Object transformValue(Object value) {
    if (value instanceof OutlineViewOutlineColumn) {
        OutlineViewOutlineColumn c = (OutlineViewOutlineColumn) value;
        String dn = c.getRawColumnName ();
        if (dn == null) {
            dn = c.getHeaderValue ().toString ();
        }
        String desc = c.getShortDescription (null);
        if (desc == null) {
            return dn;
        }
        return NbBundle.getMessage (OutlineView.class, "OutlineViewOutline_NameAndDesc", dn, desc); // NOI18N
    } else if (COLUMNS_SELECTOR_HINT.equals (value)) {
        return NbBundle.getMessage (OutlineView.class, COLUMNS_SELECTOR_HINT);
    } else if (value instanceof AbstractButton) {
        AbstractButton b = (AbstractButton) value;
        Mnemonics.setLocalizedText (b, b.getText ());
        return b;
    } else if (value instanceof VisualizerNode) {
        return Visualizer.findNode (value);
    }
    return PropertiesRowModel.getValueFromProperty(value);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:OutlineView.java

示例9: loc

import org.openide.awt.Mnemonics; //导入依赖的package包/类
private static void loc (Component c, String key) {
    if (!(c instanceof JLabel)) {
        c.getAccessibleContext ().setAccessibleName (loc ("AN_" + key));
        c.getAccessibleContext ().setAccessibleDescription (loc ("AD_" + key));
    }
    if (c instanceof AbstractButton) {
        Mnemonics.setLocalizedText (
            (AbstractButton) c, 
            loc ("CTL_" + key)
        );
    } else if (c instanceof JLabel) {
        Mnemonics.setLocalizedText (
            (JLabel) c, 
            loc ("CTL_" + key)
        );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:GeneralEditorPanel.java

示例10: getMenuPresenter

import org.openide.awt.Mnemonics; //导入依赖的package包/类
public @Override JMenuItem getMenuPresenter() {
    class SpecialMenuItem extends JMenuItem implements DynamicMenuContent {
        public SpecialMenuItem() {
            super(RunLastBuildAction.this);
        }
        public @Override JComponent[] getMenuPresenters() {
            String label;
            BuildExecutionSupport.Item item = BuildExecutionSupportImpl.getInstance().getLastItem();
            if (item != null) {
                String display = item.getDisplayName();
                label = NbBundle.getMessage(RunLastBuildAction.class, "LBL_RunLastBuildAction_specific", display);
            } else {
                label = (String) getValue(Action.NAME);
            }
            Mnemonics.setLocalizedText(this, label);
            return new JComponent[] {this};
        }
        public @Override JComponent[] synchMenuPresenters(JComponent[] items) {
            return getMenuPresenters();
        }
    }
    return new SpecialMenuItem();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:RunLastBuildAction.java

示例11: show

import org.openide.awt.Mnemonics; //导入依赖的package包/类
/**
 * Opens the manager window.
 *
 * @param paletteRoot Palette root node.
 */
public static void show( Node paletteRoot, PaletteController controller, Settings settings ) {
    JButton closeButton = new JButton();
    org.openide.awt.Mnemonics.setLocalizedText(
        closeButton, Utils.getBundleString("CTL_Close_Button")); // NOI18N
    closeButton.getAccessibleContext().setAccessibleDescription( Utils.getBundleString("ACSD_Close") );
    DialogDescriptor dd = new DialogDescriptor(
        new Customizer( paletteRoot, controller, settings ),
        Utils.getBundleString("CTL_Customizer_Title"), // NOI18N
        false,
        new Object[] { closeButton },
        closeButton,
        DialogDescriptor.DEFAULT_ALIGN,
        null,
        null);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:Customizer.java

示例12: getCellEditorValue

import org.openide.awt.Mnemonics; //导入依赖的package包/类
@Override
public Object getCellEditorValue() {
    String value = ((JTextField)getComponent()).getText();
    
    // Cell is a properties key.
    if(isKeyCell) {
        Mnemonics.setLocalizedText(valueLabel, NbBundle.getBundle(PropertyPanel.class).getString("LBL_KeyLabel"));
    }
    // Cell is a properties value.
    else {
        Mnemonics.setLocalizedText(valueLabel, NbBundle.getBundle(BundleEditPanel.class).getString("LBL_ValueLabel"));
    }
    
    // the cell is a properties key 
    return new PropertiesTableModel.StringPair(commentComponent.getText(),value,isKeyCell);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:PropertiesTableCellEditor.java

示例13: resolveLocalChanges

import org.openide.awt.Mnemonics; //导入依赖的package包/类
public final boolean resolveLocalChanges (File[] localChanges) throws GitException {
    JButton revert = new JButton();
    Mnemonics.setLocalizedText(revert, NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.revertButton.text")); //NOI18N
    revert.setToolTipText(NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.revertButton.TTtext")); //NOI18N
    JButton review = new JButton();
    Mnemonics.setLocalizedText(review, NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.reviewButton.text")); //NOI18N
    review.setToolTipText(NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.reviewButton.TTtext")); //NOI18N
    Object o = DialogDisplayer.getDefault().notify(new NotifyDescriptor(NbBundle.getMessage(ResultProcessor.class, "MSG_ResultProcessor.localModifications"), //NOI18N
            NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.localModifications"), //NOI18N
            NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] { revert, review, NotifyDescriptor.CANCEL_OPTION }, revert));
    if (o == revert) {
        LOG.log(Level.FINE, "Checking out paths from HEAD"); //NOI18N
        client.checkout(localChanges, GitUtils.HEAD, true, pm);
        LOG.log(Level.FINE, "Cleanup new files"); //NOI18N
        client.clean(localChanges, pm);
        LOG.log(Level.FINE, "Checking out branch: {0}, second shot", revision); //NOI18N
        return true;
    } else if (o == review) {
        openInVersioningView(Arrays.asList(localChanges));
        return false;
    } else {
        return false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ResultProcessor.java

示例14: GitShelveChangesSupport

import org.openide.awt.Mnemonics; //导入依赖的package包/类
@NbBundle.Messages({
    "ShelvePanel.doPurgeChxBox.text=Remove &Newly Added Files and Folders",
    "ShelvePanel.doPurgeChxBox.desc=Shelve Changes will remove newly added files and empty folders from disk",
    "ShelvePanel.doRevertIndexChanges.text=&Revert Uncommitted Changes in Index to HEAD",
    "ShelvePanel.doRevertIndexChanges.desc=Shelve Changes will revert also changes in the Index to the state in the current HEAD"
})
public GitShelveChangesSupport (File repository) {
    this.repository = repository;
    revertModificationInIndex = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(revertModificationInIndex, Bundle.ShelvePanel_doRevertIndexChanges_text());
    revertModificationInIndex.setToolTipText(Bundle.ShelvePanel_doRevertIndexChanges_desc());
    revertModificationInIndex.getAccessibleContext().setAccessibleDescription(revertModificationInIndex.getToolTipText());
    revertModificationInIndex.setSelected(true);
    doPurgeChxBox = new JCheckBox();
    org.openide.awt.Mnemonics.setLocalizedText(doPurgeChxBox, Bundle.ShelvePanel_doPurgeChxBox_text());
    doPurgeChxBox.setToolTipText(Bundle.ShelvePanel_doPurgeChxBox_desc());
    doPurgeChxBox.getAccessibleContext().setAccessibleDescription(doPurgeChxBox.getToolTipText());
    doPurgeChxBox.setSelected(GitModuleConfig.getDefault().getRemoveWTNew());
    optionsPanel = new JPanel();
    optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
    optionsPanel.add(revertModificationInIndex);
    optionsPanel.add(doPurgeChxBox);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ShelveChangesAction.java

示例15: HelpStringCustomEditor

import org.openide.awt.Mnemonics; //导入依赖的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);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:HelpStringCustomEditor.java


注:本文中的org.openide.awt.Mnemonics类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。