Example usage for javax.swing JToggleButton isEnabled

List of usage examples for javax.swing JToggleButton isEnabled

Introduction

In this page you can find the example usage for javax.swing JToggleButton isEnabled.

Prototype

public boolean isEnabled() 

Source Link

Document

Determines whether this component is enabled.

Usage

From source file:krasa.formatter.plugin.ProjectSettingsForm.java

private void enabledBy(@NotNull JComponent[] targets, @NotNull JToggleButton... control) {
    boolean b = true;
    for (JToggleButton jToggleButton : control) {
        b = b && (jToggleButton.isEnabled() && jToggleButton.isSelected());
    }//from w  w w .  ja v  a 2 s.c o m
    for (JComponent target : targets) {
        target.setEnabled(b);
    }
}

From source file:krasa.formatter.plugin.ProjectSettingsForm.java

private void enabledByAny(@NotNull JComponent[] targets, @NotNull JToggleButton... control) {
    boolean b = false;
    for (JToggleButton jToggleButton : control) {
        b = b || (jToggleButton.isEnabled() && jToggleButton.isSelected());
    }//ww w  .ja v a2  s  .c om
    for (JComponent target : targets) {
        target.setEnabled(b);
    }
}

From source file:krasa.formatter.plugin.ProjectSettingsForm.java

private void enabledByAny(@NotNull JComponent[] targets, @NotNull JToggleButton[] negated,
        @NotNull JToggleButton... control) {
    boolean b = false;

    for (JToggleButton jToggleButton : control) {
        b = b || (jToggleButton.isEnabled() && jToggleButton.isSelected());
    }/*from  ww  w . j  a  v a2s .  c om*/
    for (JToggleButton jToggleButton : negated) {
        b = b || (jToggleButton.isEnabled() && !jToggleButton.isSelected());
    }

    for (JComponent target : targets) {
        target.setEnabled(b);
    }
}