Package org.netbeans.modules.scala.project.ui.customizer

Examples of org.netbeans.modules.scala.project.ui.customizer.MainClassWarning


                });
                break;
            default:
                throw new IllegalArgumentException();
        }
        final MainClassWarning panel = new MainClassWarning(message, project.getSourceRoots().getRoots());
        Object[] options = new Object[]{
            okButton,
            DialogDescriptor.CANCEL_OPTION
        };

        panel.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                if (e.getSource() instanceof MouseEvent && MouseUtils.isDoubleClick(((MouseEvent) e.getSource()))) {
                    // click button and the finish dialog with selected class
                    okButton.doClick();
                } else {
                    okButton.setEnabled(panel.getSelectedMainClass() != null);
                }
            }
        });

        okButton.setEnabled(false);
        DialogDescriptor desc = new DialogDescriptor(panel,
                NbBundle.getMessage(MainClassWarning.class, "CTL_MainClassWarning_Title", ProjectUtils.getInformation(project).getDisplayName()), // NOI18N
                true, options, options[0], DialogDescriptor.BOTTOM_ALIGN, null, null);
        desc.setMessageType(DialogDescriptor.INFORMATION_MESSAGE);
        Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);
        dlg.setVisible(true);
        if (desc.getValue() != options[0]) {
            canceled = true;
        } else {
            mainClass = panel.getSelectedMainClass();
            canceled = false;
            ep.put(J2SEProjectProperties.MAIN_CLASS, mainClass == null ? "" : mainClass);
        }
        dlg.dispose();
View Full Code Here


        assert mainClasses != null;
        String mainClass = null;
        final JButton okButton = new JButton(NbBundle.getMessage(MainClassWarning.class, "LBL_MainClassWarning_ChooseMainClass_OK")); // NOI18N
        okButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(MainClassWarning.class, "AD_MainClassWarning_ChooseMainClass_OK"));

        final MainClassWarning panel = new MainClassWarning(NbBundle.getMessage(MainClassWarning.class, "CTL_FileMultipleMain", file.getNameExt()), mainClasses);
        Object[] options = new Object[]{
            okButton,
            DialogDescriptor.CANCEL_OPTION
        };

        panel.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                if (e.getSource() instanceof MouseEvent && MouseUtils.isDoubleClick(((MouseEvent) e.getSource()))) {
                    // click button and the finish dialog with selected class
                    okButton.doClick();
                } else {
                    okButton.setEnabled(panel.getSelectedMainClass() != null);
                }
            }
        });
        DialogDescriptor desc = new DialogDescriptor(panel,
                NbBundle.getMessage(MainClassWarning.class, "CTL_FileMainClass_Title"), // NOI18N
                true, options, options[0], DialogDescriptor.BOTTOM_ALIGN, null, null);
        desc.setMessageType(DialogDescriptor.INFORMATION_MESSAGE);
        Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);
        dlg.setVisible(true);
        if (desc.getValue() == options[0]) {
            mainClass = panel.getSelectedMainClass();
        }
        dlg.dispose();
        return mainClass;
    }
View Full Code Here

TOP

Related Classes of org.netbeans.modules.scala.project.ui.customizer.MainClassWarning

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.