From 86f0dd35003305aade8898a8e07bc7eb4aef8ba1 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 6 Sep 2016 14:53:04 +0200 Subject: [PATCH] cleanup --- .../impl/ProjectStructureSelectInTarget.java | 9 +++-- .../ProjectViewSelectInExplorerTarget.java | 6 ++-- .../src/com/intellij/ide/SelectInTarget.java | 14 +++++--- .../com/intellij/ide/SelectInTargetBase.java | 33 ------------------- .../intellij/ide/SimpleSettingsProvider.java | 30 ----------------- .../MvcProjectViewSelectInTarget.java | 24 +++++++------- .../actions/SelectInDefaultBrowserTarget.kt | 4 +-- 7 files changed, 33 insertions(+), 87 deletions(-) delete mode 100644 platform/platform-api/src/com/intellij/ide/SelectInTargetBase.java delete mode 100644 platform/platform-api/src/com/intellij/ide/SimpleSettingsProvider.java diff --git a/java/idea-ui/src/com/intellij/ide/impl/ProjectStructureSelectInTarget.java b/java/idea-ui/src/com/intellij/ide/impl/ProjectStructureSelectInTarget.java index 64719bc65a6d..aaa526a2b2d5 100644 --- a/java/idea-ui/src/com/intellij/ide/impl/ProjectStructureSelectInTarget.java +++ b/java/idea-ui/src/com/intellij/ide/impl/ProjectStructureSelectInTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * 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. @@ -16,7 +16,10 @@ package com.intellij.ide.impl; import com.intellij.facet.*; -import com.intellij.ide.*; +import com.intellij.ide.IdeBundle; +import com.intellij.ide.SelectInContext; +import com.intellij.ide.SelectInTarget; +import com.intellij.ide.StandardTargetWeights; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.module.Module; @@ -41,7 +44,7 @@ import java.util.Iterator; /** * @author nik */ -public class ProjectStructureSelectInTarget extends SelectInTargetBase implements SelectInTarget, DumbAware { +public class ProjectStructureSelectInTarget implements SelectInTarget, DumbAware { @Override public boolean canSelect(final SelectInContext context) { final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex(); diff --git a/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInExplorerTarget.java b/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInExplorerTarget.java index f146e39e7214..1646dc399aff 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInExplorerTarget.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInExplorerTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * 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. @@ -16,7 +16,7 @@ package com.intellij.ide.impl; import com.intellij.ide.SelectInContext; -import com.intellij.ide.SelectInTargetBase; +import com.intellij.ide.SelectInTarget; import com.intellij.ide.StandardTargetWeights; import com.intellij.ide.actions.RevealFileAction; import com.intellij.ide.actions.ShowFilePathAction; @@ -28,7 +28,7 @@ import java.io.File; /** * @author Roman.Chernyatchik */ -public class ProjectViewSelectInExplorerTarget extends SelectInTargetBase implements DumbAware { +public class ProjectViewSelectInExplorerTarget implements DumbAware, SelectInTarget { @Override public boolean canSelect(SelectInContext context) { VirtualFile file = ShowFilePathAction.findLocalFile(context.getVirtualFile()); diff --git a/platform/platform-api/src/com/intellij/ide/SelectInTarget.java b/platform/platform-api/src/com/intellij/ide/SelectInTarget.java index 5b43359ff7eb..0414cec2ac5a 100644 --- a/platform/platform-api/src/com/intellij/ide/SelectInTarget.java +++ b/platform/platform-api/src/com/intellij/ide/SelectInTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * 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. @@ -33,15 +33,21 @@ public interface SelectInTarget { /** Tool window this target is supposed to select in */ @Nullable - String getToolWindowId(); + default String getToolWindowId() { + return null; + } /** aux view id specific for tool window, e.g. Project/Packages/J2EE tab inside project View */ @Nullable - String getMinorViewId(); + default String getMinorViewId() { + return null; + } /** * Weight is used to provide an order in SelectIn popup. Lesser weights come first. * @return weight of this particular target. */ - float getWeight(); + default float getWeight() { + return 0; + } } diff --git a/platform/platform-api/src/com/intellij/ide/SelectInTargetBase.java b/platform/platform-api/src/com/intellij/ide/SelectInTargetBase.java deleted file mode 100644 index 63c57afdc686..000000000000 --- a/platform/platform-api/src/com/intellij/ide/SelectInTargetBase.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2000-2013 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. - */ -package com.intellij.ide; - -public abstract class SelectInTargetBase implements SelectInTarget { - @Override - public String getToolWindowId() { - return null; - } - - @Override - public String getMinorViewId() { - return null; - } - - @Override - public float getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/platform/platform-api/src/com/intellij/ide/SimpleSettingsProvider.java b/platform/platform-api/src/com/intellij/ide/SimpleSettingsProvider.java deleted file mode 100644 index a7d2eb30b047..000000000000 --- a/platform/platform-api/src/com/intellij/ide/SimpleSettingsProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2013 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. - */ -package com.intellij.ide; - -import com.intellij.ide.ui.search.BooleanOptionDescription; -import com.intellij.util.Consumer; - -/** - * @author Konstantin Bulenkov - */ -public interface SimpleSettingsProvider { - - - void addSettings(Consumer collector); - - boolean matches(String pattern, BooleanOptionDescription option); -} diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewSelectInTarget.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewSelectInTarget.java index b725673ae05f..93091318656e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewSelectInTarget.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewSelectInTarget.java @@ -1,23 +1,23 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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 + * 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 + * 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. + * 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. */ package org.jetbrains.plugins.groovy.mvc.projectView; import com.intellij.ide.SelectInContext; -import com.intellij.ide.SelectInTargetBase; +import com.intellij.ide.SelectInTarget; import com.intellij.openapi.module.ModuleUtilCore; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; @@ -28,7 +28,7 @@ import org.jetbrains.plugins.groovy.mvc.MvcFramework; /** * @author Dmitry Krasilschikov */ -public class MvcProjectViewSelectInTarget extends SelectInTargetBase implements DumbAware { +public class MvcProjectViewSelectInTarget implements DumbAware, SelectInTarget { @Override public boolean canSelect(SelectInContext context) { final Project project = context.getProject(); diff --git a/xml/impl/src/com/intellij/ide/browsers/actions/SelectInDefaultBrowserTarget.kt b/xml/impl/src/com/intellij/ide/browsers/actions/SelectInDefaultBrowserTarget.kt index 0c6b9bca759f..d1cbd020b59d 100644 --- a/xml/impl/src/com/intellij/ide/browsers/actions/SelectInDefaultBrowserTarget.kt +++ b/xml/impl/src/com/intellij/ide/browsers/actions/SelectInDefaultBrowserTarget.kt @@ -16,7 +16,7 @@ package com.intellij.ide.browsers.actions import com.intellij.ide.SelectInContext -import com.intellij.ide.SelectInTargetBase +import com.intellij.ide.SelectInTarget import com.intellij.ide.StandardTargetWeights import com.intellij.ide.browsers.createOpenInBrowserRequest import com.intellij.ide.browsers.impl.WebBrowserServiceImpl @@ -29,7 +29,7 @@ import com.intellij.xml.util.HtmlUtil private val LOG = Logger.getInstance(SelectInDefaultBrowserTarget::class.java) -internal class SelectInDefaultBrowserTarget : SelectInTargetBase() { +internal class SelectInDefaultBrowserTarget : SelectInTarget { override fun canSelect(context: SelectInContext): Boolean { val selectorInFile = context.selectorInFile as? PsiElement ?: return false val request = createOpenInBrowserRequest(selectorInFile) ?: return false