IDEA-19061 Integrate the Rearranger-plugin into core-IDEA

1. Simple 'remove condition' operation is supported;
2. Arrangement API is expanded in order to allow to configure mutually excluding settings (e.g. modifiers for java);
This commit is contained in:
Denis.Zhdanov
2012-08-16 17:05:51 +04:00
parent 7f7ce8da4d
commit 423bebb371
6 changed files with 156 additions and 52 deletions
@@ -91,4 +91,31 @@ public class ArrangementRuleEditingModelImplTest extends AbstractArrangementRule
assertNotNull(modifiersNode);
assertEquals(and(atom(PUBLIC), atom(STATIC)), modifiersNode.getUserObject());
}
@Test
public void removeAndKeepAllLevels() {
configure(and(atom(FIELD), atom(PUBLIC), atom(STATIC)));
ArrangementRuleEditingModel model = myRowMappings.get(2);
assertNotNull(model);
assertEquals(1, myRowMappings.size());
model.removeAndCondition(atom(PUBLIC));
assertEquals(1, myRowMappings.size());
assertSame(model, myRowMappings.get(2));
assertEquals(and(atom(FIELD), atom(STATIC)), model.getSettingsNode());
DefaultMutableTreeNode fieldNode = (DefaultMutableTreeNode)myRoot.getFirstChild();
assertNotNull(fieldNode);
assertEquals(atom(FIELD), fieldNode.getUserObject());
DefaultMutableTreeNode modifiersNode = fieldNode.getFirstLeaf();
assertNotNull(modifiersNode);
assertEquals(atom(STATIC), modifiersNode.getUserObject());
}
@Test
public void removeLastRowCondition() {
// TODO den implement
}
}