diff --git a/plugins/devkit/devkit-core/src/dom/AddToGroup.java b/plugins/devkit/devkit-core/src/dom/AddToGroup.java index 39608375d319..8f4f33c79eda 100644 --- a/plugins/devkit/devkit-core/src/dom/AddToGroup.java +++ b/plugins/devkit/devkit-core/src/dom/AddToGroup.java @@ -1,4 +1,4 @@ -// 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-2024 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.devkit.dom; import com.intellij.ide.presentation.Presentation; @@ -26,4 +26,8 @@ public interface AddToGroup extends DomElement { @Required @Convert(ActionOrGroupResolveConverter.OnlyGroups.class) GenericAttributeValue getGroupId(); + + enum Anchor { + first, last, before, after + } } diff --git a/plugins/devkit/devkit-core/src/dom/Anchor.java b/plugins/devkit/devkit-core/src/dom/Anchor.java deleted file mode 100644 index 11b241cbe665..000000000000 --- a/plugins/devkit/devkit-core/src/dom/Anchor.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2000-2018 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 org.jetbrains.idea.devkit.dom; - -public enum Anchor { - - first, last, before, after -} diff --git a/plugins/devkit/devkit-core/src/inspections/PluginXmlDomInspection.java b/plugins/devkit/devkit-core/src/inspections/PluginXmlDomInspection.java index 5742d9ce72a8..852dc64a8b50 100644 --- a/plugins/devkit/devkit-core/src/inspections/PluginXmlDomInspection.java +++ b/plugins/devkit/devkit-core/src/inspections/PluginXmlDomInspection.java @@ -943,13 +943,13 @@ public final class PluginXmlDomInspection extends DevKitPluginXmlInspectionBase return; } - final Anchor value = addToGroup.getAnchor().getValue(); - if (value == Anchor.after || value == Anchor.before) { + final AddToGroup.Anchor value = addToGroup.getAnchor().getValue(); + if (value == AddToGroup.Anchor.after || value == AddToGroup.Anchor.before) { return; } holder.createProblem( addToGroup.getAnchor(), - DevKitBundle.message("inspections.plugin.xml.must.use.after.before.with.relative-to-action", Anchor.after, Anchor.before)); + DevKitBundle.message("inspections.plugin.xml.must.use.after.before.with.relative-to-action", AddToGroup.Anchor.after, AddToGroup.Anchor.before)); } private static void annotateGroup(Group group, DomElementAnnotationHolder holder) { diff --git a/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/ComponentNotRegisteredInspectionTestBase.java b/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/ComponentNotRegisteredInspectionTestBase.java index 59971048815c..02af2fc684c6 100644 --- a/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/ComponentNotRegisteredInspectionTestBase.java +++ b/plugins/devkit/devkit-tests/testSrc/org/jetbrains/idea/devkit/inspections/ComponentNotRegisteredInspectionTestBase.java @@ -6,7 +6,7 @@ import com.intellij.openapi.project.IntelliJProjectUtil; import com.intellij.openapi.util.text.StringUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.idea.devkit.dom.Anchor; +import org.jetbrains.idea.devkit.dom.AddToGroup; import org.jetbrains.idea.devkit.inspections.quickfix.RegisterActionFix; import org.jetbrains.idea.devkit.util.ActionData; @@ -140,7 +140,7 @@ public abstract class ComponentNotRegisteredInspectionTestBase extends PluginMod @Override public String getSelectedAnchor() { - return Anchor.before.name(); + return AddToGroup.Anchor.before.name(); } @Nullable