summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Aubry2012-09-24 10:07:34 (EDT)
committer sbernard2012-09-24 12:35:15 (EDT)
commit69a7481193370422542e566b9ef611760e9db0cb (patch)
tree9dab001ad14ab2d372bd67edb775a5fb62af3976
parenta94a8470ccd8d3a16dfc77e6adcad292ebe26bb7 (diff)
downloadorg.eclipse.koneki.ldt-69a7481193370422542e566b9ef611760e9db0cb.zip
org.eclipse.koneki.ldt-69a7481193370422542e566b9ef611760e9db0cb.tar.gz
org.eclipse.koneki.ldt-69a7481193370422542e566b9ef611760e9db0cb.tar.bz2
Add a link in Execution Environment preference page to the list of
available EEs on the wiki
-rw-r--r--plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/LuaExecutionEnvironmentPreferencePage.java25
-rw-r--r--plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/Messages.java1
-rw-r--r--plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/messages.properties1
3 files changed, 27 insertions, 0 deletions
diff --git a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/LuaExecutionEnvironmentPreferencePage.java b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/LuaExecutionEnvironmentPreferencePage.java
index ec01c76..be21fbe 100644
--- a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/LuaExecutionEnvironmentPreferencePage.java
+++ b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/LuaExecutionEnvironmentPreferencePage.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.koneki.ldt.ui.internal.preferences;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -35,6 +37,7 @@ import org.eclipse.koneki.ldt.ui.internal.buildpath.LuaExecutionEnvironmentConte
import org.eclipse.koneki.ldt.ui.internal.buildpath.LuaExecutionEnvironmentLabelProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
@@ -42,11 +45,16 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
public class LuaExecutionEnvironmentPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+ private static final String AVAILABLE_EXECUTION_ENVIRONEMENT_URL = "http://wiki.eclipse.org/Koneki/LDT/User_Area/Available_Execution_Environments"; //$NON-NLS-1$
+
private TreeViewer eeTreeViewer;
private Button removeButton;
@@ -95,6 +103,11 @@ public class LuaExecutionEnvironmentPreferencePage extends PreferencePage implem
RowDataFactory.swtDefaults().hint(SWTUtil.getButtonWidthHint(removeButton), -1).applyTo(removeButton);
removeButton.setText(Messages.LuaExecutionEnvironmentPreferencePage_removeButton);
+ // Link to available EEs
+ Link availableEELink = new Link(containerComposite, SWT.NONE);
+ availableEELink.setText(Messages.LuaExecutionEnvironmentPreferencePage_availableEELink);
+ GridDataFactory.fillDefaults().span(2, 1).applyTo(availableEELink);
+
// ----------------
// ADD LISTENERS
addButton.addSelectionListener(new SelectionListener() {
@@ -121,6 +134,18 @@ public class LuaExecutionEnvironmentPreferencePage extends PreferencePage implem
doRemoveSelection(e);
}
});
+ availableEELink.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(AVAILABLE_EXECUTION_ENVIRONEMENT_URL));
+ } catch (PartInitException e1) {
+ Activator.logError("Unable to open: " + AVAILABLE_EXECUTION_ENVIRONEMENT_URL, e1); //$NON-NLS-1$
+ } catch (MalformedURLException e1) {
+ Activator.logError("Unable to open: " + AVAILABLE_EXECUTION_ENVIRONEMENT_URL, e1); //$NON-NLS-1$
+ }
+ }
+ });
// ----------------
// Initialize UI
diff --git a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/Messages.java b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/Messages.java
index 242ec3c..0f55013 100644
--- a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/Messages.java
+++ b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/Messages.java
@@ -19,6 +19,7 @@ public class Messages extends NLS {
public static String LuaExecutionEnvironmentPreferencePage_addEESupportTitle;
public static String LuaExecutionEnvironmentPreferencePage_addEESupportMessage;
public static String LuaExecutionEnvironmentPreferencePage_addbutton;
+ public static String LuaExecutionEnvironmentPreferencePage_availableEELink;
public static String LuaExecutionEnvironmentPreferencePage_removeButton;
public static String LuaExecutionEnvironmentPreferencePageTitle;
public static String LuaTodoTaskPreferencePage_description;
diff --git a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/messages.properties b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/messages.properties
index 7145ff5..ed5ebd7 100644
--- a/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/messages.properties
+++ b/plugins/org.eclipse.koneki.ldt.ui/src/org/eclipse/koneki/ldt/ui/internal/preferences/messages.properties
@@ -2,6 +2,7 @@ GlobalLuaPreferencePage_description=Lua Global preferences
LuaExecutionEnvironmentPreferencePage_addEESupportTitle=Add Execution Environment Support
LuaExecutionEnvironmentPreferencePage_addEESupportMessage=You try to add the support for {0}.\nAn embedded version for this execution environment already exists.\nYour version will override it.\nYou could restaure the embedded one later by removing your version.\nDo you really want to install it?
LuaExecutionEnvironmentPreferencePage_addbutton=Add...
+LuaExecutionEnvironmentPreferencePage_availableEELink=<a>Availables Execution Environments...</a>
LuaExecutionEnvironmentPreferencePage_removeButton=Remove
LuaExecutionEnvironmentPreferencePageTitle=Supported execution environments:
LuaTodoTaskPreferencePage_description=String indicating tasks in Lua comments.