Search in sources :

Example 16 with ValidationGroup

use of org.netbeans.validation.api.ui.ValidationGroup in project gephi by gephi.

the class ConvertColumnToDynamicTimestampsUI method buildValidationPanel.

private void buildValidationPanel() {
    validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(this);
    ValidationGroup group = validationPanel.getValidationGroup();
    group.add(titleTextField, new ColumnTitleValidator(table));
    group.add(timestampText, new IntervalBoundValidator());
    validationPanel.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            dialogControls.setOkButtonEnabled(!validationPanel.isProblem());
        }
    });
}
Also used : ColumnTitleValidator(org.gephi.ui.utils.ColumnTitleValidator) ChangeEvent(javax.swing.event.ChangeEvent) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) IntervalBoundValidator(org.gephi.ui.utils.IntervalBoundValidator) ChangeListener(javax.swing.event.ChangeListener) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 17 with ValidationGroup

use of org.netbeans.validation.api.ui.ValidationGroup in project gephi by gephi.

the class ConvertColumnToDynamicUI method buildValidationPanel.

private void buildValidationPanel() {
    validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(this);
    ValidationGroup group = validationPanel.getValidationGroup();
    group.add(titleTextField, new ColumnTitleValidator(table));
    group.add(intervalStartText, new IntervalBoundValidator());
    group.add(intervalEndText, new IntervalBoundValidator(intervalStartText));
    validationPanel.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            dialogControls.setOkButtonEnabled(!validationPanel.isProblem());
        }
    });
}
Also used : ColumnTitleValidator(org.gephi.ui.utils.ColumnTitleValidator) ChangeEvent(javax.swing.event.ChangeEvent) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) IntervalBoundValidator(org.gephi.ui.utils.IntervalBoundValidator) ChangeListener(javax.swing.event.ChangeListener) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 18 with ValidationGroup

use of org.netbeans.validation.api.ui.ValidationGroup in project gephi by gephi.

the class EqualStringPanel method createValidationPanel.

public static ValidationPanel createValidationPanel(final EqualStringPanel innerPanel) {
    final ValidationPanel validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(innerPanel);
    ValidationGroup group = validationPanel.getValidationGroup();
    validationPanel.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            innerPanel.okButton.setEnabled(!validationPanel.isProblem());
        }
    });
    //Node field
    group.add(innerPanel.textField, new RegexValidator(innerPanel));
    return validationPanel;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) ChangeListener(javax.swing.event.ChangeListener) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 19 with ValidationGroup

use of org.netbeans.validation.api.ui.ValidationGroup in project gephi by gephi.

the class CustomBoundsDialog method createValidationPanel.

public static ValidationPanel createValidationPanel(CustomBoundsDialog panel) {
    ValidationPanel validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(panel);
    ValidationGroup group = validationPanel.getValidationGroup();
    panel.createValidation(group, validationPanel);
    return validationPanel;
}
Also used : ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 20 with ValidationGroup

use of org.netbeans.validation.api.ui.ValidationGroup in project gephi by gephi.

the class ScreenshotSettingsPanel method createValidationPanel.

public static ValidationPanel createValidationPanel(ScreenshotSettingsPanel innerPanel) {
    ValidationPanel validationPanel = new ValidationPanel();
    if (innerPanel == null) {
        innerPanel = new ScreenshotSettingsPanel();
    }
    validationPanel.setInnerComponent(innerPanel);
    ValidationGroup group = validationPanel.getValidationGroup();
    //Node field
    group.add(innerPanel.widthTextField, Validators.REQUIRE_NON_EMPTY_STRING, new Multiple4NumberValidator());
    //Edge field
    group.add(innerPanel.heightTextField, Validators.REQUIRE_NON_EMPTY_STRING, new Multiple4NumberValidator());
    return validationPanel;
}
Also used : Multiple4NumberValidator(org.gephi.lib.validation.Multiple4NumberValidator) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Aggregations

ValidationGroup (org.netbeans.validation.api.ui.ValidationGroup)21 ValidationPanel (org.netbeans.validation.api.ui.ValidationPanel)21 ColumnTitleValidator (org.gephi.ui.utils.ColumnTitleValidator)9 ChangeEvent (javax.swing.event.ChangeEvent)4 ChangeListener (javax.swing.event.ChangeListener)4 IntervalBoundValidator (org.gephi.ui.utils.IntervalBoundValidator)2 JPanel (javax.swing.JPanel)1 BetweenZeroAndOneValidator (org.gephi.lib.validation.BetweenZeroAndOneValidator)1 Multiple4NumberValidator (org.gephi.lib.validation.Multiple4NumberValidator)1 PositiveNumberValidator (org.gephi.lib.validation.PositiveNumberValidator)1 Problems (org.netbeans.validation.api.Problems)1 Validator (org.netbeans.validation.api.Validator)1