}
private void createGlobalActions() {
/* Hook into Reload */
fReloadAction = new Action() {
@Override
public void run() {
new ReloadTypesAction(new StructuredSelection(fInput.getMark()), getEditorSite().getShell()).run();
}
};
/* Mark All Read */
fMarkAllReadAction = new Action("Mark all News as Read") {
@Override
public void run() {
new MarkReadAction(new StructuredSelection(fInput.getMark())).run();
}
};
/* 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();
}
};
/* Find */
fFindAction = new Action() {
@Override
public void run() {
if (fFilterBar != null)
fFilterBar.focusQuickSearch();
}
};
/* Print */
fPrintAction = new Action() {
@Override
public void run() {
if (fNewsBrowserControl != null)
fNewsBrowserControl.getViewer().getBrowser().print();
}