From df1f55a499d239623c76c5310f6ff0f93f7ce1b9 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Mon, 17 Apr 2023 15:53:28 +0200 Subject: [PATCH] IJPL-7 make methods of `Navigatable` default They should not be required to be implemented, only `Navigatable.navigationRequest` is. GitOrigin-RevId: b038cb465de3b9f1d6c37f8578ecd69f8667a10b --- .../intellij/navigation/EmptyNavigatable.java | 18 +------ .../src/com/intellij/pom/Navigatable.java | 16 +++++-- .../ide/util/treeView/AbstractTreeNode.java | 16 +------ .../find/actions/SearchTarget2UsageTarget.kt | 5 +- .../intellij/find/impl/FindInProjectUtil.java | 15 ------ .../ide/bookmark/providers/InvalidBookmark.kt | 8 +--- .../rename/impl/RenameTarget2UsageTarget.kt | 5 +- .../refactoring/ui/ConflictsDialog.java | 19 ++------ .../src/com/intellij/pom/NonNavigatable.java | 30 +----------- .../intellij/structureView/TestTreeModel.java | 30 +----------- .../usages/impl/UsageNodeTreeBuilderTest.java | 47 +------------------ .../ui/StructuralSearchUsageTarget.java | 17 +------ .../impl/StructureViewComposite.java | 5 +- .../usages/impl/rules/UsageGroupBase.java | 16 +------ .../impl/rules/UsageScopeGroupingRule.java | 12 +---- .../impl/rules/UsageTypeGroupingRule.java | 12 +---- .../intellij/usages/impl/UsageAdapter.java | 31 +----------- .../breakpoints/ui/BreakpointNoneItem.java | 30 +----------- .../ExtensionPointUsageAnalyzer.kt | 9 +--- ...esourceBundleFileStructureViewElement.java | 17 +------ .../plugins/xpathView/XPathEvalAction.java | 14 ------ .../impl/AbstractDomChildDescriptionImpl.java | 16 +------ .../xml/impl/dom/DomElementXmlDescriptor.java | 16 +------ 23 files changed, 38 insertions(+), 366 deletions(-) diff --git a/platform/core-api/src/com/intellij/navigation/EmptyNavigatable.java b/platform/core-api/src/com/intellij/navigation/EmptyNavigatable.java index 692e687d5997..211af3ca5098 100644 --- a/platform/core-api/src/com/intellij/navigation/EmptyNavigatable.java +++ b/platform/core-api/src/com/intellij/navigation/EmptyNavigatable.java @@ -1,27 +1,11 @@ -// Copyright 2000-2019 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.navigation; import com.intellij.pom.Navigatable; -import com.intellij.util.IncorrectOperationException; public final class EmptyNavigatable implements Navigatable { public static final Navigatable INSTANCE = new EmptyNavigatable(); private EmptyNavigatable() {} - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - - @Override - public void navigate(boolean requestFocus) { - throw new IncorrectOperationException("Must not call #navigate() if #canNavigate() returns 'false'"); - } } diff --git a/platform/core-api/src/com/intellij/pom/Navigatable.java b/platform/core-api/src/com/intellij/pom/Navigatable.java index d5061d2dd238..d00d10239189 100644 --- a/platform/core-api/src/com/intellij/pom/Navigatable.java +++ b/platform/core-api/src/com/intellij/pom/Navigatable.java @@ -3,6 +3,7 @@ package com.intellij.pom; import com.intellij.platform.backend.navigation.NavigationRequest; import com.intellij.platform.backend.navigation.NavigationRequests; +import com.intellij.util.IncorrectOperationException; import com.intellij.util.concurrency.annotations.RequiresBackgroundThread; import com.intellij.util.concurrency.annotations.RequiresReadLock; import org.jetbrains.annotations.ApiStatus.Experimental; @@ -38,7 +39,12 @@ public interface Navigatable { * * @param requestFocus {@code true} if focus requesting is necessary */ - void navigate(boolean requestFocus); + default void navigate(boolean requestFocus) { + throw new IncorrectOperationException( + "Must not call `navigate(boolean)` if `canNavigate()` returns `false`, " + + "or `navigate(boolean)` should be overridden if `canNavigate()` can return `true`." + ); + } /** * Indicates whether this instance supports navigation of any kind. @@ -50,7 +56,9 @@ public interface Navigatable { * * @return {@code false} if navigation is not possible for any reason. */ - boolean canNavigate(); + default boolean canNavigate() { + return false; + } /** * Indicates whether this instance supports navigation to source (that means some kind of editor). @@ -62,5 +70,7 @@ public interface Navigatable { * * @return {@code false} if navigation to source is not possible for any reason. */ - boolean canNavigateToSource(); + default boolean canNavigateToSource() { + return false; + } } diff --git a/platform/editor-ui-api/src/com/intellij/ide/util/treeView/AbstractTreeNode.java b/platform/editor-ui-api/src/com/intellij/ide/util/treeView/AbstractTreeNode.java index 4ba2cbab9a23..a2723a4e19a0 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/util/treeView/AbstractTreeNode.java +++ b/platform/editor-ui-api/src/com/intellij/ide/util/treeView/AbstractTreeNode.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.util.treeView; import com.intellij.ide.projectView.PresentationData; @@ -255,20 +255,6 @@ public abstract class AbstractTreeNode extends PresentableNodeDescriptor parent = getParent(); diff --git a/platform/lang-impl/src/com/intellij/find/actions/SearchTarget2UsageTarget.kt b/platform/lang-impl/src/com/intellij/find/actions/SearchTarget2UsageTarget.kt index a155feb84a85..a34ad07e003a 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/SearchTarget2UsageTarget.kt +++ b/platform/lang-impl/src/com/intellij/find/actions/SearchTarget2UsageTarget.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.find.actions @@ -56,10 +56,7 @@ class SearchTarget2UsageTarget( // ----- Navigatable & NavigationItem ----- // TODO Symbol navigation - override fun canNavigate(): Boolean = false - override fun canNavigateToSource(): Boolean = false override fun getName(): String? = null - override fun navigate(requestFocus: Boolean) = Unit // ----- actions ----- diff --git a/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java b/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java index 46f4e12cf781..0c5d1b14f294 100644 --- a/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java +++ b/platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java @@ -515,21 +515,6 @@ public final class FindInProjectUtil { return this; } - @Override - public void navigate(boolean requestFocus) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public void showSettings() { Content selectedContent = UsageViewContentManager.getInstance(myProject).getSelectedContent(true); diff --git a/platform/lang-impl/src/com/intellij/ide/bookmark/providers/InvalidBookmark.kt b/platform/lang-impl/src/com/intellij/ide/bookmark/providers/InvalidBookmark.kt index d4f700c3b106..9e23270d0dfc 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmark/providers/InvalidBookmark.kt +++ b/platform/lang-impl/src/com/intellij/ide/bookmark/providers/InvalidBookmark.kt @@ -1,8 +1,8 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.bookmark.providers import com.intellij.ide.bookmark.Bookmark -import java.util.Objects +import java.util.* internal class InvalidBookmark(override val provider: LineBookmarkProvider, val url: String, val line: Int) : Bookmark { @@ -11,10 +11,6 @@ internal class InvalidBookmark(override val provider: LineBookmarkProvider, val override fun createNode() = UrlNode(provider.project, this) - override fun canNavigate() = false - override fun canNavigateToSource() = false - override fun navigate(requestFocus: Boolean) = Unit - override fun hashCode() = Objects.hash(provider, url, line) override fun equals(other: Any?) = other === this || other is InvalidBookmark && other.provider == provider diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/impl/RenameTarget2UsageTarget.kt b/platform/lang-impl/src/com/intellij/refactoring/rename/impl/RenameTarget2UsageTarget.kt index 61054084ece4..37c851fd7ed8 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/impl/RenameTarget2UsageTarget.kt +++ b/platform/lang-impl/src/com/intellij/refactoring/rename/impl/RenameTarget2UsageTarget.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.refactoring.rename.impl import com.intellij.model.Pointer @@ -52,9 +52,6 @@ internal class RenameTarget2UsageTarget( // ----- Navigatable & NavigationItem ----- override fun getName(): String? = null - override fun canNavigate(): Boolean = false - override fun canNavigateToSource(): Boolean = false - override fun navigate(requestFocus: Boolean): Unit = Unit // ----- actions ----- diff --git a/platform/lang-impl/src/com/intellij/refactoring/ui/ConflictsDialog.java b/platform/lang-impl/src/com/intellij/refactoring/ui/ConflictsDialog.java index d88a8567cd23..a0ca35f06a84 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/ui/ConflictsDialog.java +++ b/platform/lang-impl/src/com/intellij/refactoring/ui/ConflictsDialog.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.refactoring.ui; @@ -21,7 +21,10 @@ import com.intellij.util.ArrayUtilRt; import com.intellij.util.containers.MultiMap; import com.intellij.util.ui.HTMLEditorKitBuilder; import com.intellij.util.ui.JBUI; -import org.jetbrains.annotations.*; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import javax.swing.event.HyperlinkEvent; @@ -270,18 +273,6 @@ public class ConflictsDialog extends DialogWrapper implements ConflictsDialogBas }; } - @Override - public boolean canNavigateToSource() { - return false; - } - - @Override - public boolean canNavigate() { - return false; - } - @Override - public void navigate(boolean requestFocus) {} - @Override public FileEditorLocation getLocation() { return null; diff --git a/platform/platform-api/src/com/intellij/pom/NonNavigatable.java b/platform/platform-api/src/com/intellij/pom/NonNavigatable.java index ea903ed596bf..d53b7304f1e5 100644 --- a/platform/platform-api/src/com/intellij/pom/NonNavigatable.java +++ b/platform/platform-api/src/com/intellij/pom/NonNavigatable.java @@ -1,18 +1,4 @@ -/* - * 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-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.pom; /** @@ -24,18 +10,4 @@ public final class NonNavigatable implements Navigatable { private NonNavigatable() { } - - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } } diff --git a/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java b/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java index 4445ce3f3253..ddf0c61ffa12 100644 --- a/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.java +++ b/platform/platform-tests/testSrc/com/intellij/structureView/TestTreeModel.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-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.structureView; import com.intellij.ide.projectView.PresentationData; @@ -105,20 +91,6 @@ public class TestTreeModel implements StructureViewModel{ public String getValue() { return myValue; } - - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } } @Override diff --git a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java index b241af8e9183..6afd01cd8ed4 100644 --- a/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java +++ b/platform/platform-tests/testSrc/com/intellij/usages/impl/UsageNodeTreeBuilderTest.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.usages.impl; import com.intellij.openapi.Disposable; @@ -152,17 +152,6 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { return o instanceof LogUsageGroup && myPower == ((LogUsageGroup)o).myPower; } public int hashCode() { return myPower; } - - @Override - public void navigate(boolean requestFocus) { } - - @Override - public boolean canNavigate() { return false; } - - @Override - public boolean canNavigateToSource() { - return false; - } } private static class OddEvenGroupingRule extends SingleParentUsageGroupingRule { @@ -172,16 +161,6 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { @NotNull public String getPresentableGroupText() { return "Even"; } - @Override - public void navigate(boolean focus) throws UnsupportedOperationException { } - @Override - public boolean canNavigate() { return false; } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public int compareTo(@NotNull UsageGroup o) { return o == ODD ? -1 : 0; } public String toString() { return getPresentableGroupText(); } @@ -193,16 +172,6 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { @NotNull public String getPresentableGroupText() { return "Odd"; } - @Override - public void navigate(boolean focus) throws UnsupportedOperationException { } - @Override - public boolean canNavigate() { return false; } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public int compareTo(@NotNull UsageGroup o) { return o == EVEN ? 1 : 0; } @Override @@ -280,20 +249,6 @@ public class UsageNodeTreeBuilderTest extends LightPlatformTestCase { return String.valueOf(myId); } - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public boolean isReadOnly() { return false; diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchUsageTarget.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchUsageTarget.java index 996bd9583998..baa784779d37 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchUsageTarget.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchUsageTarget.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.structuralsearch.plugin.ui; import com.intellij.navigation.ItemPresentation; @@ -61,21 +61,6 @@ class StructuralSearchUsageTarget implements ConfigurableUsageTarget, ItemPresen return this; } - @Override - public void navigate(boolean requestFocus) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public void showSettings() { UIUtil.invokeAction(myConfiguration, mySearchContext); diff --git a/platform/structure-view-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java b/platform/structure-view-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java index d3ea5a349ece..8ec9088cc26f 100644 --- a/platform/structure-view-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java +++ b/platform/structure-view-impl/src/com/intellij/ide/structureView/impl/StructureViewComposite.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.ide.structureView.impl; @@ -118,9 +118,6 @@ public class StructureViewComposite implements StructureView { @Override public TreeElement @NotNull [] getChildren() { return EMPTY_ARRAY;} @Nullable @Override public String getPresentableText() { return null;} @Nullable @Override public Icon getIcon(boolean unused) { return null;} - @Override public void navigate(boolean requestFocus) {} - @Override public boolean canNavigate() { return false;} - @Override public boolean canNavigateToSource() { return false;} } return new M(); } diff --git a/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageGroupBase.java b/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageGroupBase.java index 02baf0188d42..c4d55bca0892 100644 --- a/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageGroupBase.java +++ b/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageGroupBase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.usages.impl.rules; import com.intellij.usages.UsageGroup; @@ -11,20 +11,6 @@ public abstract class UsageGroupBase implements UsageGroup { myOrder = order; } - @Override - public void navigate(boolean focus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public int compareTo(@NotNull UsageGroup o) { if (!(o instanceof UsageGroupBase)) { diff --git a/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageScopeGroupingRule.java b/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageScopeGroupingRule.java index bde191952b9e..7f3cd67e90ae 100644 --- a/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageScopeGroupingRule.java +++ b/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageScopeGroupingRule.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.usages.impl.rules; import com.intellij.icons.AllIcons; @@ -97,16 +97,6 @@ class UsageScopeGroupingRule extends SingleParentUsageGroupingRule implements Du myCode = code; } - @Override - public void navigate(boolean focus) { } - @Override - public boolean canNavigate() { return false; } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public int compareTo(@NotNull UsageGroup usageGroup) { return getPresentableGroupText().compareTo(usageGroup.getPresentableGroupText()); diff --git a/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageTypeGroupingRule.java b/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageTypeGroupingRule.java index 9fd57624c0a1..3d72103b0004 100644 --- a/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageTypeGroupingRule.java +++ b/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageTypeGroupingRule.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.usages.impl.rules; import com.intellij.psi.PsiComment; @@ -88,16 +88,6 @@ public class UsageTypeGroupingRule extends SingleParentUsageGroupingRule impleme return myUsageType.toString(); } - @Override - public void navigate(boolean focus) { } - @Override - public boolean canNavigate() { return false; } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public int compareTo(@NotNull UsageGroup usageGroup) { return getPresentableGroupText().compareTo(usageGroup.getPresentableGroupText()); diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageAdapter.java b/platform/usageView/src/com/intellij/usages/impl/UsageAdapter.java index 1cd05c260999..f9760aea6f64 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageAdapter.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageAdapter.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-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.usages.impl; import com.intellij.openapi.fileEditor.FileEditorLocation; @@ -51,19 +37,4 @@ public class UsageAdapter implements Usage { public void highlightInEditor() { } - - @Override - public void navigate(final boolean requestFocus) { - - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointNoneItem.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointNoneItem.java index 3d97895af1db..f640e7da0590 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointNoneItem.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/ui/BreakpointNoneItem.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2012 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-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.xdebugger.impl.breakpoints.ui; @@ -65,20 +51,6 @@ public class BreakpointNoneItem extends BreakpointItem { return XDebuggerBundle.message("xbreakpoint.master.breakpoint.none"); } - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override public String speedSearchText() { return null; diff --git a/plugins/devkit/devkit-core/src/inspections/ExtensionPointUsageAnalyzer.kt b/plugins/devkit/devkit-core/src/inspections/ExtensionPointUsageAnalyzer.kt index b5ae09e8500c..92f411735aef 100644 --- a/plugins/devkit/devkit-core/src/inspections/ExtensionPointUsageAnalyzer.kt +++ b/plugins/devkit/devkit-core/src/inspections/ExtensionPointUsageAnalyzer.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.idea.devkit.inspections import com.intellij.codeInsight.hint.HintManager @@ -670,20 +670,13 @@ private class DummyUsageTarget(@Nls val text: String) : UsageTarget { } } - override fun canNavigate(): Boolean = false - override fun getName(): String = text override fun findUsages() { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } - override fun canNavigateToSource() = false - override fun isReadOnly(): Boolean = false - override fun navigate(requestFocus: Boolean) { - } - override fun isValid(): Boolean = true } diff --git a/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java b/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java index 6edd388558f2..1c3e1a70d806 100644 --- a/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java +++ b/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/editor/ResourceBundleFileStructureViewElement.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.lang.properties.editor; @@ -147,19 +147,4 @@ public final class ResourceBundleFileStructureViewElement implements StructureVi } }; } - - @Override - public void navigate(boolean requestFocus) { - - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } } diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathEvalAction.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathEvalAction.java index e31cae10da46..fa54c010e6c8 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathEvalAction.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathEvalAction.java @@ -430,20 +430,6 @@ public class XPathEvalAction extends XPathAction { public ItemPresentation getPresentation() { return myItemPresentation; } - - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } } private static class MyUsageSearcher implements UsageSearcher { diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java index 96d9f22c11b5..142d8fde614f 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AbstractDomChildDescriptionImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.util.xml.impl; import com.intellij.ide.presentation.Presentation; @@ -125,20 +125,6 @@ public abstract class AbstractDomChildDescriptionImpl implements AbstractDomChil return true; } - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override @Nullable public ElementPresentationTemplate getPresentationTemplate() { diff --git a/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java b/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java index 23258378f980..2baa199cf470 100644 --- a/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java +++ b/xml/dom-impl/src/com/intellij/xml/impl/dom/DomElementXmlDescriptor.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 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. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.xml.impl.dom; import com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightingAwareElementDescriptor; @@ -94,20 +94,6 @@ public class DomElementXmlDescriptor extends AbstractDomChildrenDescriptor imple return true; } - @Override - public void navigate(boolean requestFocus) { - } - - @Override - public boolean canNavigate() { - return false; - } - - @Override - public boolean canNavigateToSource() { - return false; - } - @Override @NotNull public XmlName getXmlName() {