Search in sources :

Example 1 with ValidationGroup

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

the class AddColumnUI method createValidationPanel.

public static ValidationPanel createValidationPanel(AddColumnUI innerPanel) {
    ValidationPanel validationPanel = new ValidationPanel();
    if (innerPanel == null) {
        innerPanel = new AddColumnUI();
    }
    validationPanel.setInnerComponent(innerPanel);
    ValidationGroup group = validationPanel.getValidationGroup();
    group.add(innerPanel.titleTextField, new ColumnTitleValidator(innerPanel.table));
    return validationPanel;
}
Also used : ColumnTitleValidator(org.gephi.ui.utils.ColumnTitleValidator) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 2 with ValidationGroup

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

the class RandomGraphPanel method createValidationPanel.

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

Example 3 with ValidationGroup

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

the class UIExporterGMLPanel method createValidationPanel.

public static ValidationPanel createValidationPanel(UIExporterGMLPanel innerPanel) {
    ValidationPanel validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(innerPanel);
    ValidationGroup group = validationPanel.getValidationGroup();
    innerPanel.validate(group);
    return validationPanel;
}
Also used : ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 4 with ValidationGroup

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

the class EqualValuesMergeStrategyUI method getSettingsPanel.

@Override
public JPanel getSettingsPanel() {
    //Create a validation panel:
    ValidationPanel validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(this);
    ValidationGroup group = validationPanel.getValidationGroup();
    //ColumnTitleValidator is in UI utils module
    group.add(titleTextField, new ColumnTitleValidator(table));
    return validationPanel;
}
Also used : ColumnTitleValidator(org.gephi.ui.utils.ColumnTitleValidator) ValidationGroup(org.netbeans.validation.api.ui.ValidationGroup) ValidationPanel(org.netbeans.validation.api.ui.ValidationPanel)

Example 5 with ValidationGroup

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

the class DynamicSettingsPanel method createCounpoundPanel.

public static JPanel createCounpoundPanel(DynamicSettingsPanel dynamicPanel, JPanel innerPanel) {
    JPanel result = new JPanel();
    java.awt.GridBagConstraints gridBagConstraints;
    result.setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    result.add(dynamicPanel, gridBagConstraints);
    if (innerPanel != null) {
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        result.add(innerPanel, gridBagConstraints);
    }
    //Validation
    ValidationPanel validationPanel = new ValidationPanel();
    validationPanel.setInnerComponent(result);
    ValidationGroup group = validationPanel.getValidationGroup();
    dynamicPanel.createValidation(group);
    return validationPanel;
}
Also used : JPanel(javax.swing.JPanel) 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