Exemplo n.º 1
0
  private static IAction generateUndoableActionFor(
      final MWC.GUI.Tools.SubjectAction theAction,
      final Editable[] editables,
      final Layers theLayers,
      final Layer topLevelLayer) {

    final IAction changeThis =
        new Action(theAction.toString(), IAction.AS_PUSH_BUTTON) {
          public void run() {
            try {
              final AbstractOperation la =
                  new UndoableAction(
                      theAction.toString(), editables, theAction, theLayers, topLevelLayer);

              CorePlugin.run(la);
            } catch (final Exception e) {
              CorePlugin.logError(
                  IStatus.INFO,
                  "While executing undoable operations for for:" + theAction.toString(),
                  e);
            }
          }
        };
    return changeThis;
  }
Exemplo n.º 2
0
  private static MWC.GUI.Tools.SubjectAction[] getIntersectionFor(
      final MWC.GUI.Tools.SubjectAction[] a,
      final MWC.GUI.Tools.SubjectAction[] b,
      final MWC.GUI.Tools.SubjectAction[] demo) {
    final Vector<MWC.GUI.Tools.SubjectAction> res = new Vector<MWC.GUI.Tools.SubjectAction>();

    for (int cnta = 0; cnta < a.length; cnta++) {
      final MWC.GUI.Tools.SubjectAction thisP = a[cnta];
      for (int cntb = 0; cntb < b.length; cntb++) {
        final MWC.GUI.Tools.SubjectAction thatP = b[cntb];
        if (thisP.toString().equals(thatP.toString())) {
          res.add(thisP);
        }
      }
    }
    return res.toArray(demo);
  }