public class GridCopyKeyListener extends Object implements org.eclipse.swt.events.KeyListener
KeyListener
for the copy action on a Grid
control.Constructor and Description |
---|
GridCopyKeyListener(org.eclipse.swt.widgets.Display display)
Constructor.
|
Modifier and Type | Method and 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). |
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. |
public GridCopyKeyListener(org.eclipse.swt.widgets.Display display)
display
- the Display
on which to allocate this command's Clipboard
.public void keyPressed(org.eclipse.swt.events.KeyEvent e)
keyPressed
in interface org.eclipse.swt.events.KeyListener
public void keyReleased(org.eclipse.swt.events.KeyEvent e)
keyReleased
in interface org.eclipse.swt.events.KeyListener
public void copySelectionToClipboard(org.eclipse.nebula.widgets.grid.Grid grid)
Grid
as a formatted string (if a selection exists).grid
- the Grid
control.public String getSelectionAsText(org.eclipse.nebula.widgets.grid.Grid grid)
Grid
as a formatted string.grid
- the Grid
controlprotected boolean isTriggerActive()
true
if copy was triggered in key pressedprotected void setTriggerActive(boolean triggerActive)
keyPressed(KeyEvent)
to indicated whether this triggers the action.triggerActive
- true
if key release should perform the action, false
otherwiseCopyright © 2019. All rights reserved.