Search in sources :

Example 1 with ComparisonStyle

use of com.kalessil.phpStorm.phpInspectionsEA.settings.ComparisonStyle in project phpinspectionsea by kalessil.

the class EAApplicationConfiguration method createComponent.

@Nullable
@Override
public JComponent createComponent() {
    final EASettings settings = EASettings.getInstance();
    SEND_CRASH_REPORTS = settings.getSendCrashReports();
    final ComparisonStyle comparisonStyle = settings.getComparisonStyle();
    COMPARISON_STYLE_REGULAR = comparisonStyle == ComparisonStyle.REGULAR;
    COMPARISON_STYLE_YODA = comparisonStyle == ComparisonStyle.YODA;
    return OptionsComponent.create(component -> {
        component.addPanel("Anonymous data collect", panelComponent -> panelComponent.addCheckbox("Automatically collect crash-reports", SEND_CRASH_REPORTS, (isSelected) -> SEND_CRASH_REPORTS = isSelected));
        /* comparison style */
        component.addPanel("Comparison code style", panelComponent -> panelComponent.delegateRadioCreation(radioComponent -> {
            radioComponent.addOption("Regular comparison style", COMPARISON_STYLE_REGULAR, (isSelected) -> COMPARISON_STYLE_REGULAR = isSelected);
            radioComponent.addOption("Yoda comparison style", COMPARISON_STYLE_YODA, (isSelected) -> COMPARISON_STYLE_YODA = isSelected);
        }));
    });
}
Also used : Nullable(org.jetbrains.annotations.Nullable) Nls(org.jetbrains.annotations.Nls) NonNls(org.jetbrains.annotations.NonNls) Configurable(com.intellij.openapi.options.Configurable) OptionsComponent(com.kalessil.phpStorm.phpInspectionsEA.options.OptionsComponent) ComparisonStyle(com.kalessil.phpStorm.phpInspectionsEA.settings.ComparisonStyle) javax.swing(javax.swing) ComparisonStyle(com.kalessil.phpStorm.phpInspectionsEA.settings.ComparisonStyle) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with ComparisonStyle

use of com.kalessil.phpStorm.phpInspectionsEA.settings.ComparisonStyle in project phpinspectionsea by kalessil.

the class EAApplicationConfiguration method isModified.

@Override
public boolean isModified() {
    final EASettings settings = EASettings.getInstance();
    final ComparisonStyle comparisonStyle = settings.getComparisonStyle();
    return SEND_CRASH_REPORTS != settings.getSendCrashReports() || COMPARISON_STYLE_YODA != (comparisonStyle == ComparisonStyle.YODA);
}
Also used : ComparisonStyle(com.kalessil.phpStorm.phpInspectionsEA.settings.ComparisonStyle)

Aggregations

ComparisonStyle (com.kalessil.phpStorm.phpInspectionsEA.settings.ComparisonStyle)2 Configurable (com.intellij.openapi.options.Configurable)1 OptionsComponent (com.kalessil.phpStorm.phpInspectionsEA.options.OptionsComponent)1 javax.swing (javax.swing)1 Nls (org.jetbrains.annotations.Nls)1 NonNls (org.jetbrains.annotations.NonNls)1 Nullable (org.jetbrains.annotations.Nullable)1