use of org.sonarlint.intellij.config.global.SonarLintGlobalConfigurable in project sonarlint-intellij by SonarSource.
the class SonarLintProjectConfigurable method reset.
@Override
public void reset() {
if (panel == null) {
return;
}
List<SonarQubeServer> currentServers = null;
// try get the global settings that are currently being configured in the configurable, if it is open
DataContext ctx = DataManager.getInstance().getDataContextFromFocus().getResult();
if (ctx != null) {
Settings allSettings = Settings.KEY.getData(ctx);
if (allSettings != null) {
final SonarLintGlobalConfigurable globalConfigurable = allSettings.find(SonarLintGlobalConfigurable.class);
if (globalConfigurable != null) {
currentServers = globalConfigurable.getCurrentSettings();
}
}
}
// get saved settings if needed
if (currentServers == null) {
currentServers = SonarLintUtils.get(SonarLintGlobalSettings.class).getSonarQubeServers();
}
panel.load(currentServers, projectSettings);
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalConfigurable in project sonarlint-intellij by SonarSource.
the class SonarLintProjectBindPanel method actionConfigureServers.
/**
* Navigates to global configuration. There are 2 possible ways of doing it, depending on how the settings are opened.
*/
private void actionConfigureServers() {
Settings allSettings = Settings.KEY.getData(DataManager.getInstance().getDataContext(rootPanel));
if (allSettings != null) {
final SonarLintGlobalConfigurable globalConfigurable = allSettings.find(SonarLintGlobalConfigurable.class);
if (globalConfigurable != null) {
allSettings.select(globalConfigurable);
}
} else {
SonarLintGlobalConfigurable globalConfigurable = new SonarLintGlobalConfigurable();
ShowSettingsUtil.getInstance().editConfigurable(rootPanel, globalConfigurable);
}
}
Aggregations