Пример #1
0
    public ListPropertyAction(
        final String propertyName,
        final Editable[] editable,
        final Method getter,
        final Method setter,
        final Object newValue,
        final Layers layers,
        final Layer parentLayer) {
      super(
          propertyName
              + " for "
              + (editable.length > 1 ? "multiple items" : editable[0].getName()));
      _setter = setter;
      _layers = layers;
      _parentLayer = parentLayer;
      _subjects = editable;
      _newValue = newValue;

      try {
        _oldValue = getter.invoke(editable[0], (Object[]) null);
      } catch (final Exception e) {
        CorePlugin.logError(
            Status.ERROR,
            "Failed to retrieve old value for:"
                + "Multiple items starting with:"
                + _subjects[0].getName(),
            e);
      }

      if (CorePlugin.getUndoContext() != null) {
        super.addContext(CorePlugin.getUndoContext());
      }
    }
Пример #2
0
 public UndoableAction(
     final String propertyName,
     final Editable[] editable,
     final SubjectAction action,
     final Layers layers,
     final Layer parentLayer) {
   super(
       propertyName
           + " for "
           + (editable.length > 1 ? "multiple items" : editable[0].getName()));
   _layers = layers;
   _action = action;
   _parentLayer = parentLayer;
   _subjects = editable;
   if (CorePlugin.getUndoContext() != null) {
     super.addContext(CorePlugin.getUndoContext());
   }
 }
Пример #3
0
 @Override
 public void addContext(IUndoContext context) {
   super.addContext(context);
 }