org.openide.awt.Mnemonics Java Examples
The following examples show how to use
org.openide.awt.Mnemonics.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FindDialogPanel.java From netbeans with Apache License 2.0 | 6 votes |
static String getResult(String selection, String dlgTitle, String comboLabel, String buttonText) { final FindDialogPanel findPanel = getPanel(); Mnemonics.setLocalizedText(findPanel.acceptButton, NbBundle.getMessage(FindDialogPanel.class, buttonText)); Mnemonics.setLocalizedText(findPanel.findWhatLabel, NbBundle.getMessage(FindDialogPanel.class, comboLabel)); if (selection != null) { findPanel.setFindText(selection); } findPanel.selectText(); DialogDescriptor dd = new DialogDescriptor(findPanel, NbBundle.getMessage(FindDialogPanel.class, dlgTitle), true, new Object[] {findPanel.acceptButton, DialogDescriptor.CANCEL_OPTION}, findPanel.acceptButton, DialogDescriptor.RIGHT_ALIGN, null, null); Object res = DialogDisplayer.getDefault().notify(dd); if (res.equals(findPanel.acceptButton)) { findPanel.updateHistory(); regExp = findPanel.chbRegExp.getModel().isSelected(); matchCase = findPanel.chbMatchCase.getModel().isSelected(); NbPreferences.forModule(FindDialogPanel.class).putBoolean(KEY_REGEXP, regExp); NbPreferences.forModule(FindDialogPanel.class).putBoolean(KEY_MATCHCASE, matchCase); result = findPanel.getPattern(); return result; } else { result = null; return null; } }
Example #2
Source File: ModifierPanel.java From netbeans with Apache License 2.0 | 6 votes |
private void initComponents() { jLabel1 = new JLabel(); jLabel1.setLabelFor(accessCombo); Mnemonics.setLocalizedText(jLabel1, getString("LAB_AccessRights")); // NOI18N jPanel2 = new JPanel(); jPanel2.setLayout(new java.awt.BorderLayout(8, 8)); jPanel2.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5))); jPanel2.add(jLabel1, java.awt.BorderLayout.WEST); jPanel2.add(accessCombo, java.awt.BorderLayout.CENTER); modifPanel.setBorder (new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(getString("LAB_Modifiers")), // NOI18N new javax.swing.border.EmptyBorder(new java.awt.Insets(3, 3, 3, 3)) )); commpactP = new JPanel(); commpactP.setLayout(new java.awt.BorderLayout()); commpactP.setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(6, 7, 6, 7))); commpactP.add(modifPanel, java.awt.BorderLayout.CENTER); commpactP.add(jPanel2, java.awt.BorderLayout.NORTH); commpactP.getAccessibleContext().setAccessibleName("ACSN_ModifierPanel"); // NOI18N commpactP.getAccessibleContext().setAccessibleDescription(getString("ACSD_ModifierPanel")); // NOI18N }
Example #3
Source File: SectionButton.java From netbeans with Apache License 2.0 | 6 votes |
private void updateProperties() { setIcon( UIManager.getIcon(isGTK ? "Tree.gtk_collapsedIcon" : "Tree.collapsedIcon") ); setSelectedIcon( UIManager.getIcon(isGTK ? "Tree.gtk_expandedIcon" : "Tree.expandedIcon") ); Mnemonics.setLocalizedText( this, getText() ); getAccessibleContext().setAccessibleName( getText() ); getAccessibleContext().setAccessibleDescription( getText() ); if( isAqua ) { setContentAreaFilled(true); setOpaque(true); setBackground( new Color(0,0,0) ); setForeground( new Color(255,255,255) ); } if( isNimbus ) { setOpaque(true); setContentAreaFilled(true); } }
Example #4
Source File: ShelveChangesSupport.java From netbeans with Apache License 2.0 | 6 votes |
private boolean openDialog (JPanel additionalOptions, String helpCtx) { ShelveChangesPanel panel = new ShelveChangesPanel(additionalOptions); initializePatchName(panel.txtPatchName); panel.lblError.setVisible(false); JButton okButton = new JButton(); Mnemonics.setLocalizedText(okButton, NbBundle.getMessage(ShelveChangesSupport.class, "CTL_ShelveChangesPanel.okButton.text")); //NOI18N DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(ShelveChangesSupport.class, "LBL_ShelveChangesPanel.title"), //NOI18N true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(helpCtx), null); Dialog dialog = DialogDisplayer.getDefault().createDialog(dd); panel.txtPatchName.getDocument().addDocumentListener(new PatchNameListener(panel, okButton, dialog)); dialog.setVisible(true); if (dd.getValue() == okButton) { patchName = panel.txtPatchName.getText().trim(); return !patchName.isEmpty(); } else { return false; } }
Example #5
Source File: TemplatesPanelGUI.java From netbeans with Apache License 2.0 | 6 votes |
@Messages("LBL_TemplatesPanel_PleaseWait=Please wait...") private void postInitComponents () { Mnemonics.setLocalizedText(jLabel1, this.firer.getCategoriesName()); Mnemonics.setLocalizedText(jLabel2, this.firer.getTemplatesName()); this.description.setEditorKit(new HTMLEditorKit()); description.putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE ); // please wait node, see issue 52900 pleaseWait = new AbstractNode (Children.LEAF) { @Override public Image getIcon (int ignore) { return PLEASE_WAIT_ICON; } }; pleaseWait.setName(LBL_TemplatesPanel_PleaseWait()); Children ch = new Children.Array (); ch.add (new Node[] {pleaseWait}); final Node root = new AbstractNode (ch); SwingUtilities.invokeLater (new Runnable () { @Override public void run() { ((ExplorerProviderPanel)categoriesPanel).setRootNode (root); } }); ((ExplorerProviderPanel)projectsPanel).addDefaultActionListener( firer ); description.addHyperlinkListener(new ClickHyperlinks()); }
Example #6
Source File: OptionsPanel.java From netbeans with Apache License 2.0 | 6 votes |
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 (); }
Example #7
Source File: CustomizerGeneral.java From netbeans with Apache License 2.0 | 6 votes |
private void showButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showButtonActionPerformed if (!passwordVisible) { passwordVisible = true; originalFont = passwordField.getFont(); passwordField.setFont(usernameTextField.getFont()); originalEchoChar = passwordField.getEchoChar(); passwordField.setEchoChar((char) 0); Mnemonics.setLocalizedText(showButton, NbBundle.getMessage(CustomizerGeneral.class, "LBL_ShowButtonHide")); showButton.setToolTipText(NbBundle.getMessage(CustomizerGeneral.class, "LBL_ShowButtonHide_ToolTip")); } else { passwordVisible = false; passwordField.setFont(originalFont); passwordField.setEchoChar(originalEchoChar); Mnemonics.setLocalizedText(showButton, NbBundle.getMessage(CustomizerGeneral.class, "CustomizerGeneral.showButton.text")); showButton.setToolTipText(NbBundle.getMessage(CustomizerGeneral.class, "CustomizerGeneral.showButton.toolTipText")); } }
Example #8
Source File: CommitPanel.java From netbeans with Apache License 2.0 | 6 votes |
/** Creates new form CommitPanel */ public CommitPanel(GitCommitParameters parameters, String commitMessage, boolean preferredMessage, String user) { this.parameters = parameters; initComponents(); Mnemonics.setLocalizedText(messageLabel, getMessage("CTL_CommitForm_Message")); // NOI18N authorComboBox.setModel(prepareUserModel(GitModuleConfig.getDefault().getRecentCommitAuthors(), user)); setCaretPosition(authorComboBox); commiterComboBox.setModel(prepareUserModel(GitModuleConfig.getDefault().getRecentCommiters(), user)); setCaretPosition(commiterComboBox); initCommitMessage(commitMessage, preferredMessage); attacheMessageListener(); initActions(); }
Example #9
Source File: SnapshotInfoPanel.java From visualvm with GNU General Public License v2.0 | 6 votes |
private void initComponents() { setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); setLayout(new BorderLayout(0, 5)); JLabel textLabel = new JLabel(); Mnemonics.setLocalizedText(textLabel, Bundle.SnapshotInfoPanel_UserCommentsLbl()); textArea = new JTextArea(); textLabel.setLabelFor(textArea); textArea.requestFocus(); JScrollPane textAreaScroll = new JScrollPane(textArea); textAreaScroll.setPreferredSize(new Dimension(350, 150)); add(textAreaScroll, BorderLayout.CENTER); add(textLabel, BorderLayout.NORTH); getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(NotifyDescriptor.class, "ACSD_InputPanel") // NOI18N ); textArea.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(NotifyDescriptor.class, "ACSD_InputField") // NOI18N ); }
Example #10
Source File: Rebase.java From netbeans with Apache License 2.0 | 6 votes |
@NbBundle.Messages({ "CTL_RebasePanel_okButton.text=&Rebase", "CTL_RebasePanel_okButton.ACSD=Rebase selected changesets", "CTL_RebasePanel_cancelButton.text=&Cancel", "CTL_RebasePanel_cancelButton.ACSD=Cancel rebase", "CTL_RebasePanel_ACSD=Select changesets to rebase" }) public Rebase (File repository, HgLogMessage workingCopyParent, Collection<HgLogMessage> branchHeads) { kinds = new RebaseKind[] { new RebaseKind.BasicKind(branchHeads, workingCopyParent), new RebaseKind.SelectDestinationKind(repository, branchHeads, workingCopyParent), new RebaseKind.SelectBaseKind(repository, branchHeads, workingCopyParent), new RebaseKind.SelectSourceKind(repository, branchHeads, workingCopyParent) }; panel = new RebasePanel(); okButton = new JButton(); Mnemonics.setLocalizedText(okButton, Bundle.CTL_RebasePanel_okButton_text()); okButton.getAccessibleContext().setAccessibleDescription(Bundle.CTL_RebasePanel_okButton_ACSD()); cancelButton = new JButton(); Mnemonics.setLocalizedText(cancelButton, Bundle.CTL_RebasePanel_cancelButton_text()); cancelButton.getAccessibleContext().setAccessibleDescription(Bundle.CTL_RebasePanel_cancelButton_ACSD()); okButton.setEnabled(false); attachListeners(); initializeCombo(); }
Example #11
Source File: ResultProcessor.java From netbeans with Apache License 2.0 | 6 votes |
protected final void resolveConflicts (Collection<File> conflicts) { JButton resolve = new JButton(); Mnemonics.setLocalizedText(resolve, NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.resolveButton.text")); //NOI18N resolve.setToolTipText(NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.resolveButton.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.resolveConflicts"), //NOI18N NbBundle.getMessage(ResultProcessor.class, "LBL_ResultProcessor.resolveConflicts"), //NOI18N NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.QUESTION_MESSAGE, new Object[] { resolve, review, NotifyDescriptor.CANCEL_OPTION }, resolve)); if (o == review) { openInVersioningView(conflicts); } else if (o == resolve) { GitProgressSupport supp = new ResolveConflictsExecutor(conflicts.toArray(new File[conflicts.size()])); supp.start(Git.getInstance().getRequestProcessor(repository), repository, NbBundle.getMessage(ResolveConflictsAction.class, "MSG_PreparingMerge")); //NOI18N } }
Example #12
Source File: OQLQueryCustomizer.java From visualvm with GNU General Public License v2.0 | 6 votes |
public static OQLSupport.Query saveCustomizer(OQLSupport.Query query, String script) { JButton okButton = new JButton(); Mnemonics.setLocalizedText(okButton, Bundle.OQLQueryCustomizer_OkButtonText()); String name = query == null ? Bundle.OQLQueryCustomizer_DefaultQueryName() : query.getName(); String description = query == null ? null : query.getDescription(); if (description != null && new File(description).isFile()) description = null; CustomizerPanel customizer = new CustomizerPanel(name, description, okButton); final DialogDescriptor dd = new DialogDescriptor(customizer, Bundle.OQLQueryCustomizer_SaveQueryCaption(), true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, 0, null, null); final Dialog d = DialogDisplayer.getDefault().createDialog(dd); d.pack(); d.setVisible(true); if (dd.getValue() == okButton) { return new OQLSupport.Query(script, customizer.name(), customizer.description()); } else { return null; } }
Example #13
Source File: OperationWizardModel.java From netbeans with Apache License 2.0 | 6 votes |
public void modifyOptionsForContinue (final WizardDescriptor wd, boolean canFinish) { recognizeButtons (wd); if (canFinish) { final JButton b = getOriginalFinish (wd); Mnemonics.setLocalizedText (b, getBundle ("InstallUnitWizardModel_Buttons_Close")); SwingUtilities.invokeLater (new Runnable () { @Override public void run () { wd.setOptions (new JButton [] {b}); } }); } else { removeFinish (wd); Mnemonics.setLocalizedText (getOriginalNext (wd), NbBundle.getMessage (InstallUnitWizardModel.class, "InstallUnitWizardModel_Buttons_MnemonicNext", getBundle ("InstallUnitWizardModel_Buttons_Next"))); } }
Example #14
Source File: HudsonJobCreator.java From netbeans with Apache License 2.0 | 6 votes |
@NbBundle.Messages({ "HudsonJobCreator.button.labelWithMnemonics=&Hudson Options...", "HudsonJobCreator.button.a11y=Open Hudson PHP options." }) private JButton getOpenHudsonOptionsButton() { JButton button = new JButton(); Mnemonics.setLocalizedText(button, Bundle.HudsonJobCreator_button_labelWithMnemonics()); button.getAccessibleContext().setAccessibleDescription(Bundle.HudsonJobCreator_button_a11y()); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { UiUtils.showOptions(HudsonOptionsPanelController.OPTIONS_SUBPATH); } }); return button; }
Example #15
Source File: ApplicationsSorting.java From visualvm with GNU General Public License v2.0 | 6 votes |
private JMenuItem createPresenter() { final JMenu menu = new JMenu() { protected void fireMenuSelected() { Component[] items = getMenuComponents(); for (Component item : items) if (item instanceof SortAction) ((SortAction)item).updateAction(); } }; Mnemonics.setLocalizedText(menu, NbBundle.getMessage(ApplicationsSorting.class, "ACT_SortApps")); // NOI18N menu.add(new SortAction(NbBundle.getMessage(ApplicationsSorting.class, "ACT_TimeAdded"), BY_TIME_COMPARATOR, sorter)); // NOI18N menu.add(new SortAction(NbBundle.getMessage(ApplicationsSorting.class, "ACT_DisplayName"), BY_NAME_COMPARATOR, sorter)); // NOI18N menu.add(new SortAction(NbBundle.getMessage(ApplicationsSorting.class, "ACT_Pid"), BY_PID_COMPARATOR, sorter)); // NOI18N menu.addSeparator(); menu.add(new SortSwitch()); return menu; }
Example #16
Source File: FilesModifiedConfirmation.java From netbeans with Apache License 2.0 | 6 votes |
public FilesModifiedConfirmation(SaveCookie[] saveCookies) { btnSaveAll = createSaveAllButton(); btnSave = createSaveButton(); Mnemonics.setLocalizedText(btnSaveAll, getInitialSaveAllButtonText()); Mnemonics.setLocalizedText(btnSave, getInitialSaveButtonText()); JScrollPane scrollPane = new JScrollPane(list = createFilesList(saveCookies)); if (!listModel.isEmpty()) { list.setSelectedIndex(0); } else { updateSaveButtonState(); } JComponent panel = new JPanel(new GridLayout(1, 1)); panel.add(scrollPane); panel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); mainComponent = panel; }
Example #17
Source File: CatalogAction.java From netbeans with Apache License 2.0 | 5 votes |
public @Override void actionPerformed(ActionEvent e) { Dialog dialog = dialogWRef.get (); if (dialog == null || ! dialog.isShowing ()) { final CatalogPanel cp = new CatalogPanel (); JButton closeButton = new JButton (); Mnemonics.setLocalizedText (closeButton,NbBundle.getMessage (CatalogAction.class, "BTN_CatalogPanel_CloseButton")); // NOI18N JButton openInEditor = new JButton (); openInEditor.setEnabled (false); OpenInEditorListener l = new OpenInEditorListener (cp, openInEditor); openInEditor.addActionListener (l); cp.getExplorerManager ().addPropertyChangeListener (l); Mnemonics.setLocalizedText (openInEditor,NbBundle.getMessage (CatalogAction.class, "BTN_CatalogPanel_OpenInEditorButton")); // NOI18N DialogDescriptor dd = new DialogDescriptor (cp,NbBundle.getMessage (CatalogAction.class, "LBL_CatalogPanel_Title"), // NOI18N false, // modal new Object [] { openInEditor, closeButton }, closeButton, DialogDescriptor.DEFAULT_ALIGN, null, null); dd.setClosingOptions (null); // set helpctx to null again, DialogDescriptor replaces null with HelpCtx.DEFAULT_HELP dd.setHelpCtx (null); dialog = DialogDisplayer.getDefault ().createDialog (dd); dialog.setVisible (true); dialogWRef = new WeakReference<Dialog> (dialog); } else { dialog.toFront (); } }
Example #18
Source File: ToolbarsListAction.java From netbeans with Apache License 2.0 | 5 votes |
public JMenuItem getMenuPresenter() { String label = NbBundle.getMessage(ToolbarsListAction.class, "CTL_ToolbarsListAction"); final JMenu menu = new JMenu(label); Mnemonics.setLocalizedText(menu, label); if (EventQueue.isDispatchThread()) { return ToolbarConfiguration.getToolbarsMenu(menu); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { ToolbarConfiguration.getToolbarsMenu(menu); } }); return menu; } }
Example #19
Source File: AnnotationsPanel.java From netbeans with Apache License 2.0 | 5 votes |
private static void loc (Component c, String key) { if (c instanceof AbstractButton) Mnemonics.setLocalizedText ( (AbstractButton) c, loc (key) ); else Mnemonics.setLocalizedText ( (JLabel) c, loc (key) ); }
Example #20
Source File: GeneralEditorPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * Creates new form GeneralEditorPanel. */ public GeneralEditorPanel () { initComponents (); loc (lCamelCaseBehavior, "Camel_Case_Behavior"); loc (cbCamelCaseBehavior, "Enable_Camel_Case_In_Java"); loc (lCamelCaseBehaviorExample, "Camel_Case_Behavior_Example"); loc (lSearch, "Search"); loc (lEditorSearchType, "Editor_Search_Type"); loc (cboEditorSearchType, "Editor_Search_Type"); loc (cbBraceTooltip, "Brace_First_Tooltip"); loc (cbShowBraceOutline, "Brace_Show_Outline"); cboEditorSearchType.setRenderer(new EditorSearchTypeRenderer(cboEditorSearchType.getRenderer())); cboEditorSearchType.setModel(new DefaultComboBoxModel<String>(new String [] { "default", "closing"})); //NOI18N cboEditorSearchType.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (cboEditorSearchType.getSelectedItem().equals("default")) Mnemonics.setLocalizedText(lSearchtypeTooltip, NbBundle.getMessage (GeneralEditorPanel.class, "Editor_Search_Type_Tooltip_default")); else Mnemonics.setLocalizedText(lSearchtypeTooltip, NbBundle.getMessage (GeneralEditorPanel.class, "Editor_Search_Type_Tooltip_closing")); } }); Mnemonics.setLocalizedText(lSearchtypeTooltip, NbBundle.getMessage (GeneralEditorPanel.class, "Editor_Search_Type_Tooltip_closing")); }
Example #21
Source File: SafeDeletePanel.java From netbeans with Apache License 2.0 | 5 votes |
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup = new javax.swing.ButtonGroup(); checkBoxes = new javax.swing.JPanel(); label = new javax.swing.JLabel(); searchInComments = new javax.swing.JCheckBox(); setLayout(new java.awt.BorderLayout()); checkBoxes.setLayout(new java.awt.BorderLayout()); label.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 8, 0)); checkBoxes.add(label, java.awt.BorderLayout.NORTH); searchInComments.setSelected(((Boolean) RefactoringModule.getOption("searchInComments.whereUsed", Boolean.FALSE)).booleanValue()); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/refactoring/java/ui/Bundle"); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(searchInComments, bundle.getString("LBL_SafeDelInComents")); // NOI18N searchInComments.setMargin(new java.awt.Insets(2, 14, 2, 2)); searchInComments.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { searchInCommentsItemStateChanged(evt); } }); checkBoxes.add(searchInComments, java.awt.BorderLayout.SOUTH); searchInComments.getAccessibleContext().setAccessibleDescription(searchInComments.getText()); add(checkBoxes, java.awt.BorderLayout.NORTH); }
Example #22
Source File: DetailPanel.java From netbeans with Apache License 2.0 | 5 votes |
private void tableChoiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tableChoiceActionPerformed boolean selected = tableChoice.isSelected(); tableCombo.setEnabled(selected); if (selected) { Mnemonics.setLocalizedText(availableLabel, NbBundle.getMessage(DetailPanel.class, "LBL_DetailAvailableColumns")); // NOI18N Mnemonics.setLocalizedText(includeLabel, NbBundle.getMessage(DetailPanel.class, "LBL_DetailColumnsToInclude")); // NOI18N ForeignKey key = getForeignKey(); fillLists(key.isValid() ? getForeignKey().getFKTable() : null); previewLabel.setIcon(tableIcon); } }
Example #23
Source File: SelectFolderPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** Create the wizard panel component and set up some basic properties. */ public SelectFolderPanel(SelectFolderWizardPanel wiz, String name, String hint, String displayNameLabelText, DataFolder top, boolean stripAmps, String prop) { this.wiz = wiz; initComponents (); // Provide a name in the title bar. setName (name); hintsArea.setText (hint); initAccessibility (hint); //displayNameLabel.setText(displayNameLabelText); displayNameLabel.getAccessibleContext().setAccessibleDescription( displayNameLabelText ); Mnemonics.setLocalizedText(displayNameLabel,displayNameLabelText); displayNameField.getAccessibleContext().setAccessibleName(displayNameLabelText); displayNameField.getAccessibleContext().setAccessibleDescription(displayNameLabelText); this.prop = prop; this.top = top; this.stripAmps = stripAmps; DefaultListModel model = new DefaultListModel(); DataObject[] folders = findFolders(top); for (int i = 0; i < folders.length; i++) { model.addElement(folders[i]); } folderList.setModel(model); folderList.setCellRenderer(new CellRenderer()); displayNameField.getDocument().addDocumentListener(this); }
Example #24
Source File: BranchPicker.java From netbeans with Apache License 2.0 | 5 votes |
boolean openDialog () { final JButton okButton = new JButton(); Mnemonics.setLocalizedText(okButton, NbBundle.getMessage(BranchPicker.class, "LBL_BranchPicker.okButton.text")); //NOI18N DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(BranchPicker.class, "LBL_BranchPicker.title"), //NOI18N true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(BranchPicker.class), null); okButton.setEnabled(false); Dialog dialog = DialogDisplayer.getDefault().createDialog(dd); ListSelectionListener list = new ListSelectionListener() { @Override public void valueChanged (ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { String selected = (String) panel.lstBranches.getSelectedValue(); selectedPath = null; if (!FORBIDDEN_SELECTION.contains(selected)) { selectedPath = selected; } okButton.setEnabled(selectedPath != null); } } }; panel.lstBranches.addListSelectionListener(list); initializeItems(); dialog.setVisible(true); SvnProgressSupport supp = loadingSupport; if (supp != null) { supp.cancel(); } panel.lstBranches.removeListSelectionListener(list); return dd.getValue() == okButton; }
Example #25
Source File: IndexSearch.java From netbeans with Apache License 2.0 | 5 votes |
void go() { String toFind = searchComboBox.getEditor().getItem().toString().trim(); // Alocate array for results results = new ArrayList<DocIndexItem>(); //Clear all models referenceModel = null; typeModel = null; alphaModel = null; // Try to find this string in Combo for ( int i = 0; i < searchComboBox.getItemCount(); i++ ) { if ( searchComboBox.getItemAt( i ).toString().equals( toFind ) || i >= 10 ) { searchComboBox.removeItemAt( i ); } } searchComboBox.insertItemAt( toFind, 0 ); mirrorMRUStrings(); searchComboBox.getEditor().setItem( toFind ); resultsList.setModel( waitModel ); Mnemonics.setLocalizedText(searchButton, NbBundle.getMessage(IndexSearch.class,"CTL_SEARCH_ButtonStop")); stopState = true; searchTask.addSearch(toFind); }
Example #26
Source File: RSSFeed.java From netbeans with Apache License 2.0 | 5 votes |
private JComponent buildProxyPanel() { Component header = getContentHeader(); JPanel panel = new JPanel(new GridBagLayout()); panel.setOpaque( false ); int row = 0; if( null != header ) { panel.add( header, new GridBagConstraints(0,row++,1,1,1.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) ); } panel.add( new JLabel(BundleSupport.getLabel("ErrCannotConnect")), // NOI18N new GridBagConstraints(0,row++,1,1,0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); if( showProxyButton ) { JButton button = new JButton(); Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "ProxyConfig" ) ); // NOI18N button.setOpaque( false ); button.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { HttpProxySettings.getDefault().showConfigurationDialog(); } }); panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0, GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) ); } return panel; }
Example #27
Source File: FiltersDescriptor.java From netbeans with Apache License 2.0 | 5 votes |
/** Creates a new instance of SortByNameAction */ SortAction (DVFilter item) { this.filterItem = item; String displayName = item.getDisplayName(); int i = Mnemonics.findMnemonicAmpersand(displayName); if (i >= 0) { displayName = displayName.substring(0, i) + displayName.substring(i+1); } putValue(Action.NAME, displayName); putValue(Action.SMALL_ICON, item.getIcon()); }
Example #28
Source File: SyncEditorWithViewsAction.java From netbeans with Apache License 2.0 | 5 votes |
private void createItems() { if (menuItems == null) { menuItems = new JCheckBoxMenuItem[1]; menuItems[0] = new JCheckBoxMenuItem(this); menuItems[0].setIcon(null); Mnemonics.setLocalizedText(menuItems[0], NbBundle.getMessage(SyncEditorWithViewsAction.class, "CTL_SYNC_EDITOR_WITH_VIEWS")); } }
Example #29
Source File: Doctrine2CustomizerPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form * Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { enabledCheckBox = new JCheckBox(); enabledInfoLabel = new JLabel(); Mnemonics.setLocalizedText(enabledCheckBox, NbBundle.getMessage(Doctrine2CustomizerPanel.class, "Doctrine2CustomizerPanel.enabledCheckBox.text")); // NOI18N Mnemonics.setLocalizedText(enabledInfoLabel, NbBundle.getMessage(Doctrine2CustomizerPanel.class, "Doctrine2CustomizerPanel.enabledInfoLabel.text")); // NOI18N GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(Alignment.LEADING) .addComponent(enabledCheckBox) .addGroup(layout.createSequentialGroup() .addGap(21, 21, 21) .addComponent(enabledInfoLabel)) ); layout.setVerticalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(enabledCheckBox) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(enabledInfoLabel)) ); }
Example #30
Source File: GruntCustomizerPanel.java From netbeans with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { tasksLabel = new JLabel(); tasksTextField = new JTextField(); tasksInfoLabel = new JLabel(); tasksLabel.setLabelFor(tasksTextField); Mnemonics.setLocalizedText(tasksLabel, NbBundle.getMessage(GruntCustomizerPanel.class, "GruntCustomizerPanel.tasksLabel.text")); // NOI18N Mnemonics.setLocalizedText(tasksInfoLabel, NbBundle.getMessage(GruntCustomizerPanel.class, "GruntCustomizerPanel.tasksInfoLabel.text")); // NOI18N GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(tasksLabel) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(tasksInfoLabel) .addComponent(tasksTextField))) ); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(tasksLabel) .addComponent(tasksTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(tasksInfoLabel) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }