Skip to content

Commit

Permalink
Update header
Browse files Browse the repository at this point in the history
  • Loading branch information
philippefichet committed Apr 5, 2020
1 parent e7dfa61 commit 4fd8de0
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 109 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,100 +1,100 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package fr.philippefichet.sonarlint.netbeans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;

@OptionsPanelController.SubRegistration(
displayName = "#AdvancedOption_DisplayName_SonarLint",
keywords = "#AdvancedOption_Keywords_SonarLint",
keywordsCategory = "SonarLint"
)
@org.openide.util.NbBundle.Messages({"AdvancedOption_DisplayName_SonarLint=SonarLint", "AdvancedOption_Keywords_SonarLint=sonarlint"})
public final class SonarLintOptionsPanelController extends OptionsPanelController {

private SonarLintPanel panel;
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private boolean changed;

public void update() {
getPanel().load();
changed = false;
}

public void applyChanges() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
getPanel().store();
changed = false;
}
});
}

public void cancel() {
// need not do anything special, if no changes have been persisted yet
}

public boolean isValid() {
return getPanel().valid();
}

public boolean isChanged() {
return changed;
}

public HelpCtx getHelpCtx() {
return null; // new HelpCtx("...ID") if you have a help set
}

public JComponent getComponent(Lookup masterLookup) {
return getPanel();
}

public void addPropertyChangeListener(PropertyChangeListener l) {
pcs.addPropertyChangeListener(l);
}

public void removePropertyChangeListener(PropertyChangeListener l) {
pcs.removePropertyChangeListener(l);
}

private SonarLintPanel getPanel() {
if (panel == null) {
panel = new SonarLintPanel(this);
}
return panel;
}

void changed() {
if (!changed) {
changed = true;
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
}
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}

}
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
package fr.philippefichet.sonarlint.netbeans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;

@OptionsPanelController.SubRegistration(
displayName = "#AdvancedOption_DisplayName_SonarLint",
keywords = "#AdvancedOption_Keywords_SonarLint",
keywordsCategory = "SonarLint"
)
@org.openide.util.NbBundle.Messages({"AdvancedOption_DisplayName_SonarLint=SonarLint", "AdvancedOption_Keywords_SonarLint=sonarlint"})
public final class SonarLintOptionsPanelController extends OptionsPanelController {

private SonarLintPanel panel;
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private boolean changed;

public void update() {
getPanel().load();
changed = false;
}

public void applyChanges() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
getPanel().store();
changed = false;
}
});
}

public void cancel() {
// need not do anything special, if no changes have been persisted yet
}

public boolean isValid() {
return getPanel().valid();
}

public boolean isChanged() {
return changed;
}

public HelpCtx getHelpCtx() {
return null; // new HelpCtx("...ID") if you have a help set
}

public JComponent getComponent(Lookup masterLookup) {
return getPanel();
}

public void addPropertyChangeListener(PropertyChangeListener l) {
pcs.addPropertyChangeListener(l);
}

public void removePropertyChangeListener(PropertyChangeListener l) {
pcs.removePropertyChangeListener(l);
}

private SonarLintPanel getPanel() {
if (panel == null) {
panel = new SonarLintPanel(this);
}
return panel;
}

void changed() {
if (!changed) {
changed = true;
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
}
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* sonarlint4netbeans: SonarLint integration for Apache Netbeans
* Copyright (C) 2019 Philippe FICHET.
* Copyright (C) 2020 Philippe FICHET.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down

0 comments on commit 4fd8de0

Please sign in to comment.