|
From: <caw...@us...> - 2007-01-23 13:50:50
|
Revision: 1856
http://svn.sourceforge.net/rubyeclipse/?rev=1856&view=rev
Author: cawilliams
Date: 2007-01-23 05:50:42 -0800 (Tue, 23 Jan 2007)
Log Message:
-----------
show VM type in installed interpreters table, Add more text to dialog for finding ruby home (to let Unix users know what they should set it to).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.properties
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterLabelProvider.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.java 2007-01-23 01:02:24 UTC (rev 1855)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.java 2007-01-23 13:50:42 UTC (rev 1856)
@@ -69,6 +69,7 @@
public static String RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterName;
public static String RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterPath;
public static String RdtDebugUiPlugin_couldNotOpenFile;
+ public static String RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterType;
static {
// load message values from bundle file
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.properties 2007-01-23 01:02:24 UTC (rev 1855)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiMessages.properties 2007-01-23 13:50:42 UTC (rev 1856)
@@ -65,6 +65,7 @@
RubyInterpreterPreferencePage_removeButton_label=Remove
RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterName=Name
RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterPath=Location
+RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterType=Type
RubyInterpreterPreferencePage_EditInterpreterDialog_addInterpreter_title=Add Interpreter
RubyInterpreterPreferencePage_EditInterpreterDialog_editInterpreter_title=Edit Interpreter
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterLabelProvider.java 2007-01-23 01:02:24 UTC (rev 1855)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterLabelProvider.java 2007-01-23 13:50:42 UTC (rev 1856)
@@ -6,6 +6,7 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;
import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallType;
public class RubyInterpreterLabelProvider implements ITableLabelProvider {
@@ -25,6 +26,9 @@
case 1 :
File installLocation = interpreter.getInstallLocation();
return installLocation != null ? installLocation.getAbsolutePath() : "In user path";
+ case 2 :
+ IVMInstallType installType = interpreter.getVMInstallType();
+ return installType != null ? installType.getName() : "Unknown";
default :
return "Unknown Column Index";
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java 2007-01-23 01:02:24 UTC (rev 1855)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java 2007-01-23 13:50:42 UTC (rev 1856)
@@ -15,12 +15,14 @@
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
@@ -37,17 +39,21 @@
import org.rubypeople.rdt.launching.VMStandin;
public class RubyInterpreterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IAddVMDialogRequestor {
-
+
/**
* VMs being displayed
*/
- private List<IVMInstall> fVMs = new ArrayList<IVMInstall>();
-
+ private List<IVMInstall> fVMs = new ArrayList<IVMInstall>();
+
protected CheckboxTableViewer fVMList;
protected Button addButton, editButton, removeButton;
public RubyInterpreterPreferencePage() {
super();
+ // only used when page is shown programatically
+ setTitle(RubyVMMessages.JREsPreferencePage_1);
+
+ setDescription(RubyVMMessages.JREsPreferencePage_2);
}
public void init(IWorkbench workbench) {}
@@ -56,12 +62,22 @@
noDefaultAndApplyButton();
Composite composite = createPageRoot(parent);
+
+ Label tableLabel = new Label(composite, SWT.NONE);
+ tableLabel.setText(RubyVMMessages.InstalledJREsBlock_15);
+ GridData data = new GridData();
+ data.horizontalSpan = 2;
+ tableLabel.setLayoutData(data);
+ Font font = parent.getFont();
+ composite.setFont(font);
+ tableLabel.setFont(font);
+
Table table = createInstalledInterpretersTable(composite);
createInstalledInterpretersTableViewer(table);
- createButtonGroup(composite);
+ createButtonGroup(composite);
fillWithWorkspaceRubyVMs();
-
+
IVMInstall selectedInterpreter = RubyRuntime.getDefaultVMInstall();
if (selectedInterpreter != null)
fVMList.setChecked(selectedInterpreter, true);
@@ -70,9 +86,9 @@
return composite;
}
-
+
private void fillWithWorkspaceRubyVMs() {
-// fill with Ruby VMs
+ // fill with Ruby VMs
List<VMStandin> standins = new ArrayList<VMStandin>();
IVMInstallType[] types = RubyRuntime.getVMInstallTypes();
for (int i = 0; i < types.length; i++) {
@@ -83,13 +99,14 @@
standins.add(new VMStandin(install));
}
}
- setJREs((IVMInstall[])standins.toArray(new IVMInstall[standins.size()]));
+ setJREs((IVMInstall[]) standins.toArray(new IVMInstall[standins.size()]));
}
/**
* Sets the JREs to be displayed in this block
*
- * @param vms JREs to be displayed
+ * @param vms
+ * JREs to be displayed
*/
protected void setJREs(IVMInstall[] vms) {
fVMs.clear();
@@ -153,7 +170,7 @@
updateSelectedInterpreter(event.getElement());
}
});
-
+
fVMList.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent e) {
editInterpreter();
@@ -175,7 +192,11 @@
column = new TableColumn(table, SWT.NULL);
column.setText(RdtDebugUiMessages.RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterPath);
- column.setWidth(350);
+ column.setWidth(250);
+
+ column = new TableColumn(table, SWT.NULL);
+ column.setText(RdtDebugUiMessages.RubyInterpreterPreferencePage_rubyInterpreterTable_interpreterType);
+ column.setWidth(125);
return table;
}
@@ -190,7 +211,7 @@
protected void addInterpreter() {
AddVMDialog dialog = new AddVMDialog(this, getShell(), RubyRuntime.getVMInstallTypes(), null);
- dialog.setTitle(RubyVMMessages.InstalledJREsBlock_7);
+ dialog.setTitle(RubyVMMessages.InstalledJREsBlock_7);
if (dialog.open() != Window.OK) {
return;
}
@@ -220,31 +241,31 @@
}
protected void editInterpreter() {
- IStructuredSelection selection= (IStructuredSelection)fVMList.getSelection();
- IVMInstall vm= (IVMInstall)selection.getFirstElement();
+ IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection();
+ IVMInstall vm = (IVMInstall) selection.getFirstElement();
if (vm == null) {
return;
}
-// if (isContributed(vm)) {
-// VMDetailsDialog dialog= new VMDetailsDialog(getShell(), vm);
-// dialog.open();
-// } else {
- AddVMDialog dialog= new AddVMDialog(this, getShell(), RubyRuntime.getVMInstallTypes(), vm);
- dialog.setTitle(RubyVMMessages.InstalledJREsBlock_8);
- if (dialog.open() != Window.OK) {
- return;
- }
- fVMList.refresh(vm);
-// }
+ // if (isContributed(vm)) {
+ // VMDetailsDialog dialog= new VMDetailsDialog(getShell(), vm);
+ // dialog.open();
+ // } else {
+ AddVMDialog dialog = new AddVMDialog(this, getShell(), RubyRuntime.getVMInstallTypes(), vm);
+ dialog.setTitle(RubyVMMessages.InstalledJREsBlock_8);
+ if (dialog.open() != Window.OK) {
+ return;
+ }
+ fVMList.refresh(vm);
+ // }
}
-
+
protected IVMInstall getSelectedInterpreter() {
IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection();
return (IVMInstall) selection.getFirstElement();
}
-
- public boolean performOk() {
- final boolean[] canceled = new boolean[] {false};
+
+ public boolean performOk() {
+ final boolean[] canceled = new boolean[] { false };
BusyIndicator.showWhile(null, new Runnable() {
public void run() {
IVMInstall defaultVM = getCheckedRubyVM();
@@ -255,14 +276,14 @@
}
}
});
-
- if(canceled[0]) {
+
+ if (canceled[0]) {
return false;
}
-
- return super.performOk();
+
+ return super.performOk();
}
-
+
/**
* Returns the checked RubyVM or <code>null</code> if none.
*
@@ -273,21 +294,21 @@
if (objects.length == 0) {
return null;
}
- return (IVMInstall)objects[0];
+ return (IVMInstall) objects[0];
}
-
+
/**
* Returns the RubyVMs currently being displayed in this block
*
* @return RubyVMs currently being displayed in this block
*/
public IVMInstall[] getRubyVMs() {
- return (IVMInstall[])fVMs.toArray(new IVMInstall[fVMs.size()]);
+ return (IVMInstall[]) fVMs.toArray(new IVMInstall[fVMs.size()]);
}
public boolean isDuplicateName(String name) {
- for (int i= 0; i < fVMs.size(); i++) {
- IVMInstall vm = (IVMInstall)fVMs.get(i);
+ for (int i = 0; i < fVMs.size(); i++) {
+ IVMInstall vm = (IVMInstall) fVMs.get(i);
if (vm.getName().equals(name)) {
return true;
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java 2007-01-23 01:02:24 UTC (rev 1855)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java 2007-01-23 13:50:42 UTC (rev 1856)
@@ -28,6 +28,9 @@
public static String VMLibraryBlock_Libraries_cannot_be_empty__1;
public static String VMLibraryBlock_10;
public static String LibraryStandin_0;
+ public static String InstalledJREsBlock_15;
+ public static String JREsPreferencePage_2;
+ public static String JREsPreferencePage_1;
static {
// load message values from bundle file
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-23 01:02:24 UTC (rev 1855)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-23 13:50:42 UTC (rev 1856)
@@ -1,4 +1,4 @@
-addVMDialog_pickJRERootDialog_message=Select the root directory of the Ruby installation:
+addVMDialog_pickJRERootDialog_message=Select the root directory of the Ruby installation:\n(For *nix systems, this may be /usr or /usr/local. If the ruby executable is in /usr/local/bin/ruby, use /usr/local).
addVMDialog_enterLocation=Enter the location of the Ruby VM.
addVMDialog_locationNotExists=The location does not exist.
@@ -15,6 +15,7 @@
InstalledJREsBlock_7=Add RubyVM
InstalledJREsBlock_8=Edit RubyVM
+InstalledJREsBlock_15=Installed &RubyVMs:
JREsUpdater_0=Save VM Definitions
@@ -23,5 +24,8 @@
VMLibraryBlock_6=Re&move
VMLibraryBlock_7=Add E&xternal Folders...
VMLibraryBlock_9=&Restore Default
+VMLibraryBlock_Libraries_cannot_be_empty__1=Libraries cannot be empty.
-LibraryStandin_0=System library does not exist: {0}
\ No newline at end of file
+LibraryStandin_0=System library does not exist: {0}
+
+JREsPreferencePage_2=Add, remove or edit Ruby VM definitions.\nBy default, the checked RubyVM is added to the build path of newly created Ruby projects.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|