mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-19061 Integrate the Rearranger-plugin into core-IDEA
'enum' and 'interface' arrangement entry types are added
This commit is contained in:
@@ -41,7 +41,7 @@ public class JavaRearranger implements Rearranger<JavaElementArrangementEntry>,
|
||||
{
|
||||
|
||||
// Type
|
||||
@NotNull private static final Set<ArrangementEntryType> SUPPORTED_TYPES = EnumSet.of(CLASS, FIELD, METHOD);
|
||||
@NotNull private static final Set<ArrangementEntryType> SUPPORTED_TYPES = EnumSet.of(INTERFACE, CLASS, ENUM, FIELD, METHOD);
|
||||
|
||||
// Modifier
|
||||
@NotNull private static final Set<ArrangementModifier> SUPPORTED_MODIFIERS = EnumSet.of(
|
||||
@@ -60,6 +60,8 @@ public class JavaRearranger implements Rearranger<JavaElementArrangementEntry>,
|
||||
Set<ArrangementModifier> commonModifiers = concat(visibilityModifiers, STATIC, FINAL);
|
||||
|
||||
MODIFIERS_BY_TYPE.put(NO_TYPE, commonModifiers);
|
||||
MODIFIERS_BY_TYPE.put(ENUM, visibilityModifiers);
|
||||
MODIFIERS_BY_TYPE.put(INTERFACE, visibilityModifiers);
|
||||
MODIFIERS_BY_TYPE.put(CLASS, concat(commonModifiers, ABSTRACT));
|
||||
MODIFIERS_BY_TYPE.put(METHOD, concat(commonModifiers, SYNCHRONIZED, ABSTRACT));
|
||||
MODIFIERS_BY_TYPE.put(FIELD, concat(commonModifiers, TRANSIENT, VOLATILE));
|
||||
|
||||
+1
-1
@@ -27,5 +27,5 @@ import com.intellij.psi.codeStyle.arrangement.ArrangementEntry;
|
||||
*/
|
||||
public enum ArrangementEntryType {
|
||||
|
||||
CLASS, FIELD, METHOD
|
||||
CLASS, FIELD, METHOD, ENUM, INTERFACE
|
||||
}
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@ public class DefaultArrangementSettingsRepresentationManager implements Arrangem
|
||||
Object[] ids = {
|
||||
|
||||
// Types.
|
||||
ArrangementEntryType.FIELD, ArrangementEntryType.METHOD, ArrangementEntryType.CLASS,
|
||||
ArrangementEntryType.FIELD, ArrangementEntryType.METHOD, ArrangementEntryType.CLASS, ArrangementEntryType.INTERFACE,
|
||||
ArrangementEntryType.ENUM,
|
||||
|
||||
// Visibility.
|
||||
ArrangementModifier.PUBLIC, ArrangementModifier.PROTECTED, ArrangementModifier.PACKAGE_PRIVATE, ArrangementModifier.PRIVATE,
|
||||
|
||||
+2
-1
@@ -156,7 +156,8 @@ public class ArrangementRuleEditor extends JPanel {
|
||||
ArrangementAtomNodeComponent componentToDeselect = myComponents.get(key);
|
||||
myModel.replaceCondition(componentToDeselect.getMatchCondition(), chosenCondition);
|
||||
for (ArrangementAtomNodeComponent componentToCheck : myComponents.values()) {
|
||||
if (!ArrangementConfigUtil.isEnabled(componentToCheck.getMatchCondition().getValue(), myFilter, myModel.getMatchCondition())) {
|
||||
Object value = componentToCheck.getMatchCondition().getValue();
|
||||
if (myModel.hasCondition(value) && !ArrangementConfigUtil.isEnabled(value, myFilter, myModel.getMatchCondition())) {
|
||||
myModel.removeAndCondition(componentToCheck.getMatchCondition());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user