From 2308fadfe696ebb213be77f1e971dbaf1b68dd46 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Fri, 13 Apr 2018 12:23:08 +0200 Subject: [PATCH] move getPreferredFocusedComponent to Configurable (since we can use default method implementation now) and reduce usages of BaseConfigurable --- .../settings/ThreadsViewConfigurable.java | 20 +++----------- .../RemoteRepositoriesConfigurable.java | 20 ++------------ .../ProjectStructureConfigurable.java | 19 ++------------ .../JsonSchemaCatalogConfigurable.java | 4 +-- .../options/CodeCompletionOptions.java | 20 ++------------ .../config/IntentionSettingsConfigurable.java | 20 ++------------ .../impl/LiveTemplatesConfigurable.java | 20 ++------------ .../execution/impl/RunConfigurable.kt | 11 +++++--- .../todo/configurable/TodoConfigurable.java | 19 ++------------ .../fileTypes/impl/FileTypeConfigurable.java | 23 +++++----------- .../ui/DependencyConfigurable.java | 21 +++------------ .../header/InspectionToolsConfigurable.java | 21 ++------------- .../openapi/options/BaseConfigurable.java | 22 ++-------------- .../openapi/options/Configurable.java | 24 +++++++---------- .../ide/plugins/PluginHostsConfigurable.java | 3 +-- .../plugins/PluginManagerConfigurable.java | 19 ++------------ .../plugins/PluginManagerConfigurableNew.java | 9 ++++--- .../ide/ui/AppearanceConfigurable.java | 19 ++------------ .../CustomizationConfigurable.java | 19 ++------------ .../options/ex/SingleConfigurableEditor.java | 8 ++---- .../options/newEditor/ConfigurableEditor.java | 24 +++-------------- .../impl/UpdateSettingsConfigurable.java | 3 +-- .../cvsSupport2/UpdateConfigurable.java | 26 ++++++------------- .../settings/GradleRunnerConfigurable.java | 21 +++------------ .../MavenRepositoriesConfigurable.java | 19 ++------------ .../project/MavenTestRunningConfigurable.java | 20 ++------------ .../config/TaskRepositoriesConfigurable.java | 7 +++-- .../javaee/ExternalResourceConfigurable.java | 3 +-- .../javaee/XMLCatalogConfigurable.java | 21 +++------------ 29 files changed, 87 insertions(+), 398 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/ThreadsViewConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/ThreadsViewConfigurable.java index fd6acf982de9..dcc0e7d93b4b 100644 --- a/java/debugger/impl/src/com/intellij/debugger/settings/ThreadsViewConfigurable.java +++ b/java/debugger/impl/src/com/intellij/debugger/settings/ThreadsViewConfigurable.java @@ -1,24 +1,10 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.debugger.settings; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.DebuggerManagerEx; import com.intellij.debugger.impl.DebuggerSession; -import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.xdebugger.impl.XDebuggerUtilImpl; @@ -28,7 +14,7 @@ import javax.swing.*; /** * @author Eugene Belyaev */ -public class ThreadsViewConfigurable extends BaseConfigurable { +public class ThreadsViewConfigurable implements Configurable { private final ThreadsViewSettings mySettings; private JPanel myPanel; private JCheckBox myShowGroupsCheckBox; diff --git a/java/idea-ui/src/com/intellij/jarRepository/settings/RemoteRepositoriesConfigurable.java b/java/idea-ui/src/com/intellij/jarRepository/settings/RemoteRepositoriesConfigurable.java index 11652ec7d3c5..f2771ce32517 100644 --- a/java/idea-ui/src/com/intellij/jarRepository/settings/RemoteRepositoriesConfigurable.java +++ b/java/idea-ui/src/com/intellij/jarRepository/settings/RemoteRepositoriesConfigurable.java @@ -1,25 +1,10 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.jarRepository.settings; import com.intellij.jarRepository.JarRepositoryManager; import com.intellij.jarRepository.RemoteRepositoriesConfiguration; import com.intellij.jarRepository.RemoteRepositoryDescription; import com.intellij.jarRepository.services.MavenRepositoryServicesManager; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -42,8 +27,7 @@ import java.util.Collections; import java.util.List; import java.util.UUID; -public class RemoteRepositoriesConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { - +public class RemoteRepositoriesConfigurable implements SearchableConfigurable, Configurable.NoScroll { private JPanel myMainPanel; private JBList myServiceList; diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java index fade3c4d9689..bc78be557e32 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.roots.ui.configuration; import com.intellij.compiler.server.BuildManager; @@ -25,7 +11,6 @@ import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -69,7 +54,7 @@ import java.util.List; import static com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurableFilter.ConfigurableId; -public class ProjectStructureConfigurable extends BaseConfigurable implements SearchableConfigurable, Place.Navigator, +public class ProjectStructureConfigurable implements SearchableConfigurable, Place.Navigator, Configurable.NoMargin, Configurable.NoScroll { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable"); diff --git a/json/src/com/jetbrains/jsonSchema/JsonSchemaCatalogConfigurable.java b/json/src/com/jetbrains/jsonSchema/JsonSchemaCatalogConfigurable.java index 166f95a08100..fcf07d859395 100644 --- a/json/src/com/jetbrains/jsonSchema/JsonSchemaCatalogConfigurable.java +++ b/json/src/com/jetbrains/jsonSchema/JsonSchemaCatalogConfigurable.java @@ -1,7 +1,7 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.jsonSchema; -import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.ui.TitledSeparator; @@ -16,7 +16,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; -public class JsonSchemaCatalogConfigurable extends BaseConfigurable { +public class JsonSchemaCatalogConfigurable implements Configurable { @NonNls public static final String SETTINGS_JSON_SCHEMA_CATALOG = "settings.json.schema.catalog"; public static final String JSON_SCHEMA_CATALOG = "JSON Schema Catalog"; @NotNull private final Project myProject; diff --git a/platform/lang-impl/src/com/intellij/application/options/CodeCompletionOptions.java b/platform/lang-impl/src/com/intellij/application/options/CodeCompletionOptions.java index 115127e37e38..8ce9ac6e0110 100644 --- a/platform/lang-impl/src/com/intellij/application/options/CodeCompletionOptions.java +++ b/platform/lang-impl/src/com/intellij/application/options/CodeCompletionOptions.java @@ -1,30 +1,14 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.application.options; import com.intellij.application.options.editor.EditorOptionsProvider; import com.intellij.openapi.application.ApplicationBundle; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.SearchableConfigurable; import org.jetbrains.annotations.NotNull; import javax.swing.*; -public class CodeCompletionOptions extends BaseConfigurable implements SearchableConfigurable, EditorOptionsProvider { +public class CodeCompletionOptions implements SearchableConfigurable, EditorOptionsProvider { private CodeCompletionPanel myPanel; @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsConfigurable.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsConfigurable.java index a8f808eb7bec..240c537e2864 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsConfigurable.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsConfigurable.java @@ -1,23 +1,7 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.intention.impl.config; import com.intellij.codeInsight.CodeInsightBundle; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.MasterDetails; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.ui.DetailsComponent; @@ -27,7 +11,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; -public class IntentionSettingsConfigurable extends BaseConfigurable implements SearchableConfigurable, MasterDetails, IntentionsConfigurable { +public class IntentionSettingsConfigurable implements SearchableConfigurable, MasterDetails, IntentionsConfigurable { private IntentionSettingsPanel myPanel; @NonNls public static final String HELP_ID = "preferences.intentionPowerPack"; public static final String DISPLAY_NAME = CodeInsightBundle.message("intention.settings"); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplatesConfigurable.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplatesConfigurable.java index 663e1477c29a..323c63ec8296 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplatesConfigurable.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplatesConfigurable.java @@ -1,23 +1,7 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.template.impl; import com.intellij.codeInsight.CodeInsightBundle; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -27,7 +11,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; -public class LiveTemplatesConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { +public class LiveTemplatesConfigurable implements SearchableConfigurable, Configurable.NoScroll { static final String ID = "editing.templates"; private TemplateListPanel myPanel; diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt index be710e3ee569..2725ec7d9762 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt @@ -13,7 +13,10 @@ import com.intellij.openapi.actionSystem.* import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.extensions.Extensions -import com.intellij.openapi.options.* +import com.intellij.openapi.options.Configurable +import com.intellij.openapi.options.ConfigurationException +import com.intellij.openapi.options.SettingsEditorConfigurable +import com.intellij.openapi.options.UnnamedConfigurable import com.intellij.openapi.project.Project import com.intellij.openapi.ui.LabeledComponent.create import com.intellij.openapi.ui.Messages @@ -66,7 +69,7 @@ private fun getName(userObject: Any): String { } } -open class RunConfigurable @JvmOverloads constructor(private val myProject: Project, var runDialog: RunDialogBase? = null) : BaseConfigurable(), Disposable { +open class RunConfigurable @JvmOverloads constructor(private val myProject: Project, var runDialog: RunDialogBase? = null) : Configurable, Disposable { @Volatile private var isDisposed: Boolean = false val root = DefaultMutableTreeNode("Root") val treeModel = MyTreeModel(root) @@ -84,6 +87,8 @@ open class RunConfigurable @JvmOverloads constructor(private val myProject: Proj private val toolbarAddAction = MyToolbarAddAction() private val runDashboardTypesPanel = RunDashboardTypesPanel(myProject) + private var isModified = false + companion object { fun collectNodesRecursively(parentNode: DefaultMutableTreeNode, nodes: MutableList, @@ -747,7 +752,7 @@ open class RunConfigurable @JvmOverloads constructor(private val myProject: Proj } override fun isModified(): Boolean { - if (super.isModified()) { + if (isModified) { return true } diff --git a/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java b/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java index 8ed094e280b1..42ef155512f6 100644 --- a/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java +++ b/platform/lang-impl/src/com/intellij/ide/todo/configurable/TodoConfigurable.java @@ -1,25 +1,10 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.todo.configurable; import com.intellij.ide.IdeBundle; import com.intellij.ide.todo.TodoConfiguration; import com.intellij.ide.todo.TodoFilter; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -46,7 +31,7 @@ import java.util.List; /** * @author Vladimir Kondratyev */ -public class TodoConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { +public class TodoConfigurable implements SearchableConfigurable, Configurable.NoScroll { /* * UI resources */ diff --git a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java index 80a25dd650c5..2e2b8ede6eae 100644 --- a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java +++ b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.fileTypes.impl; @@ -22,7 +8,10 @@ import com.intellij.lang.Language; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.fileTypes.*; -import com.intellij.openapi.options.*; +import com.intellij.openapi.options.Configurable; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.options.SearchableConfigurable; +import com.intellij.openapi.options.SettingsEditor; import com.intellij.openapi.ui.DialogBuilder; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.openapi.ui.Messages; @@ -51,7 +40,7 @@ import static com.intellij.openapi.util.Pair.pair; /** * @author Eugene Belyaev */ -public class FileTypeConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { +public class FileTypeConfigurable implements SearchableConfigurable, Configurable.NoScroll { private RecognizedFileTypes myRecognizedFileType; private PatternsPanel myPatterns; private FileTypePanel myFileTypePanel; diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependencyConfigurable.java b/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependencyConfigurable.java index 260889828f02..4fde64c13c8e 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependencyConfigurable.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependencyConfigurable.java @@ -1,26 +1,11 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.packageDependencies.ui; import com.intellij.analysis.AnalysisScopeBundle; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.ide.util.scopeChooser.PackageSetChooserCombo; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.packageDependencies.DependencyRule; @@ -42,7 +27,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -public class DependencyConfigurable extends BaseConfigurable { +public class DependencyConfigurable implements Configurable { private final Project myProject; private MyTableModel myDenyRulesModel; private MyTableModel myAllowRulesModel; diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java index 56e189afb347..f86a506d045e 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/header/InspectionToolsConfigurable.java @@ -1,25 +1,9 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.profile.codeInspection.ui.header; import com.intellij.codeInspection.ex.InspectionProfileImpl; import com.intellij.codeInspection.ex.InspectionProfileModifiableModel; import com.intellij.codeInspection.ex.InspectionToolWrapper; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; @@ -38,8 +22,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; import java.awt.*; -public abstract class InspectionToolsConfigurable extends BaseConfigurable - implements ErrorsConfigurable, SearchableConfigurable, Configurable.NoScroll { +public abstract class InspectionToolsConfigurable implements ErrorsConfigurable, SearchableConfigurable, Configurable.NoScroll { public static final String ID = "Errors"; public static final String DISPLAY_NAME = "Inspections"; diff --git a/platform/platform-api/src/com/intellij/openapi/options/BaseConfigurable.java b/platform/platform-api/src/com/intellij/openapi/options/BaseConfigurable.java index f101518dc1a3..7d7db9b0cd9e 100644 --- a/platform/platform-api/src/com/intellij/openapi/options/BaseConfigurable.java +++ b/platform/platform-api/src/com/intellij/openapi/options/BaseConfigurable.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.options; import javax.swing.*; - public abstract class BaseConfigurable implements Configurable { protected boolean myModified; @@ -29,10 +14,7 @@ public abstract class BaseConfigurable implements Configurable { myModified = modified; } - /** - * @return component which should be focused when the dialog appears - * on the screen. - */ + // defined here for backward-compatibility public JComponent getPreferredFocusedComponent() { return null; } diff --git a/platform/platform-api/src/com/intellij/openapi/options/Configurable.java b/platform/platform-api/src/com/intellij/openapi/options/Configurable.java index cfefce45e3d5..357e04ba710f 100644 --- a/platform/platform-api/src/com/intellij/openapi/options/Configurable.java +++ b/platform/platform-api/src/com/intellij/openapi/options/Configurable.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.options; import com.intellij.ide.ui.UINumericRange; @@ -223,6 +209,14 @@ public interface Configurable extends UnnamedConfigurable { return !Comparing.equal(comboBox.getSelectedItem(), value); } + /** + * @return component which should be focused when the dialog appears + * on the screen. + */ + default JComponent getPreferredFocusedComponent() { + return null; + } + interface TopComponentController { void setLeftComponent(@Nullable Component component); diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginHostsConfigurable.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginHostsConfigurable.java index 7aa957a3530a..a896e4eb6399 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginHostsConfigurable.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginHostsConfigurable.java @@ -2,7 +2,6 @@ package com.intellij.ide.plugins; import com.intellij.ide.IdeBundle; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.progress.ProgressIndicator; @@ -31,7 +30,7 @@ import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; -public class PluginHostsConfigurable extends BaseConfigurable implements Configurable.NoScroll { +public class PluginHostsConfigurable implements Configurable.NoScroll, Configurable { private CustomPluginRepositoriesPanel myUpdatesSettingsPanel; @Override diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java index bfcaf994d909..f0298cd4ae86 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.plugins; import com.intellij.ide.IdeBundle; @@ -20,7 +6,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.application.ex.ApplicationManagerEx; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -35,7 +20,7 @@ import javax.swing.*; import javax.swing.table.TableModel; import java.util.List; -public class PluginManagerConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { +public class PluginManagerConfigurable implements SearchableConfigurable, Configurable.NoScroll { public static final String ID = "preferences.pluginManager"; public static final String DISPLAY_NAME = IdeBundle.message("title.plugins"); diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurableNew.java b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurableNew.java index 1e3a7929cbcb..089b330edec9 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurableNew.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurableNew.java @@ -13,7 +13,10 @@ import com.intellij.openapi.application.ex.ApplicationInfoEx; import com.intellij.openapi.application.impl.ApplicationImpl; import com.intellij.openapi.extensions.PluginDescriptor; import com.intellij.openapi.extensions.PluginId; -import com.intellij.openapi.options.*; +import com.intellij.openapi.options.Configurable; +import com.intellij.openapi.options.ConfigurationException; +import com.intellij.openapi.options.OptionalConfigurable; +import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.options.newEditor.SettingsDialog; import com.intellij.openapi.project.DumbAwareAction; import com.intellij.openapi.ui.DialogWrapper; @@ -66,9 +69,7 @@ import static com.intellij.ide.plugins.PluginManagerCore.getPlugins; /** * @author Alexander Lobas */ -public class PluginManagerConfigurableNew extends BaseConfigurable - implements SearchableConfigurable, Configurable.NoScroll, Configurable.NoMargin, Configurable.TopComponentProvider, - OptionalConfigurable { +public class PluginManagerConfigurableNew implements SearchableConfigurable, Configurable.NoScroll, Configurable.NoMargin, Configurable.TopComponentProvider, OptionalConfigurable { public static final String ID = "preferences.pluginManager2"; private static final String SELECTION_TAB_KEY = "PluginConfigurable.selectionTab"; diff --git a/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java b/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java index 4d4db07d7053..2044f7d1584f 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.ui; import com.intellij.ide.IdeBundle; @@ -27,7 +13,6 @@ import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.colors.ex.DefaultColorSchemesManager; import com.intellij.openapi.editor.colors.impl.EditorColorsManagerImpl; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.ui.ComboBox; @@ -50,7 +35,7 @@ import java.util.Hashtable; /** * @author Eugene Belyaev */ -public class AppearanceConfigurable extends BaseConfigurable implements SearchableConfigurable { +public class AppearanceConfigurable implements SearchableConfigurable { private static final Logger LOG = Logger.getInstance("#com.intellij.ide.ui.AppearanceConfigurable"); private MyComponent myComponent; diff --git a/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizationConfigurable.java b/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizationConfigurable.java index d9a3dce08829..d5f686e393f5 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizationConfigurable.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizationConfigurable.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.ui.customization; import com.intellij.ide.IdeBundle; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -24,7 +9,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; -public class CustomizationConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { +public class CustomizationConfigurable implements SearchableConfigurable, Configurable.NoScroll { private CustomizableActionsPanel myPanel; public JComponent createComponent() { diff --git a/platform/platform-impl/src/com/intellij/openapi/options/ex/SingleConfigurableEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/ex/SingleConfigurableEditor.java index f78b75d2c3a6..fd09bc97792f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/ex/SingleConfigurableEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/ex/SingleConfigurableEditor.java @@ -7,7 +7,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.help.HelpManager; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.OptionsBundle; @@ -248,11 +247,8 @@ public class SingleConfigurableEditor extends DialogWrapper { @Override public JComponent getPreferredFocusedComponent() { - if (myConfigurable instanceof BaseConfigurable) { - JComponent preferred = ((BaseConfigurable)myConfigurable).getPreferredFocusedComponent(); - if (preferred != null) return preferred; - } - return IdeFocusTraversalPolicy.getPreferredFocusedComponent(myCenterPanel); + JComponent preferred = myConfigurable.getPreferredFocusedComponent(); + return preferred == null ? IdeFocusTraversalPolicy.getPreferredFocusedComponent(myCenterPanel) : preferred; } @Override diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java index eb02515cfcaa..6c0babad472b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/ConfigurableEditor.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.options.newEditor; import com.intellij.CommonBundle; @@ -25,7 +11,6 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.actionSystem.ex.AnActionListener; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.ShowSettingsUtil; @@ -171,11 +156,8 @@ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWT @Override public JComponent getPreferredFocusedComponent() { - if (myConfigurable instanceof BaseConfigurable) { - JComponent preferred = ((BaseConfigurable)myConfigurable).getPreferredFocusedComponent(); - if (preferred != null) return preferred; - } - return UIUtil.getPreferredFocusedComponent(getContent(myConfigurable)); + JComponent preferred = myConfigurable.getPreferredFocusedComponent(); + return preferred == null ? UIUtil.getPreferredFocusedComponent(getContent(myConfigurable)) : preferred; } @Override diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java index 50ad897928ca..d22aabf36092 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java @@ -10,7 +10,6 @@ import com.intellij.openapi.application.ApplicationInfo; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationNamesInfo; import com.intellij.openapi.application.ex.ApplicationInfoEx; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; @@ -32,7 +31,7 @@ import java.util.List; /** * @author pti */ -public class UpdateSettingsConfigurable extends BaseConfigurable implements SearchableConfigurable { +public class UpdateSettingsConfigurable implements SearchableConfigurable { private final UpdateSettings mySettings; private final boolean myCheckNowEnabled; private UpdatesSettingsPanel myPanel; diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/UpdateConfigurable.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/UpdateConfigurable.java index da6872affe4f..ad8d547047f2 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/UpdateConfigurable.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/UpdateConfigurable.java @@ -1,23 +1,9 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.cvsSupport2; import com.intellij.CvsBundle; import com.intellij.cvsSupport2.cvsoperations.cvsUpdate.ui.UpdateOptionsPanel; -import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.FilePath; @@ -25,7 +11,7 @@ import com.intellij.openapi.vcs.FilePath; import javax.swing.*; import java.util.Collection; -public class UpdateConfigurable extends BaseConfigurable { +public class UpdateConfigurable implements Configurable { private UpdateOptionsPanel myPanel; private final Project myProject; private final Collection myFiles; @@ -35,7 +21,6 @@ public class UpdateConfigurable extends BaseConfigurable { myFiles = files; } - public String getDisplayName() { return CvsBundle.getCvsDisplayName(); } @@ -50,6 +35,11 @@ public class UpdateConfigurable extends BaseConfigurable { return myPanel.getPanel(); } + @Override + public boolean isModified() { + return false; + } + public void apply() throws ConfigurationException { myPanel.apply(); } diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleRunnerConfigurable.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleRunnerConfigurable.java index 6c24f3fb5db7..3b652f0da557 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleRunnerConfigurable.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleRunnerConfigurable.java @@ -1,21 +1,7 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.gradle.settings; -import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.ui.ComboBox; import com.intellij.ui.components.JBCheckBox; @@ -30,8 +16,7 @@ import java.util.Objects; * @author Vladislav.Soroka * @since 11/2/2015 */ -public class GradleRunnerConfigurable extends BaseConfigurable { - +public class GradleRunnerConfigurable implements Configurable { private JPanel myMainPanel; private JBCheckBox myGradleAwareMakeCheckBox; private ComboBox myPreferredTestRunner; diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java index 0662cd4a9c06..5d4071fcde4e 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/indices/MavenRepositoriesConfigurable.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.maven.indices; import com.intellij.icons.AllIcons; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -43,7 +28,7 @@ import java.awt.event.MouseMotionListener; import java.util.ArrayList; import java.util.List; -public class MavenRepositoriesConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { +public class MavenRepositoriesConfigurable implements SearchableConfigurable, Configurable.NoScroll { private final MavenProjectIndicesManager myManager; private JPanel myMainPanel; diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenTestRunningConfigurable.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenTestRunningConfigurable.java index f2aa5fb2002d..98d517326e39 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenTestRunningConfigurable.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenTestRunningConfigurable.java @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.maven.project; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -30,8 +15,7 @@ import javax.swing.*; /** * @author Sergey Evdokimov */ -public class MavenTestRunningConfigurable extends BaseConfigurable implements SearchableConfigurable, Configurable.NoScroll { - +public class MavenTestRunningConfigurable implements SearchableConfigurable, Configurable.NoScroll { private JPanel myMainPanel; private JBCheckBox myPassArgLineCB; diff --git a/plugins/tasks/tasks-core/src/com/intellij/tasks/config/TaskRepositoriesConfigurable.java b/plugins/tasks/tasks-core/src/com/intellij/tasks/config/TaskRepositoriesConfigurable.java index 7a0e829b068e..9bf32ff9a29b 100644 --- a/plugins/tasks/tasks-core/src/com/intellij/tasks/config/TaskRepositoriesConfigurable.java +++ b/plugins/tasks/tasks-core/src/com/intellij/tasks/config/TaskRepositoriesConfigurable.java @@ -1,3 +1,4 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.tasks.config; import com.intellij.ide.DataManager; @@ -5,9 +6,7 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.actionSystem.Separator; -import com.intellij.openapi.options.BaseConfigurable; import com.intellij.openapi.options.Configurable; -import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; @@ -41,7 +40,7 @@ import java.util.List; * @author Dmitry Avdeev */ @SuppressWarnings("unchecked") -public class TaskRepositoriesConfigurable extends BaseConfigurable implements Configurable.NoScroll, SearchableConfigurable { +public class TaskRepositoriesConfigurable implements Configurable.NoScroll, SearchableConfigurable { public static final String ID = "tasks.servers"; private static final String EMPTY_PANEL = "empty.panel"; @@ -217,7 +216,7 @@ public class TaskRepositoriesConfigurable extends BaseConfigurable implements Co return !myRepositories.equals(getReps()); } - public void apply() throws ConfigurationException { + public void apply() { List newRepositories = ContainerUtil.map(myRepositories, taskRepository -> taskRepository.clone()); myManager.setRepositories(newRepositories); myManager.updateIssues(null); diff --git a/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java b/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java index e046a4d316dd..7b73f829f48b 100644 --- a/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java +++ b/xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java @@ -27,8 +27,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class ExternalResourceConfigurable extends BaseConfigurable - implements Configurable.NoScroll { +public class ExternalResourceConfigurable extends BaseConfigurable implements Configurable.NoScroll { private JPanel myPanel; private List myPairs; private List myIgnoredUrls; diff --git a/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java b/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java index 0459980c257e..b21fbe8b99d8 100644 --- a/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java +++ b/xml/impl/src/com/intellij/javaee/XMLCatalogConfigurable.java @@ -1,22 +1,8 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.javaee; import com.intellij.openapi.fileChooser.FileChooserDescriptor; -import com.intellij.openapi.options.BaseConfigurable; +import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.ui.TextFieldWithBrowseButton; import com.intellij.openapi.util.text.StringUtil; @@ -27,8 +13,7 @@ import javax.swing.*; /** * @author Dmitry Avdeev */ -public class XMLCatalogConfigurable extends BaseConfigurable { - +public class XMLCatalogConfigurable implements Configurable { private TextFieldWithBrowseButton myPropertyFile; private JPanel myPanel;