Class GridCopyKeyListener

  • All Implemented Interfaces:
    java.util.EventListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.internal.SWTEventListener
    Direct Known Subclasses:
    GridCutKeyListener

    public class GridCopyKeyListener
    extends java.lang.Object
    implements org.eclipse.swt.events.KeyListener
    KeyListener for the copy action on a Grid control.
    Since:
    1.10
    Author:
    Alexandra Buzila
    • Constructor Summary

      Constructors 
      Constructor Description
      GridCopyKeyListener​(org.eclipse.swt.widgets.Display display)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copySelectionToClipboard​(org.eclipse.nebula.widgets.grid.Grid grid)
      Copies the table selection of the Grid as a formatted string (if a selection exists).
      java.lang.String getSelectionAsText​(org.eclipse.nebula.widgets.grid.Grid grid)
      Returns the table selection of the Grid as a formatted string.
      protected boolean isTriggerActive()  
      void keyPressed​(org.eclipse.swt.events.KeyEvent e)  
      void keyReleased​(org.eclipse.swt.events.KeyEvent e)  
      protected void setTriggerActive​(boolean triggerActive)
      May be called from keyPressed(KeyEvent) to indicated whether this triggers the action.
      • Methods inherited from class java.lang.Object

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

      • GridCopyKeyListener

        public GridCopyKeyListener​(org.eclipse.swt.widgets.Display display)
        Constructor.
        Parameters:
        display - the Display on which to allocate this command's Clipboard.
    • Method Detail

      • 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
      • copySelectionToClipboard

        public void copySelectionToClipboard​(org.eclipse.nebula.widgets.grid.Grid grid)
        Copies the table selection of the Grid as a formatted string (if a selection exists).
        Parameters:
        grid - the Grid control.
      • getSelectionAsText

        public java.lang.String getSelectionAsText​(org.eclipse.nebula.widgets.grid.Grid grid)
        Returns the table selection of the Grid as a formatted string.
        Parameters:
        grid - the Grid control
        Returns:
        the selection
      • isTriggerActive

        protected boolean isTriggerActive()
        Returns:
        true if copy was triggered in key pressed
      • setTriggerActive

        protected void setTriggerActive​(boolean triggerActive)
        May be called from keyPressed(KeyEvent) to indicated whether this triggers the action.
        Parameters:
        triggerActive - true if key release should perform the action, false otherwise