Package org.netbeans.validation.api.ui

Examples of org.netbeans.validation.api.ui.ValidationPanel


                customBoundsItem.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent e) {
                        CustomBoundsDialog d = new CustomBoundsDialog();
                        d.setup(model);
                        ValidationPanel validationPanel = CustomBoundsDialog.createValidationPanel(d);
                        String title = NbBundle.getMessage(CustomBoundsDialog.class, "CustomBoundsDialog.title");
                        final DialogDescriptor descriptor = new DialogDescriptor(validationPanel, title);
                        validationPanel.addChangeListener(new ChangeListener() {

                            public void stateChanged(ChangeEvent e) {
                                descriptor.setValid(!((ValidationPanel) e.getSource()).isProblem());
                            }
                        });
View Full Code Here


        view.getTextNomeProj().setDocument(new FixedLengthDocument(30));

        view.getTextNomeProj().setName("Nome do projeto");
        view.getTextAutorProj().setName("Autor do projeto");
        view.getTextDescProj().setName("Descrição do projeto");
        final ValidationPanel pnl = new ValidationPanel();
        view.setContentPane(pnl);
        pnl.setInnerComponent(view.getPanel());

        // O campo Nome não pode ser vazio
        Validator<javax.swing.text.Document> vldVazio = Validators.forDocument(true, Validators.REQUIRE_NON_EMPTY_STRING);
        pnl.getValidationGroup().add(view.getTextNomeProj(), vldVazio);
        pnl.getValidationGroup().add(view.getTextAutorProj(), vldVazio);
        pnl.addChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
                Problem p = pnl.getProblem();
                boolean enable = p == null ? true : p.severity() != Severity.FATAL;

                view.getBtnConfirmar().setEnabled(enable);
            }
        });
View Full Code Here

TOP

Related Classes of org.netbeans.validation.api.ui.ValidationPanel

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.