Author: snjeza
Date: 2011-11-13 14:35:17 -0500 (Sun, 13 Nov 2011)
New Revision: 36320
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenWithBrowserHandler.java
Log:
JBIDE-10072 Twitter in JBoss Central is non-functional
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-11-13
19:31:21 UTC (rev 36319)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-11-13
19:35:17 UTC (rev 36320)
@@ -214,15 +214,18 @@
return prefs.getBoolean(SHOW_JBOSS_CENTRAL_ON_STARTUP,
SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
}
+ public static void openUrl(String location, Shell shell) {
+ openUrl(location, shell);
+ }
- public static void openUrl(String location, Shell shell) {
+ public static void openUrl(String location, Shell shell, boolean asExternal) {
URL url = null;
try {
if (location != null) {
url = new URL(location);
}
- if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL) {
+ if (WebBrowserPreference.getBrowserChoice() == WebBrowserPreference.EXTERNAL ||
asExternal) {
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
.getBrowserSupport();
support.getExternalBrowser().openURL(url);
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java 2011-11-13
19:31:21 UTC (rev 36319)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenJBossToolsTwitterHandler.java 2011-11-13
19:35:17 UTC (rev 36320)
@@ -23,4 +23,9 @@
return "http://twitter.com/#!/jbosstools";
}
+ @Override
+ public boolean asExternal() {
+ return true;
+ }
+
}
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenWithBrowserHandler.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenWithBrowserHandler.java 2011-11-13
19:31:21 UTC (rev 36319)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/actions/OpenWithBrowserHandler.java 2011-11-13
19:35:17 UTC (rev 36320)
@@ -25,11 +25,15 @@
public abstract class OpenWithBrowserHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
- JBossCentralActivator.openUrl(getLocation(), getShell());
+ JBossCentralActivator.openUrl(getLocation(), getShell(), asExternal());
return null;
}
public abstract String getLocation();
+
+ public boolean asExternal() {
+ return false;
+ }
private static Shell getShell() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();