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


Java Mnemonics.setLocalizedText方法代码示例

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


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

示例1: 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

示例2: initBasicComponents

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private void initBasicComponents() {
    accessCombo = new JComboBox();
    accessCombo.addActionListener(listener);
    accessCombo.getAccessibleContext().setAccessibleName("ACS_AccessRights"); // NOI18N
    accessCombo.getAccessibleContext().setAccessibleDescription("ACSD_AccessRights"); // NOI18N
    
    modifPanel = new JPanel();
    modifPanel.setLayout(new java.awt.GridLayout(4, 2, 4, 4));
    modifPanel.getAccessibleContext().setAccessibleName("ACSN_OtherModifiers"); // NOI18N
    modifPanel.getAccessibleContext().setAccessibleDescription("ACSD_OtherModifiers"); // NOI18N

    checks = new JCheckBox[MODIFIER_COUNT];
    for (int i = 0; i < MODIFIER_COUNT; i++) {
        checks[i] = new JCheckBox();
        Mnemonics.setLocalizedText(checks[i], getString(MODIFIER_LABEL_KEYS[i]));
        checks[i].getAccessibleContext().setAccessibleDescription(getModifierDescription(i));
        modifPanel.add(checks[i]);
        checks[i].setEnabled((myEditor.getMask() & MODIFIER_VALUES[i]) != 0);
        checks[i].addActionListener(listener);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ModifierPanel.java

示例3: showMore

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private void showMore() {
    if (extraInfo == null) {
        extraInfo = makeMessagesComponent(messages);
        extraInfo.setAlignmentX(LEFT_ALIGNMENT);
    }
    if (lblBotMsg != null) {
        remove(1);//remove vertical strut between the top msg and bottom msg
    }
    add(makeVerticalStrut(lblTopMsg, extraInfo), 1);
    add(extraInfo, 2);
    if (lblBotMsg != null) {
        add(makeVerticalStrut(extraInfo, lblBotMsg), 3);
    }
    Mnemonics.setLocalizedText(
            toggleButton,
            getMessage("LBL_ShowLessInformation"));                 //NOI18N
    showingMore = true;

    SwingUtilities.getWindowAncestor(this).pack();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ExpandableMessage.java

示例4: AdvancedActionPanel

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
public AdvancedActionPanel(AntProjectCookie project, Set/*<TargetLister.Target>*/ allTargets) {
    this.project = project;
    this.allTargets = allTargets;
    initComponents();
    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,代码行数:21,代码来源:AdvancedActionPanel.java

示例5: loc

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private static void loc(JTabbedPane p, int tabIdx, String key, JEditorPane ep) {
    JLabel label = new JLabel(); // Only for setting tab names

    String tabName = loc("CTL_" + key); //NOI18N
    Mnemonics.setLocalizedText(label, tabName);
    p.setTitleAt(tabIdx, label.getText());

    int idx = Mnemonics.findMnemonicAmpersand(tabName);
    if (idx != -1 && idx + 1 < tabName.length()) {
        char ch = Character.toUpperCase(tabName.charAt(idx + 1));
        p.setMnemonicAt(tabIdx, ch);
        if (ep != null) {
            ep.setFocusAccelerator(ch);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:CodeTemplatesPanel.java

示例6: DocumentsDlg

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
/** Creates new form DocumentsDlg */
   private DocumentsDlg () {
       initComponents();
       
       // Internationalize.
Mnemonics.setLocalizedText(jButtonActivate, NbBundle.getMessage(DocumentsDlg.class, "LBL_Activate"));
       Mnemonics.setLocalizedText(jButtonClose, NbBundle.getMessage(DocumentsDlg.class, "LBL_CloseDocuments"));
       Mnemonics.setLocalizedText(jButtonSave, NbBundle.getMessage(DocumentsDlg.class, "LBL_SaveDocuments"));
       Mnemonics.setLocalizedText(explorerLabel, NbBundle.getMessage(DocumentsDlg.class, "LBL_Documents"));
       Mnemonics.setLocalizedText(descriptionLabel, NbBundle.getMessage(DocumentsDlg.class, "LBL_Description"));
       
       Mnemonics.setLocalizedText(closeButton, NbBundle.getMessage(DocumentsDlg.class, "LBL_Close"));
           
       // Set labels for.
       explorerLabel.setLabelFor(listView);
       descriptionLabel.setLabelFor(descriptionArea);
       
       // Accessible context.
       jButtonActivate.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_Activate"));
       jButtonClose.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_CloseDocuments"));
       jButtonSave.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_SaveDocuments"));
       closeButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_Close"));
       descriptionArea.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_DescriptionArea"));

       ItemListener orderingListener = new ItemListener() {

           @Override
           public void itemStateChanged( ItemEvent e ) {
               updateNodes();
           }
       };
       radioOrderByName.addItemListener( orderingListener );
       radioOrderByUsage.addItemListener( orderingListener );
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:DocumentsDlg.java

示例7: fieldsChoiceActionPerformed

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private void fieldsChoiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fieldsChoiceActionPerformed
    if (fieldsChoice.isSelected()) {
        tableCombo.setEnabled(false);
        Mnemonics.setLocalizedText(availableLabel, NbBundle.getMessage(DetailPanel.class, "LBL_DetailAvailableFields")); // NOI18N
        Mnemonics.setLocalizedText(includeLabel, NbBundle.getMessage(DetailPanel.class, "LBL_DetailFieldsToInclude")); // NOI18N
        fillLists(masterTable);
        previewLabel.setIcon(fieldsIcon);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DetailPanel.java

示例8: changeSearchBarToBePartOfReplaceBar

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private void changeSearchBarToBePartOfReplaceBar() {
    searchBar.getCloseButton().addActionListener(getCloseButtonListener());
    Mnemonics.setLocalizedText(searchBar.getFindLabel(), NbBundle.getMessage(ReplaceBar.class, "CTL_Replace_Find")); // NOI18N
    Dimension newDimensionForFindLabel = new Dimension(replaceLabel.getPreferredSize().width, searchBar.getFindLabel().getPreferredSize().height);
    searchBar.getFindLabel().setMinimumSize(newDimensionForFindLabel);
    searchBar.getFindLabel().setPreferredSize(newDimensionForFindLabel);
    this.addEscapeKeystrokeFocusBackTo(searchBar);
    searchBar.setFocusTraversalPolicy(searchBarFocusTraversalPolicy);
    setFocusTraversalPolicy(searchBarFocusTraversalPolicy);
    searchBar.getPreferredSize();
    searchBar.setSearchProperties(SearchPropertiesSupport.getReplaceProperties());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ReplaceBar.java

示例9: addNoVCSMenu

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private void addNoVCSMenu (Action[] actions) throws MissingResourceException {
    if (actions != null && actions.length > 0) {
        addSeparator();
        add(createmenuItem(SystemAction.get(PatchAction.class)));
    } else {
        JMenuItem item = new JMenuItem();
        Mnemonics.setLocalizedText(item, NbBundle.getMessage(VersioningMainMenu.class, "LBL_NoneAvailable"));  // NOI18N
        item.setEnabled(false);
        add(item);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ProjectMenuItem.java

示例10: SectionContainer

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
public SectionContainer(SectionView sectionView, Node root, String title, boolean foldable) {
    this.sectionView=sectionView;
    this.root=root;
    this.foldable=foldable;
    initComponents();
    // issue 233048: the background color issues with dark metal L&F
    //setBackground(SectionVisualTheme.getDocumentBackgroundColor());
    //titlePanel.setBackground(foldable?SectionVisualTheme.getSectionHeaderColor():SectionVisualTheme.getContainerHeaderColor());
    //actionPanel.setBackground(SectionVisualTheme.getDocumentBackgroundColor());
    headerSeparator.setForeground(SectionVisualTheme.getSectionHeaderLineColor());
    fillerLine.setForeground(SectionVisualTheme.getFoldLineColor());
    fillerEnd.setForeground(SectionVisualTheme.getFoldLineColor());
    Mnemonics.setLocalizedText(titleButton, title);
    titleButton.setToolTipText(titleButton.getText());
    this.title=titleButton.getText();
    titleButton.addMouseListener(new org.openide.awt.MouseUtils.PopupMouseAdapter() {
        protected void showPopup(java.awt.event.MouseEvent e) {
            JPopupMenu popup = getNode().getContextMenu();
            popup.show(titleButton,e.getX(), e.getY());
        }
    });
    
    if (foldable) {
        foldButton.setSelected(true);
    } else {
        remove(fillerLine);
        remove(fillerEnd);
        remove(foldButton);
    }
    setIcon(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:SectionContainer.java

示例11: resolve

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
@Override
@NonNull
@NbBundle.Messages({
    "TXT_FixBrokenPlatform=Resolve Broken Platform",
    "LBL_OK=&OK"
})
public Future<ProjectProblemsProvider.Result> resolve() {
    final JButton ok = new JButton();
    Mnemonics.setLocalizedText(ok, LBL_OK());
    final FixPlatform fixPlatform = new FixPlatform(
            propertyName,
            id,
            platformType,
            eval,
            helper,
            callback,
            ok);
    final DialogDescriptor dd = new DialogDescriptor(
            fixPlatform,
            TXT_FixBrokenPlatform(),
            true,
            new Object[] {
                ok,
                DialogDescriptor.CANCEL_OPTION
            },
            ok,
            DialogDescriptor.DEFAULT_ALIGN,
            null,
            null);
    if (DialogDisplayer.getDefault().notify(dd) == ok) {
        return fixPlatform.resolve();
    } else {
        return new Done(ProjectProblemsProvider.Result.create(ProjectProblemsProvider.Status.UNRESOLVED));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:36,代码来源:ProjectProblemsProviders.java

示例12: initComponent

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private void initComponent() {
    setLayout(new GridBagLayout());
    
    GridBagConstraints cons = new GridBagConstraints();
    cons.gridx = 0;
    cons.gridy = 0;
    cons.weightx = 1.0D;
    cons.fill = GridBagConstraints.HORIZONTAL;
    cons.insets = new Insets(11, 11, 0, 12);
    
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, NbBundle.getMessage(Install.class, "LAB_PendingTasks"));
    
    add(label, cons);
    
    cons.gridy = 1;
    cons.weighty = 1.0D;
    cons.fill = GridBagConstraints.BOTH;
    cons.insets = new Insets(2, 11, 0, 12);
    
    ListView view = new ListView();
    //#66881
    view.setBorder(UIManager.getBorder("Nb.ScrollPane.border"));
    label.setLabelFor(view);
    
    add(view, cons);
    
    view.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(Install.class, "ACSD_PendingTasks"));
    getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(Install.class, "ACSD_PendingTitle"));
    
    // set size requested by HIE guys
    Dimension origSize = getPreferredSize();
    setPreferredSize(new Dimension(origSize.width * 5 / 4, origSize.height));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:Install.java

示例13: getSplitMenuItem

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
private JMenuItem getSplitMenuItem() {
if(!isSplitingEnabled()) {
    return null;
}
JMenu menu = new SplitAction.UpdatingMenu();
String label = useSplitName ? Bundle.CTL_SplitAction() : Bundle.CTL_SplitDocumentAction();
Mnemonics.setLocalizedText(menu, label);
return menu;
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:SplitAction.java

示例14: FileSelector

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
/**
     * @param title is a title of the dialog
     * @param rootLabel label for the root node
     * @param root the base object to start browsing from
     * @param acceptor decides whether we have valid selection or not
     * @param top is a <code>Component</code> we just place on the top of the dialog
     * it can be <code>null</code>
     */
    public FileSelector ( String rootLabel, Node root, final NodeAcceptor acceptor, Component top) {
        super ();

        this.acceptor = acceptor;
        
        ResourceBundle bundle = NbBundle.getBundle(FileSelector.class);


        okButton = new JButton(bundle.getString("CTL_FileSelectorOkButton"));
        cancelButton = new JButton(bundle.getString("CTL_FileSelectorCancelButton"));
        okButton.getAccessibleContext().setAccessibleDescription(bundle.getString ("ACSD_FileSelectorOkButton"));
        cancelButton.getAccessibleContext().setAccessibleDescription(bundle.getString ("ACSD_FileSelectorCancelButton"));
        buttons = new JButton[] { okButton, cancelButton };
        

        manager.setRootContext (root);//s[0]);
        
        // Center
        tree = new BeanTreeView () {
            {
                tree.setCellEditor(null);
                tree.setEditable(false);
            }
        };
        tree.setPopupAllowed (false);
        tree.setDefaultActionAllowed (false);
        // install proper border for tree
        tree.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
        tree.getAccessibleContext().setAccessibleName(NbBundle.getBundle(FileSelector.class).getString("ACSN_FileSelectorTreeView"));
        tree.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(FileSelector.class).getString("ACSD_FileSelectorTreeView"));
        this.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(FileSelector.class).getString("ACSD_FileSelectorDialog"));
        setLayout(new BorderLayout());
        add(tree, BorderLayout.CENTER);

        // component to place at the top
        try {
                manager.setSelectedNodes (new Node[] { root });
                JLabel label = new JLabel();
                Mnemonics.setLocalizedText(label, rootLabel);
                label.setLabelFor(tree.getViewport().getView());
                add(label, BorderLayout.NORTH);
        } catch(PropertyVetoException pve) {
            throw new IllegalStateException(pve.getMessage());
        }



        // South
        if (top != null) {
            add(top, BorderLayout.SOUTH);
        }

        manager.addPropertyChangeListener (this);

//        if (top != null) top.requestFocus ();

        if (acceptor.acceptNodes (manager.getSelectedNodes())) {
            enableButton ();
        } else {
            disableButton ();
        }

    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:72,代码来源:FileSelector.java

示例15: VersioningSystemMenuItem

import org.openide.awt.Mnemonics; //导入方法依赖的package包/类
public VersioningSystemMenuItem() {
    Mnemonics.setLocalizedText(this, Utils.getSystemMenuName(system));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:VersioningAnnotationProvider.java


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