Class PropUndoRedoAdapter

  • All Implemented Interfaces:
    IPropUndoRedo

    public class PropUndoRedoAdapter
    extends java.lang.Object
    implements IPropUndoRedo
    Abstract adapter for interface used for undo/redo operations in properties.
    Author:
    Christopher Mindus
    • Constructor Summary

      Constructors 
      ConstructorDescription
      PropUndoRedoAdapter​(IWorkbenchPartIZ part)
      Constructor without target viewer.
      PropUndoRedoAdapter​(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.commands.operations.IUndoContext undoContext)
      Constructor without target viewer.
      PropUndoRedoAdapter​(org.eclipse.swt.widgets.Shell shell, org.eclipse.jface.viewers.Viewer targetViewer, org.eclipse.core.commands.operations.IUndoContext undoContext)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.ObjectgetShell()
      Gets the shell.
      java.lang.ObjectgetTargetViewer()
      Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
      java.lang.ObjectgetUndoContext()
      Gets the undo context.
      voidsetTargetViewer​(java.lang.Object viewer)
      Sets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
      voidupdateStates()
      Updates the states of menu items and tool bars.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropUndoRedoAdapter

        public PropUndoRedoAdapter​(IWorkbenchPartIZ part)
        Constructor without target viewer. Use setTargetViewer to set a specific viewer or let the system figure out which one is in focus.
        Parameters:
        part - The editor part or view.
      • PropUndoRedoAdapter

        public PropUndoRedoAdapter​(org.eclipse.swt.widgets.Shell shell,
                                   org.eclipse.core.commands.operations.IUndoContext undoContext)
        Constructor without target viewer. Use setTargetViewer to set a specific viewer or let the system figure out which one is in focus.
        Parameters:
        shell - The Shell instance.
        undoContext - An instance of IUndoContext.
      • PropUndoRedoAdapter

        public PropUndoRedoAdapter​(org.eclipse.swt.widgets.Shell shell,
                                   org.eclipse.jface.viewers.Viewer targetViewer,
                                   org.eclipse.core.commands.operations.IUndoContext undoContext)
        Constructor.
        Parameters:
        shell - The Shell instance.
        targetViewer - The target viewer instance: CommonViewer, TreeViewer or TableViewer, or null for none.
        undoContext - An instance of IUndoContext.
    • Method Detail

      • getShell

        public java.lang.Object getShell()
        Gets the shell.
        Specified by:
        getShell in interface IPropUndoRedo
        Returns:
        An object castable to org.eclipse.swt.widgets.Shell.
      • getUndoContext

        public final java.lang.Object getUndoContext()
        Gets the undo context.
        Specified by:
        getUndoContext in interface IPropUndoRedo
        Returns:
        An object castable to org.eclipse.core.commands.operations.IUndoContext.
      • updateStates

        public void updateStates()
        Updates the states of menu items and tool bars.
        Specified by:
        updateStates in interface IPropUndoRedo
      • setTargetViewer

        public final void setTargetViewer​(java.lang.Object viewer)
        Sets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
        Specified by:
        setTargetViewer in interface IPropUndoRedo
        Parameters:
        viewer - The CommonViewer, TreeViewer or TableViewer, or null for none.
      • getTargetViewer

        public final java.lang.Object getTargetViewer()
        Gets the structured viewer (common, tree or table) used for the property operation (add, delete, etc).
        Specified by:
        getTargetViewer in interface IPropUndoRedo
        Returns:
        The CommonViewer, TreeViewer or TableViewer, or null for none.