コード例 #1
0
 public void apply() throws ConfigurationException {
   final List<TreePath> treePaths = TreeUtil.collectExpandedPaths(myActionsTree);
   if (mySelectedSchema != null) {
     CustomizationUtil.optimizeSchema(myActionsTree, mySelectedSchema);
   }
   restorePathsAfterTreeOptimization(treePaths);
   CustomActionsSchema.getInstance().copyFrom(mySelectedSchema);
   setCustomizationSchemaForCurrentProjects();
 }
コード例 #2
0
 private List<ActionUrl> findActionsUnderSelection() {
   final ArrayList<ActionUrl> actions = new ArrayList<ActionUrl>();
   final TreePath[] selectionPaths = myActionsTree.getSelectionPaths();
   if (selectionPaths != null) {
     for (TreePath path : selectionPaths) {
       final ActionUrl selectedUrl = CustomizationUtil.getActionUrl(path, ActionUrl.MOVE);
       final ArrayList<String> selectedGroupPath =
           new ArrayList<String>(selectedUrl.getGroupPath());
       final Object component = selectedUrl.getComponent();
       if (component instanceof Group) {
         selectedGroupPath.add(((Group) component).getName());
         for (ActionUrl action : mySelectedSchema.getActions()) {
           final ArrayList<String> groupPath = action.getGroupPath();
           final int idx = Collections.indexOfSubList(groupPath, selectedGroupPath);
           if (idx > -1) {
             actions.add(action);
           }
         }
       }
     }
   }
   return actions;
 }
コード例 #3
0
 public boolean isModified() {
   CustomizationUtil.optimizeSchema(myActionsTree, mySelectedSchema);
   return CustomActionsSchema.getInstance().isModified(mySelectedSchema);
 }
コード例 #4
0
 private void restorePathsAfterTreeOptimization(final List<TreePath> treePaths) {
   for (final TreePath treePath : treePaths) {
     myActionsTree.expandPath(CustomizationUtil.getPathByUserObjects(myActionsTree, treePath));
   }
 }