Class CutCopyPasteListener

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.internal.SWTEventListener

    public class CutCopyPasteListener
    extends java.lang.Object
    implements org.eclipse.swt.events.KeyListener, org.eclipse.jface.viewers.ISelectionChangedListener
    On creation this listener registers itself on a given TableViewer and register the according EMF Cut/Copy/Paste-Actions. They are triggered using keybindings.
    Author:
    Johannes Faltermeier
    • Constructor Summary

      Constructors 
      Constructor Description
      CutCopyPasteListener​(org.eclipse.jface.viewers.TableViewer tableViewer, org.eclipse.emf.edit.domain.EditingDomain editingDomain, org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
      Constructs this listener.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void keyPressed​(org.eclipse.swt.events.KeyEvent e)  
      void keyReleased​(org.eclipse.swt.events.KeyEvent e)  
      void rootDomainModelChanged​(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
      Called to notify this listener that the domain model has changed.
      void selectionChanged​(org.eclipse.jface.viewers.SelectionChangedEvent event)  
      • Methods inherited from class java.lang.Object

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

      • CutCopyPasteListener

        public CutCopyPasteListener​(org.eclipse.jface.viewers.TableViewer tableViewer,
                                    org.eclipse.emf.edit.domain.EditingDomain editingDomain,
                                    org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
        Constructs this listener.
        Parameters:
        tableViewer - the TableViewer
        editingDomain - the EditingDomain (contains the used clipboard)
        setting - the parent EObject on which the paste will be performed
    • Method Detail

      • selectionChanged

        public void selectionChanged​(org.eclipse.jface.viewers.SelectionChangedEvent event)
        Specified by:
        selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListener
      • keyPressed

        public void keyPressed​(org.eclipse.swt.events.KeyEvent e)
        Specified by:
        keyPressed in interface org.eclipse.swt.events.KeyListener
      • keyReleased

        public void keyReleased​(org.eclipse.swt.events.KeyEvent e)
        Specified by:
        keyReleased in interface org.eclipse.swt.events.KeyListener
      • rootDomainModelChanged

        public void rootDomainModelChanged​(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
        Called to notify this listener that the domain model has changed.
        Parameters:
        setting - the new table setting