/* Select All */
fSelectAllAction = new Action() {
@Override
public void run() {
Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();
/* Select All in Text Widget */
if (focusControl instanceof Text) {
((Text) focusControl).selectAll();
}
/* Select All in Viewer Tree */
else {
((Tree) fNewsTableControl.getViewer().getControl()).selectAll();
fNewsTableControl.getViewer().setSelection(fNewsTableControl.getViewer().getSelection());
}
}
};
/* Delete */
fDeleteAction = new Action() {
@Override
public void run() {
new DeleteTypesAction(fParent.getShell(), (IStructuredSelection) fNewsTableControl.getViewer().getSelection()).run();
}
};
/* Cut */
fCutAction = new Action() {
@Override
public void run() {
Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();
/* Cut in Text Widget */
if (focusControl instanceof Text)
((Text) focusControl).cut();
}
};
/* Copy */
fCopyAction = new Action() {
@Override
public void run() {
Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();
/* Copy in Text Widget */
if (focusControl instanceof Text)
((Text) focusControl).copy();
}
};
/* Paste */
fPasteAction = new Action() {
@Override
public void run() {
Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();
/* Paste in Text Widget */
if (focusControl instanceof Text)
((Text) focusControl).paste();
}