downloadButton.setDefaultCapable(true); downloadButton.requestFocus(); downloadButton.addActionListener(new ActionListener() {
private void cmbExampleFocusLost(java.awt.event.FocusEvent evt) { // TODO add your handling code here: btnTest.setDefaultCapable(false); }
public JButton getFindNextButton() { if (findNextButton == null) { findNextButton = new JButton(); findNextButton.setText("Find Next"); findNextButton.setMnemonic('F'); findNextButton.setDefaultCapable(true); findNextButton.addActionListener(this); } return findNextButton; }
public JButton getReplaceButton() { if (replaceButton == null) { replaceButton = new JButton(); replaceButton.setText("Replace"); replaceButton.setMnemonic('R'); replaceButton.setDefaultCapable(true); replaceButton.addActionListener(this); } return replaceButton; }
public JButton getActivateButton() { if (activateButton == null) { activateButton = new JButton(); activateButton.setText("Activate"); activateButton.setMnemonic('A'); activateButton.setDefaultCapable(true); activateButton.addActionListener(this); } return activateButton; }
private void cmbExampleFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_cmbExampleFocusGained //btnOK.setDefaultCapable(false); btnTest.setDefaultCapable(true); getRootPane().setDefaultButton(btnTest); }//GEN-LAST:event_cmbExampleFocusGained
private JPanel createButtonsPanel() { final JButton okButton = new JButton( confirmAction ); okButton.setDefaultCapable( true ); final JPanel buttonsPanel = new JPanel(); buttonsPanel.setLayout( new FlowLayout( FlowLayout.RIGHT, 5, 5 ) ); buttonsPanel.setBorder( BorderFactory.createMatteBorder( 1, 0, 0, 0, Color.LIGHT_GRAY ) ); buttonsPanel.add( okButton ); buttonsPanel.add( new JButton( new CancelAction() ) ); return buttonsPanel; }
/** * This method initializes addProjectButton . * @return javax.swing.JButton */ private JButton getAddProjectButton() { if (addProjectButton == null) { addProjectButton = new JButton(new ImageIcon(getClass().getResource("/icons/gtk-add.png"))); addProjectButton.setText(textBundle.textFor("ManageProjectsDialog.AddProjectButton.Title")); //$NON-NLS-1$ addProjectButton.setToolTipText(textBundle.textFor("ManageProjectsDialog.AddProjectButton.ToolTipText")); //$NON-NLS-1$ addProjectButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(final java.awt.event.ActionEvent e) { String projectName = getNewProjectTextField().getText(); model.addProject(new Project(RandomUtils.nextLong(), projectName, projectName), ManageProjectsDialog.this); getNewProjectTextField().setText(""); //$NON-NLS-1$ } }); addProjectButton.setDefaultCapable(true); } return addProjectButton; }
private JPanel createButtonPanel() { final JButton btnCancel = new JButton( getCancelAction() ); final JButton btnConfirm = new JButton( getConfirmAction() ); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout( new GridLayout( 1, 2, 5, 5 ) ); buttonPanel.add( btnConfirm ); buttonPanel.add( btnCancel ); btnConfirm.setDefaultCapable( true ); getRootPane().setDefaultButton( btnConfirm ); buttonPanel.registerKeyboardAction( getConfirmAction(), KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); final JPanel buttonCarrier = new JPanel(); buttonCarrier.setLayout( new FlowLayout( FlowLayout.RIGHT ) ); buttonCarrier.add( buttonPanel ); return buttonCarrier; }
protected JPanel createButtonPanel() { final JButton btnCancel = new JButton( getCancelAction() ); final JButton btnConfirm = new JButton( getConfirmAction() ); final JPanel buttonPanel = new JPanel(); buttonPanel.setLayout( new GridLayout( 1, 2, 5, 5 ) ); buttonPanel.add( btnConfirm ); buttonPanel.add( btnCancel ); btnConfirm.setDefaultCapable( true ); getRootPane().setDefaultButton( btnConfirm ); buttonPanel.registerKeyboardAction( getConfirmAction(), KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0 ), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); final JPanel buttonCarrier = new JPanel(); buttonCarrier.setLayout( new FlowLayout( FlowLayout.RIGHT ) ); buttonCarrier.add( buttonPanel ); return buttonCarrier; }
public static void init(JButton jbutton, Thing self, Container parent, ActionContext actionContext){ AbstractButtonCreator.init(jbutton, self, parent, actionContext); Boolean defaultCapable = JavaCreator.createBoolean(self, "defaultCapable"); if(defaultCapable != null){ jbutton.setDefaultCapable(defaultCapable); } } }
protected static boolean showModifiedMessage(String title) { String message = NbBundle.getMessage(SharedRubyProjectProperties.class, "TXT_Regenerate"); JButton regenerateButton = new JButton(NbBundle.getMessage(SharedRubyProjectProperties.class, "CTL_RegenerateButton")); regenerateButton.setDefaultCapable(true); regenerateButton.getAccessibleContext().setAccessibleDescription( NbBundle.getMessage(SharedRubyProjectProperties.class, "AD_RegenerateButton")); NotifyDescriptor d = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE); d.setTitle(title); d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); d.setOptions(new Object[]{regenerateButton, NotifyDescriptor.CANCEL_OPTION}); return DialogDisplayer.getDefault().notify(d) == regenerateButton; }
private static boolean showModifiedMessage (String title) { String message = NbBundle.getMessage(AppClientProjectProperties.class,"TXT_Regenerate"); JButton regenerateButton = new JButton (NbBundle.getMessage(AppClientProjectProperties.class,"CTL_RegenerateButton")); regenerateButton.setDefaultCapable(true); regenerateButton.getAccessibleContext().setAccessibleDescription (NbBundle.getMessage(AppClientProjectProperties.class,"AD_RegenerateButton")); NotifyDescriptor d = new NotifyDescriptor.Message (message, NotifyDescriptor.WARNING_MESSAGE); d.setTitle(title); d.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); d.setOptions(new Object[] {regenerateButton, NotifyDescriptor.CANCEL_OPTION}); return DialogDisplayer.getDefault().notify(d) == regenerateButton; }
public @Override void run() { DialogDescriptor d = new DialogDescriptor( NbBundle.getMessage(BuildInstallersAction.class, "BuildInstallersAction.NotConfigured.Warning.Message"), NbBundle.getMessage(BuildInstallersAction.class, "BuildInstallersAction.NotConfigured.Warning.Title")); d.setModal(true); JButton accept = new JButton(NbBundle.getMessage(BuildInstallersAction.class, "BuildInstallersAction.NotConfigured.Warning.OK")); accept.setDefaultCapable(true); d.setOptions(new Object[]{ accept}); d.setMessageType(NotifyDescriptor.WARNING_MESSAGE); if (DialogDisplayer.getDefault().notify(d).equals(accept)) { //SuiteCustomizer cpi = prj.getLookup().lookup(org.netbeans.modules.apisupport.project.ui.customizer.SuiteCustomizer.class); //cpi.showCustomizer(SuiteCustomizer.APPLICATION, SuiteCustomizer.APPLICATION_CREATE_STANDALONE_APPLICATION); } } });
public @Override void run() { DialogDescriptor d = new DialogDescriptor( NbBundle.getMessage(BuildInstallersAction.class, "BuildInstallersAction.NotApp.Warning.Message"), NbBundle.getMessage(BuildInstallersAction.class, "BuildInstallersAction.NotApp.Warning.Title")); d.setModal(true); JButton accept = new JButton(NbBundle.getMessage(BuildInstallersAction.class, "BuildInstallersAction.NotApp.Warning.OK")); accept.setDefaultCapable(true); d.setOptions(new Object[]{ accept}); d.setMessageType(NotifyDescriptor.WARNING_MESSAGE); if (DialogDisplayer.getDefault().notify(d).equals(accept)) { //SuiteCustomizer cpi = prj.getLookup().lookup(org.netbeans.modules.apisupport.project.ui.customizer.SuiteCustomizer.class); //cpi.showCustomizer(SuiteCustomizer.APPLICATION, SuiteCustomizer.APPLICATION_CREATE_STANDALONE_APPLICATION); } } });
/** * This method initializes this * */ private void initialize() { this.setSize(new Dimension(515, 321)); this.setTitle("Test Service Catalogue API Caller"); this.setContentPane(getJContentPane()); this.bSubmitRequest.setDefaultCapable(true); this.getRootPane().setDefaultButton(bSubmitRequest); }
public boolean showMe() { String title = NbBundle.getMessage(RerunArguments.class, "RerunArguments.title.text"); // NOI18N DialogDescriptor dd = new DialogDescriptor(this, title); dd.setOptionType(NotifyDescriptor.OK_CANCEL_OPTION); JButton run = new JButton(NbBundle.getMessage(RerunArguments.class, "LBL_run_advanced_run")); // NOI18N run.setDefaultCapable(true); JButton cancel = new JButton(NbBundle.getMessage(RerunArguments.class, "LBL_run_advanced_cancel")); // NOI18N dd.setOptions(new Object[] {run, cancel}); dd.setModal(true); Object result = DialogDisplayer.getDefault().notify(dd); if (result.equals(run)) { for(ProjectActionEvent event : paes) { if (event.getType() == ProjectActionEvent.PredefinedType.RUN || event.getType() == ProjectActionEvent.PredefinedType.DEBUG || event.getType() == ProjectActionEvent.PredefinedType.DEBUG_STEPINTO) { event.getProfile().getRunCommand().setValue(argumentsField.getText()); break; } } return true; } return false; }
/** * Create an informational report about the results of a command. * * @param shortMsg the short message object * @param detailsMsg the details message object * @see org.openide.NotifyDescriptor#NotifyDescriptor */ public MessageWithDetails(final Object shortMsg, final Object detailsMsg, final boolean respectParent) { super(shortMsg, NotifyDescriptor.getTitleForType(NotifyDescriptor.INFORMATION_MESSAGE)); this.detailsMsg = detailsMsg; showDetailsButton.setDefaultCapable(false); setOptions(new Object[] { OK_OPTION }); setAdditionalOptions(new Object[] { showDetailsButton }); setLeaf(!respectParent); }
public ArrayCellEditor() { setLayout( new BorderLayout() ); this.eventListenerList = new EventListenerList(); ellipsisButton = new EllipsisButton( "..." ); ellipsisButton.setDefaultCapable( false ); ellipsisButton.addActionListener( new ExtendedEditorAction() ); textField = new JTextField(); textField.setDocument( new NonFilteringPlainDocument() ); textField.getInputMap().put( Messages.getInstance().getKeyStroke ( "PropertyCellEditorWithEllipsis.PopupEditor.Accelerator" ), POPUP_EDITOR ); textField.getActionMap().put( POPUP_EDITOR, new ExtendedEditorAction() ); textField.setBorder( BorderFactory.createEmptyBorder() ); textField.setEditable( false ); add( textField, BorderLayout.CENTER ); add( ellipsisButton, BorderLayout.EAST ); nullable = false; }
/** * Create a report about the results of a command. * * @param shortMsg the message object * @param detailsMsg the details message object * @param messageType the type of message to be displayed * @see org.openide.NotifyDescriptor#NotifyDescriptor */ public MessageWithDetails(final Object shortMsg, final Object detailsMsg, final int messageType, final boolean respectParent) { super(shortMsg, NotifyDescriptor.getTitleForType(messageType)); this.setMessageType(messageType); this.detailsMsg = detailsMsg; showDetailsButton.setDefaultCapable(false); setOptions(new Object[] { OK_OPTION }); setAdditionalOptions(new Object[] { showDetailsButton }); setLeaf(!respectParent); }