Author: koen.aers(a)jboss.com
Date: 2012-01-16 05:03:51 -0500 (Mon, 16 Jan 2012)
New Revision: 37857
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/commands/ForgeCommandListHandler.java
Log:
JBIDE-10358: Cmd+4 asks to start another forge if forge console is not open in the
perspective
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/commands/ForgeCommandListHandler.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/commands/ForgeCommandListHandler.java 2012-01-16
10:02:59 UTC (rev 37856)
+++
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/commands/ForgeCommandListHandler.java 2012-01-16
10:03:51 UTC (rev 37857)
@@ -42,10 +42,15 @@
}
private ForgeRuntime getForgeRuntime(IWorkbenchWindow window) {
- IViewPart part = window.getActivePage().findView(ForgeView.ID);
- if (part != null && part instanceof ForgeView) {
- return ((ForgeView)part).getRuntime();
- } else {
+ try {
+ IViewPart part = window.getActivePage().showView(ForgeView.ID);
+ if (part != null && part instanceof ForgeView) {
+ return ((ForgeView)part).getRuntime();
+ } else {
+ return null;
+ }
+ } catch (PartInitException e) {
+ ForgeUIPlugin.log(e);
return null;
}
}
Show replies by date