Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.equinox.p2.examples.rcp.discovery/src/org/eclipse/equinox/p2/examples/rcp/cloud/OpenViewAction.java')
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.discovery/src/org/eclipse/equinox/p2/examples/rcp/cloud/OpenViewAction.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.discovery/src/org/eclipse/equinox/p2/examples/rcp/cloud/OpenViewAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.discovery/src/org/eclipse/equinox/p2/examples/rcp/cloud/OpenViewAction.java
index 317e07342..3c732aebd 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.discovery/src/org/eclipse/equinox/p2/examples/rcp/cloud/OpenViewAction.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.discovery/src/org/eclipse/equinox/p2/examples/rcp/cloud/OpenViewAction.java
@@ -6,26 +6,27 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
-
public class OpenViewAction extends Action {
-
+
private final IWorkbenchWindow window;
private int instanceNum = 0;
private final String viewId;
-
+
public OpenViewAction(IWorkbenchWindow window, String label, String viewId) {
this.window = window;
this.viewId = viewId;
- setText(label);
- // The id is used to refer to the action in a menu or toolbar
+ setText(label);
+ // The id is used to refer to the action in a menu or toolbar
setId(ICommandIds.CMD_OPEN);
- // Associate the action with a pre-defined command, to allow key bindings.
+ // Associate the action with a pre-defined command, to allow key bindings.
setActionDefinitionId(ICommandIds.CMD_OPEN);
- setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.cloud.Activator.getImageDescriptor("/icons/sample2.gif"));
+ setImageDescriptor(
+ org.eclipse.equinox.p2.examples.rcp.cloud.Activator.getImageDescriptor("/icons/sample2.gif"));
}
-
+
+ @Override
public void run() {
- if(window != null) {
+ if (window != null) {
try {
window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
} catch (PartInitException e) {

Back to the top