Class GridCopyKeyListener
- java.lang.Object
-
- org.eclipse.emf.ecp.view.internal.table.nebula.grid.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 aGrid
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 theGrid
as a formatted string (if a selection exists).java.lang.String
getSelectionAsText(org.eclipse.nebula.widgets.grid.Grid grid)
Returns the table selection of theGrid
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 fromkeyPressed(KeyEvent)
to indicated whether this triggers the action.
-
-
-
Method Detail
-
keyPressed
public void keyPressed(org.eclipse.swt.events.KeyEvent e)
- Specified by:
keyPressed
in interfaceorg.eclipse.swt.events.KeyListener
-
keyReleased
public void keyReleased(org.eclipse.swt.events.KeyEvent e)
- Specified by:
keyReleased
in interfaceorg.eclipse.swt.events.KeyListener
-
copySelectionToClipboard
public void copySelectionToClipboard(org.eclipse.nebula.widgets.grid.Grid grid)
Copies the table selection of theGrid
as a formatted string (if a selection exists).- Parameters:
grid
- theGrid
control.
-
getSelectionAsText
public java.lang.String getSelectionAsText(org.eclipse.nebula.widgets.grid.Grid grid)
Returns the table selection of theGrid
as a formatted string.- Parameters:
grid
- theGrid
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 fromkeyPressed(KeyEvent)
to indicated whether this triggers the action.- Parameters:
triggerActive
-true
if key release should perform the action,false
otherwise
-
-