Class PasteTemplateAction

    • Constructor Detail

      • PasteTemplateAction

        public PasteTemplateAction​(IWorkbenchPart editor)
        Constructor for PasteTemplateAction.
        Parameters:
        editor -
    • Method Detail

      • createPasteCommand

        protected Command createPasteCommand()
        Creates and returns a command (which may be null) to create a new EditPart based on the template on the clipboard.
        Returns:
        the paste command
      • getClipboardContents

        protected java.lang.Object getClipboardContents()
        Returns the template on the clipboard, if there is one. Note that the template on the clipboard might be from a palette from another type of editor.
        Returns:
        the clipboard's contents
      • getFactory

        protected CreationFactory getFactory​(java.lang.Object template)
        Returns the appropriate Factory object to be used for the specified template. This Factory is used on the CreateRequest that is sent to the target EditPart. Note that the given template might be from a palette for a different GEF-based editor. In that case, this method can return null.
        Parameters:
        template - the template Object; it will never be null
        Returns:
        a Factory
      • getPasteLocation

        protected org.eclipse.draw2d.geometry.Point getPasteLocation​(GraphicalEditPart container)
        Parameters:
        container - the parent of the new part that is being pasted
        Returns:
        the location at which to insert