You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: <caw...@us...> - 2007-01-18 15:56:08
|
Revision: 1797
http://svn.sourceforge.net/rubyeclipse/?rev=1797&view=rev
Author: cawilliams
Date: 2007-01-18 07:56:04 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
doing some renaming back to what JDT uses - it's easier
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallChangedListener.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 15:54:37 UTC (rev 1796)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 15:56:04 UTC (rev 1797)
@@ -10,7 +10,7 @@
import org.rubypeople.rdt.core.ILoadpathEntry;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.launching.IVMInstall;
-import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
+import org.rubypeople.rdt.launching.IVMInstallChangedListener;
import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -43,7 +43,7 @@
if (fgLoadpathEntries == null) {
fgLoadpathEntries = new HashMap(10);
// add a listener to clear cached value when a VM changes or is removed
- IInterpreterInstallChangedListener listener = new IInterpreterInstallChangedListener() {
+ IVMInstallChangedListener listener = new IVMInstallChangedListener() {
public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:54:37 UTC (rev 1796)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:56:04 UTC (rev 1797)
@@ -80,7 +80,7 @@
*/
public void setName(String name) {
if (!name.equals(fName)) {
- PropertyChangeEvent event = new PropertyChangeEvent(this, IInterpreterInstallChangedListener.PROPERTY_NAME, fName, name);
+ PropertyChangeEvent event = new PropertyChangeEvent(this, IVMInstallChangedListener.PROPERTY_NAME, fName, name);
fName= name;
if (fNotify) {
RubyRuntime.fireInterpreterChanged(event);
@@ -102,7 +102,7 @@
*/
public void setInstallLocation(File installLocation) {
if (!installLocation.equals(fInstallLocation)) {
- PropertyChangeEvent event = new PropertyChangeEvent(this, IInterpreterInstallChangedListener.PROPERTY_INSTALL_LOCATION, fInstallLocation, installLocation);
+ PropertyChangeEvent event = new PropertyChangeEvent(this, IVMInstallChangedListener.PROPERTY_INSTALL_LOCATION, fInstallLocation, installLocation);
fInstallLocation= installLocation;
if (fNotify) {
RubyRuntime.fireInterpreterChanged(event);
@@ -161,7 +161,7 @@
}
}
- PropertyChangeEvent event = new PropertyChangeEvent(this, IInterpreterInstallChangedListener.PROPERTY_LIBRARY_LOCATIONS, prevLocations, newLocations);
+ PropertyChangeEvent event = new PropertyChangeEvent(this, IVMInstallChangedListener.PROPERTY_LIBRARY_LOCATIONS, prevLocations, newLocations);
fSystemLibraryDescriptions = locations;
if (fNotify) {
RubyRuntime.fireInterpreterChanged(event);
@@ -250,7 +250,7 @@
// No change
return;
}
- PropertyChangeEvent event = new PropertyChangeEvent(this, IInterpreterInstallChangedListener.PROPERTY_VM_ARGUMENTS, fInterpreterArgs, vmArgs);
+ PropertyChangeEvent event = new PropertyChangeEvent(this, IVMInstallChangedListener.PROPERTY_VM_ARGUMENTS, fInterpreterArgs, vmArgs);
fInterpreterArgs = vmArgs;
if (fNotify) {
RubyRuntime.fireInterpreterChanged(event);
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java 2007-01-18 15:54:37 UTC (rev 1796)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java 2007-01-18 15:56:04 UTC (rev 1797)
@@ -1,42 +0,0 @@
-package org.rubypeople.rdt.launching;
-
-import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin;
-
-public interface IInterpreterInstallChangedListener {
-
-
- /**
- * Property constant indicating the name associated
- * with a VM install has changed.
- */
- public static final String PROPERTY_NAME = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_NAME"; //$NON-NLS-1$
-
- /**
- * Property constant indicating the install location of
- * a VM install has changed.
- */
- public static final String PROPERTY_INSTALL_LOCATION = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_INSTALL_LOCATION"; //$NON-NLS-1$
-
- /**
- * Property constant indicating the library locations associated
- * with a VM install have changed.
- */
- public static final String PROPERTY_LIBRARY_LOCATIONS = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_LIBRARY_LOCATIONS"; //$NON-NLS-1$
-
- /**
- * Property constant indicating the VM arguments associated
- * with a VM install has changed.
- *
- * @since 0.9.0
- */
- public static final String PROPERTY_VM_ARGUMENTS = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_VM_ARGUMENTS"; //$NON-NLS-1$
-
-
- public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current);
-
- public void vmChanged(PropertyChangeEvent event);
-
- public void vmAdded(IVMInstall newVm);
-
- public void vmRemoved(IVMInstall removedVm);
-}
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallChangedListener.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallChangedListener.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallChangedListener.java 2007-01-18 15:56:04 UTC (rev 1797)
@@ -0,0 +1,42 @@
+package org.rubypeople.rdt.launching;
+
+import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin;
+
+public interface IVMInstallChangedListener {
+
+
+ /**
+ * Property constant indicating the name associated
+ * with a VM install has changed.
+ */
+ public static final String PROPERTY_NAME = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_NAME"; //$NON-NLS-1$
+
+ /**
+ * Property constant indicating the install location of
+ * a VM install has changed.
+ */
+ public static final String PROPERTY_INSTALL_LOCATION = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_INSTALL_LOCATION"; //$NON-NLS-1$
+
+ /**
+ * Property constant indicating the library locations associated
+ * with a VM install have changed.
+ */
+ public static final String PROPERTY_LIBRARY_LOCATIONS = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_LIBRARY_LOCATIONS"; //$NON-NLS-1$
+
+ /**
+ * Property constant indicating the VM arguments associated
+ * with a VM install has changed.
+ *
+ * @since 0.9.0
+ */
+ public static final String PROPERTY_VM_ARGUMENTS = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_VM_ARGUMENTS"; //$NON-NLS-1$
+
+
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current);
+
+ public void vmChanged(PropertyChangeEvent event);
+
+ public void vmAdded(IVMInstall newVm);
+
+ public void vmRemoved(IVMInstall removedVm);
+}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:54:37 UTC (rev 1796)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:56:04 UTC (rev 1797)
@@ -118,7 +118,7 @@
return runtime;
}
- public static void removeInterpreterInstallChangedListener(IInterpreterInstallChangedListener listener) {
+ public static void removeInterpreterInstallChangedListener(IVMInstallChangedListener listener) {
fgVMListeners.remove(listener);
}
@@ -146,7 +146,7 @@
saveRuntimeConfiguration();
Object[] listeners = fgVMListeners.getListeners();
for (int i = 0; i < listeners.length; i++) {
- IInterpreterInstallChangedListener listener = (IInterpreterInstallChangedListener)listeners[i];
+ IVMInstallChangedListener listener = (IVMInstallChangedListener)listeners[i];
listener.defaultVMInstallChanged(oldInterpreter, anInterpreter);
}
}
@@ -274,7 +274,7 @@
return new File(fileLocation.toOSString());
}
- public static void addInterpreterInstallChangedListener(IInterpreterInstallChangedListener listener) {
+ public static void addInterpreterInstallChangedListener(IVMInstallChangedListener listener) {
fgVMListeners.add(listener);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 15:54:41
|
Revision: 1796
http://svn.sourceforge.net/rubyeclipse/?rev=1796&view=rev
Author: cawilliams
Date: 2007-01-18 07:54:37 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
doing some renaming back to what JDT uses - it's easier
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -33,7 +33,7 @@
import org.rubypeople.rdt.internal.ui.wizards.dialogfields.StringDialogField;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstall2;
-import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.IVMInstallType;
public class EditInterpreterDialog extends StatusDialog {
@@ -45,8 +45,8 @@
private StringDialogField fVMArgs;
- private IInterpreterInstallType fSelectedVMType;
- private IInterpreterInstallType[] fVMTypes;
+ private IVMInstallType fSelectedVMType;
+ private IVMInstallType[] fVMTypes;
private ComboDialogField fVMTypeCombo;
private IStatus[] fStati;
@@ -55,7 +55,7 @@
private IAddVMDialogRequestor fRequestor;
- public EditInterpreterDialog(IAddVMDialogRequestor requestor, Shell shell, IInterpreterInstallType[] vmInstallTypes, IVMInstall editedVM) {
+ public EditInterpreterDialog(IAddVMDialogRequestor requestor, Shell shell, IVMInstallType[] vmInstallTypes, IVMInstall editedVM) {
super(shell);
setShellStyle(getShellStyle() | SWT.RESIZE);
fRequestor= requestor;
@@ -116,7 +116,7 @@
selectVMType();
}
- private String createUniqueId(IInterpreterInstallType vmType) {
+ private String createUniqueId(IVMInstallType vmType) {
String id= null;
do {
id= String.valueOf(System.currentTimeMillis());
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -7,7 +7,7 @@
import org.rubypeople.rdt.core.LoadpathContainerInitializer;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.launching.IVMInstall;
-import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyContainerInitializer extends LoadpathContainerInitializer {
@@ -41,7 +41,7 @@
// specific Ruby VM
String vmTypeId = getInterpreterTypeId(containerPath);
String vmName = getInterpreterName(containerPath);
- IInterpreterInstallType vmType = RubyRuntime
+ IVMInstallType vmType = RubyRuntime
.getInterpreterInstallType(vmTypeId);
if (vmType != null) {
vm = vmType.findVMInstallByName(vmName);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -11,7 +11,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.rubypeople.rdt.launching.IVMInstall;
-import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.IVMRunner;
public class RubyInterpreter implements IVMInstall {
@@ -101,7 +101,7 @@
return null;
}
- public IInterpreterInstallType getVMInstallType() {
+ public IVMInstallType getVMInstallType() {
// TODO Auto-generated method stub
return null;
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -31,7 +31,7 @@
import org.eclipse.core.runtime.Path;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstall2;
-import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -107,7 +107,7 @@
*/
public void addVM(IVMInstall vm) {
if (!fVMList.contains(vm)) {
- IInterpreterInstallType vmInstallType = vm.getVMInstallType();
+ IVMInstallType vmInstallType = vm.getVMInstallType();
List vmList = (List) fVMTypeToVMMap.get(vmInstallType);
if (vmList == null) {
vmList = new ArrayList(3);
@@ -252,7 +252,7 @@
Set vmInstallTypeSet = getVMTypeToVMMap().keySet();
Iterator keyIterator = vmInstallTypeSet.iterator();
while (keyIterator.hasNext()) {
- IInterpreterInstallType vmInstallType = (IInterpreterInstallType) keyIterator.next();
+ IVMInstallType vmInstallType = (IVMInstallType) keyIterator.next();
Element vmTypeElement = vmTypeAsElement(doc, vmInstallType);
config.appendChild(vmTypeElement);
}
@@ -264,7 +264,7 @@
/**
* Create and return a node for the specified VM install type in the specified Document.
*/
- private Element vmTypeAsElement(Document doc, IInterpreterInstallType vmType) {
+ private Element vmTypeAsElement(Document doc, IVMInstallType vmType) {
// Create a node for the vm type and set its 'id' attribute
Element element= doc.createElement("vmType"); //$NON-NLS-1$
@@ -422,7 +422,7 @@
// Retrieve the 'id' attribute and the corresponding VM type object
String id = vmTypeElement.getAttribute("id"); //$NON-NLS-1$
- IInterpreterInstallType vmType= RubyRuntime.getInterpreterInstallType(id);
+ IVMInstallType vmType= RubyRuntime.getInterpreterInstallType(id);
if (vmType != null) {
// For each VM child node, populate the container with a subordinate node
@@ -446,7 +446,7 @@
* Parse the specified VM node, create a VMStandin for it, and add this to the
* specified container.
*/
- private static void populateVMForType(IInterpreterInstallType vmType, Element vmElement, VMDefinitionsContainer container) {
+ private static void populateVMForType(IVMInstallType vmType, Element vmElement, VMDefinitionsContainer container) {
String id= vmElement.getAttribute("id"); //$NON-NLS-1$
if (id != null) {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -6,12 +6,12 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.rubypeople.rdt.launching.IVMInstall;
-import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.IVMRunner;
public class VMStandin implements IVMInstall {
- public VMStandin(IInterpreterInstallType vmType, String id) {
+ public VMStandin(IVMInstallType vmType, String id) {
// TODO Auto-generated constructor stub
}
@@ -36,7 +36,7 @@
return null;
}
- public IInterpreterInstallType getVMInstallType() {
+ public IVMInstallType getVMInstallType() {
// TODO Auto-generated method stub
return null;
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -27,7 +27,7 @@
*/
public abstract class AbstractInterpreter implements IVMInstall, IVMInstall2 {
- private IInterpreterInstallType fType;
+ private IVMInstallType fType;
private String fId;
private String fName;
private File fInstallLocation;
@@ -49,7 +49,7 @@
* @throws IllegalArgumentException if any of the required
* parameters are <code>null</code>.
*/
- public AbstractInterpreter(IInterpreterInstallType type, String id) {
+ public AbstractInterpreter(IVMInstallType type, String id) {
if (type == null)
throw new IllegalArgumentException(RdtLaunchingMessages.vmInstall_assert_typeNotNull);
if (id == null)
@@ -114,7 +114,7 @@
* Subclasses should not override this method.
* @see IInterpreterInstall#getInterpreterInstallType()
*/
- public IInterpreterInstallType getVMInstallType() {
+ public IVMInstallType getVMInstallType() {
return fType;
}
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -1,24 +0,0 @@
-package org.rubypeople.rdt.launching;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-
-public interface IInterpreterInstallType {
-
- IVMInstall findVMInstallByName(String vmName);
-
- String getId();
-
- IVMInstall[] getVMInstalls();
-
- IStatus validateInstallLocation(File installLocation);
-
- IVMInstall findVMInstall(String id);
-
- IPath[] getDefaultLibraryLocations(File installLocation);
-
- String getName();
-
-}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -39,7 +39,7 @@
public String getId();
- public IInterpreterInstallType getVMInstallType();
+ public IVMInstallType getVMInstallType();
public void setLibraryLocations(IPath[] paths);
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstallType.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -0,0 +1,24 @@
+package org.rubypeople.rdt.launching;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+
+public interface IVMInstallType {
+
+ IVMInstall findVMInstallByName(String vmName);
+
+ String getId();
+
+ IVMInstall[] getVMInstalls();
+
+ IStatus validateInstallLocation(File installLocation);
+
+ IVMInstall findVMInstall(String id);
+
+ IPath[] getDefaultLibraryLocations(File installLocation);
+
+ String getName();
+
+}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:52:20 UTC (rev 1795)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:54:37 UTC (rev 1796)
@@ -90,7 +90,7 @@
*/
public static final String EXTENSION_POINT_VM_INSTALLS = "vmInstalls"; //$NON-NLS-1$
- private static IInterpreterInstallType[] fgInterpreterTypes= null;
+ private static IVMInstallType[] fgInterpreterTypes= null;
protected static RubyRuntime runtime;
private static Object fgVMLock = new Object();
@@ -284,8 +284,8 @@
* @return The VM install type for the given id, or <code>null</code> if no
* VM install type with the given id is registered.
*/
- public static IInterpreterInstallType getInterpreterInstallType(String id) {
- IInterpreterInstallType[] vmTypes= getInterpreterInstallTypes();
+ public static IVMInstallType getInterpreterInstallType(String id) {
+ IVMInstallType[] vmTypes= getInterpreterInstallTypes();
for (int i= 0; i < vmTypes.length; i++) {
if (vmTypes[i].getId().equals(id)) {
return vmTypes[i];
@@ -301,7 +301,7 @@
*
* @return the list of registered VM types
*/
- public static IInterpreterInstallType[] getInterpreterInstallTypes() {
+ public static IVMInstallType[] getInterpreterInstallTypes() {
initializeInterpreters();
return fgInterpreterTypes;
}
@@ -377,9 +377,9 @@
}
if (vmDefs != null) {
// notify of initial VMs for backwards compatibility
- IInterpreterInstallType[] installTypes = getInterpreterInstallTypes();
+ IVMInstallType[] installTypes = getInterpreterInstallTypes();
for (int i = 0; i < installTypes.length; i++) {
- IInterpreterInstallType type = installTypes[i];
+ IVMInstallType type = installTypes[i];
IVMInstall[] installs = type.getVMInstalls();
for (int j = 0; j < installs.length; j++) {
fireInterpreterAdded(installs[j]);
@@ -410,11 +410,11 @@
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(RdtLaunchingPlugin.PLUGIN_ID, "vmInstallTypes"); //$NON-NLS-1$
IConfigurationElement[] configs= extensionPoint.getConfigurationElements();
MultiStatus status= new MultiStatus(RdtLaunchingPlugin.getUniqueIdentifier(), IStatus.OK, RdtLaunchingMessages.RubyRuntime_exceptionOccurred, null);
- fgInterpreterTypes= new IInterpreterInstallType[configs.length];
+ fgInterpreterTypes= new IVMInstallType[configs.length];
for (int i= 0; i < configs.length; i++) {
try {
- IInterpreterInstallType vmType= (IInterpreterInstallType)configs[i].createExecutableExtension("class"); //$NON-NLS-1$
+ IVMInstallType vmType= (IVMInstallType)configs[i].createExecutableExtension("class"); //$NON-NLS-1$
fgInterpreterTypes[i]= vmType;
} catch (CoreException e) {
status.add(e.getStatus());
@@ -424,12 +424,12 @@
//only happens on a CoreException
RdtLaunchingPlugin.log(status);
//cleanup null entries in fgVMTypes
- List<IInterpreterInstallType> temp= new ArrayList<IInterpreterInstallType>(fgInterpreterTypes.length);
+ List<IVMInstallType> temp= new ArrayList<IVMInstallType>(fgInterpreterTypes.length);
for (int i = 0; i < fgInterpreterTypes.length; i++) {
if(fgInterpreterTypes[i] != null) {
temp.add(fgInterpreterTypes[i]);
}
- fgInterpreterTypes= new IInterpreterInstallType[temp.size()];
+ fgInterpreterTypes= new IVMInstallType[temp.size()];
fgInterpreterTypes= temp.toArray(fgInterpreterTypes);
}
}
@@ -493,7 +493,7 @@
if (vm == null) {
return null;
}
- IInterpreterInstallType vmType= vm.getVMInstallType();
+ IVMInstallType vmType= vm.getVMInstallType();
String typeID= vmType.getId();
CompositeId id= new CompositeId(new String[] { typeID, vm.getId() });
return id.toString();
@@ -520,7 +520,7 @@
abort(MessageFormat.format("Missing required id attribute for vmInstall contributed by {0}", //$NON-NLS-1$
(Object[]) new String[]{element.getContributor().getName()}), null);
}
- IInterpreterInstallType installType = getInterpreterInstallType(vmType);
+ IVMInstallType installType = getInterpreterInstallType(vmType);
if (installType == null) {
abort(MessageFormat.format("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
(Object[]) new String[]{id, element.getContributor().getName(), vmType}), null);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 15:52:22
|
Revision: 1795
http://svn.sourceforge.net/rubyeclipse/?rev=1795&view=rev
Author: cawilliams
Date: 2007-01-18 07:52:20 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
doing some renaming back to what JDT uses - it's easier
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:50:52 UTC (rev 1794)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:52:20 UTC (rev 1795)
@@ -120,7 +120,7 @@
String id= null;
do {
id= String.valueOf(System.currentTimeMillis());
- } while (vmType.findInterpreterInstall(id) != null);
+ } while (vmType.findVMInstall(id) != null);
return id;
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 15:50:52 UTC (rev 1794)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 15:52:20 UTC (rev 1795)
@@ -44,7 +44,7 @@
IInterpreterInstallType vmType = RubyRuntime
.getInterpreterInstallType(vmTypeId);
if (vmType != null) {
- vm = vmType.findInterpreterInstallByName(vmName);
+ vm = vmType.findVMInstallByName(vmName);
}
} else {
// workspace default Ruby VM
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 15:50:52 UTC (rev 1794)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 15:52:20 UTC (rev 1795)
@@ -44,19 +44,19 @@
fgLoadpathEntries = new HashMap(10);
// add a listener to clear cached value when a VM changes or is removed
IInterpreterInstallChangedListener listener = new IInterpreterInstallChangedListener() {
- public void defaultInterpreterInstallChanged(IVMInstall previous, IVMInstall current) {
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
}
- public void interpreterChanged(PropertyChangeEvent event) {
+ public void vmChanged(PropertyChangeEvent event) {
if (event.getSource() != null) {
fgLoadpathEntries.remove(event.getSource());
}
}
- public void interpreterAdded(IVMInstall newVm) {
+ public void vmAdded(IVMInstall newVm) {
}
- public void interpreterRemoved(IVMInstall removedVm) {
+ public void vmRemoved(IVMInstall removedVm) {
fgLoadpathEntries.remove(removedVm);
}
};
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java 2007-01-18 15:50:52 UTC (rev 1794)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java 2007-01-18 15:52:20 UTC (rev 1795)
@@ -32,11 +32,11 @@
public static final String PROPERTY_VM_ARGUMENTS = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_VM_ARGUMENTS"; //$NON-NLS-1$
- public void defaultInterpreterInstallChanged(IVMInstall previous, IVMInstall current);
+ public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current);
- public void interpreterChanged(PropertyChangeEvent event);
+ public void vmChanged(PropertyChangeEvent event);
- public void interpreterAdded(IVMInstall newVm);
+ public void vmAdded(IVMInstall newVm);
- public void interpreterRemoved(IVMInstall removedVm);
+ public void vmRemoved(IVMInstall removedVm);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:50:52 UTC (rev 1794)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:52:20 UTC (rev 1795)
@@ -7,15 +7,15 @@
public interface IInterpreterInstallType {
- IVMInstall findInterpreterInstallByName(String vmName);
+ IVMInstall findVMInstallByName(String vmName);
String getId();
- IVMInstall[] getInterpreterInstalls();
+ IVMInstall[] getVMInstalls();
IStatus validateInstallLocation(File installLocation);
- IVMInstall findInterpreterInstall(String id);
+ IVMInstall findVMInstall(String id);
IPath[] getDefaultLibraryLocations(File installLocation);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:50:52 UTC (rev 1794)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:52:20 UTC (rev 1795)
@@ -147,7 +147,7 @@
Object[] listeners = fgVMListeners.getListeners();
for (int i = 0; i < listeners.length; i++) {
IInterpreterInstallChangedListener listener = (IInterpreterInstallChangedListener)listeners[i];
- listener.defaultInterpreterInstallChanged(oldInterpreter, anInterpreter);
+ listener.defaultVMInstallChanged(oldInterpreter, anInterpreter);
}
}
@@ -380,7 +380,7 @@
IInterpreterInstallType[] installTypes = getInterpreterInstallTypes();
for (int i = 0; i < installTypes.length; i++) {
IInterpreterInstallType type = installTypes[i];
- IVMInstall[] installs = type.getInterpreterInstalls();
+ IVMInstall[] installs = type.getVMInstalls();
for (int j = 0; j < installs.length; j++) {
fireInterpreterAdded(installs[j]);
}
@@ -525,7 +525,7 @@
abort(MessageFormat.format("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
(Object[]) new String[]{id, element.getContributor().getName(), vmType}), null);
}
- IVMInstall install = installType.findInterpreterInstall(id);
+ IVMInstall install = installType.findVMInstall(id);
if (install == null) {
// only load/create if first time we've seen this VM install
String name = element.getAttribute("name"); //$NON-NLS-1$
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 15:50:57
|
Revision: 1794
http://svn.sourceforge.net/rubyeclipse/?rev=1794&view=rev
Author: cawilliams
Date: 2007-01-18 07:50:52 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
doing some renaming back to what JDT uses - it's easier
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -65,7 +65,7 @@
}
fVMTypes= vmInstallTypes;
- fSelectedVMType= editedVM != null ? editedVM.getInterpreterInstallType() : vmInstallTypes[0];
+ fSelectedVMType= editedVM != null ? editedVM.getVMInstallType() : vmInstallTypes[0];
fEditedVM= editedVM;
}
@@ -223,7 +223,7 @@
fVMArgs.setText(vmArgs);
}
} else {
- String[] vmArgs = fEditedVM.getInterpreterArguments();
+ String[] vmArgs = fEditedVM.getVMArguments();
if (vmArgs != null) {
StringBuffer buffer = new StringBuffer();
int length= vmArgs.length;
@@ -326,15 +326,15 @@
if (vm instanceof IVMInstall2) {
IVMInstall2 vm2 = (IVMInstall2) vm;
if (argString != null && argString.length() >0) {
- vm2.setInterpreterArgs(argString);
+ vm2.setVMArgs(argString);
} else {
- vm2.setInterpreterArgs(null);
+ vm2.setVMArgs(null);
}
} else {
if (argString != null && argString.length() >0) {
- vm.setInterpreterArguments(DebugPlugin.parseArguments(argString));
+ vm.setVMArguments(DebugPlugin.parseArguments(argString));
} else {
- vm.setInterpreterArguments(null);
+ vm.setVMArguments(null);
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -96,17 +96,17 @@
return null;
}
- public String[] getInterpreterArguments() {
+ public String[] getVMArguments() {
// TODO Auto-generated method stub
return null;
}
- public IInterpreterInstallType getInterpreterInstallType() {
+ public IInterpreterInstallType getVMInstallType() {
// TODO Auto-generated method stub
return null;
}
- public IVMRunner getInterpreterRunner(String mode) {
+ public IVMRunner getVMRunner(String mode) {
// TODO Auto-generated method stub
return null;
}
@@ -120,7 +120,7 @@
this.installLocation = validInstallLocation;
}
- public void setInterpreterArguments(String[] vmArgs) {
+ public void setVMArguments(String[] vmArgs) {
// TODO Auto-generated method stub
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -107,7 +107,7 @@
*/
public void addVM(IVMInstall vm) {
if (!fVMList.contains(vm)) {
- IInterpreterInstallType vmInstallType = vm.getInterpreterInstallType();
+ IInterpreterInstallType vmInstallType = vm.getVMInstallType();
List vmList = (List) fVMTypeToVMMap.get(vmInstallType);
if (vmList == null) {
vmList = new ArrayList(3);
@@ -313,7 +313,7 @@
element.setAttribute("vmargs", vmArgs); //$NON-NLS-1$
}
} else {
- String[] vmArgs = vm.getInterpreterArguments();
+ String[] vmArgs = vm.getVMArguments();
if (vmArgs != null && vmArgs.length > 0) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < vmArgs.length; i++) {
@@ -532,7 +532,7 @@
public void removeVM(IVMInstall vm) {
fVMList.remove(vm);
fInvalidVMList.remove(vm);
- List list = (List) fVMTypeToVMMap.get(vm.getInterpreterInstallType());
+ List list = (List) fVMTypeToVMMap.get(vm.getVMInstallType());
if (list != null) {
list.remove(vm);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -36,7 +36,7 @@
return null;
}
- public IInterpreterInstallType getInterpreterInstallType() {
+ public IInterpreterInstallType getVMInstallType() {
// TODO Auto-generated method stub
return null;
}
@@ -51,7 +51,7 @@
return null;
}
- public String[] getInterpreterArguments() {
+ public String[] getVMArguments() {
// TODO Auto-generated method stub
return null;
}
@@ -76,12 +76,12 @@
}
- public IVMRunner getInterpreterRunner(String mode) {
+ public IVMRunner getVMRunner(String mode) {
// TODO Auto-generated method stub
return null;
}
- public void setInterpreterArguments(String[] vmArgs) {
+ public void setVMArguments(String[] vmArgs) {
// TODO Auto-generated method stub
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -114,14 +114,14 @@
* Subclasses should not override this method.
* @see IInterpreterInstall#getInterpreterInstallType()
*/
- public IInterpreterInstallType getInterpreterInstallType() {
+ public IInterpreterInstallType getVMInstallType() {
return fType;
}
/* (non-Rubydoc)
* @see IInterpreter#getInterpreterRunner(String)
*/
- public IVMRunner getInterpreterRunner(String mode) {
+ public IVMRunner getVMRunner(String mode) {
return null;
}
@@ -141,11 +141,11 @@
}
IPath[] newLocations = locations;
if (newLocations == null) {
- newLocations = getInterpreterInstallType().getDefaultLibraryLocations(getInstallLocation());
+ newLocations = getVMInstallType().getDefaultLibraryLocations(getInstallLocation());
}
IPath[] prevLocations = fSystemLibraryDescriptions;
if (prevLocations == null) {
- prevLocations = getInterpreterInstallType().getDefaultLibraryLocations(getInstallLocation());
+ prevLocations = getVMInstallType().getDefaultLibraryLocations(getInstallLocation());
}
if (newLocations.length == prevLocations.length) {
@@ -185,7 +185,7 @@
public boolean equals(Object object) {
if (object instanceof IVMInstall) {
IVMInstall vm = (IVMInstall)object;
- return getInterpreterInstallType().equals(vm.getInterpreterInstallType()) &&
+ return getVMInstallType().equals(vm.getVMInstallType()) &&
getId().equals(vm.getId());
}
return false;
@@ -196,14 +196,14 @@
* @since 2.1
*/
public int hashCode() {
- return getInterpreterInstallType().hashCode() + getId().hashCode();
+ return getVMInstallType().hashCode() + getId().hashCode();
}
/* (non-Rubydoc)
* @see org.rubypeople.rdt.launching.IInterpreter#getDefaultInterpreterArguments()
* @since 3.0
*/
- public String[] getInterpreterArguments() {
+ public String[] getVMArguments() {
String args = getInterpreterArgs();
if (args == null) {
return null;
@@ -216,9 +216,9 @@
* @see org.rubypeople.rdt.launching.IInterpreter#setDefaultInterpreterArguments(java.lang.String[])
* @since 3.0
*/
- public void setInterpreterArguments(String[] vmArgs) {
+ public void setVMArguments(String[] vmArgs) {
if (vmArgs == null) {
- setInterpreterArgs(null);
+ setVMArgs(null);
} else {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < vmArgs.length; i++) {
@@ -226,7 +226,7 @@
buf.append(string);
buf.append(" "); //$NON-NLS-1$
}
- setInterpreterArgs(buf.toString().trim());
+ setVMArgs(buf.toString().trim());
}
}
@@ -240,7 +240,7 @@
/* (non-Rubydoc)
* @see org.rubypeople.rdt.launching.IInterpreter2#setInterpreterArgs(java.lang.String)
*/
- public void setInterpreterArgs(String vmArgs) {
+ public void setVMArgs(String vmArgs) {
if (fInterpreterArgs == null) {
if (vmArgs == null) {
// No change
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -17,21 +17,35 @@
public void setName(String newName);
+ /**
+ *
+ * @return
+ * @throws IllegalCommandException
+ * @deprecated
+ */
public String getCommand() throws IllegalCommandException;
+ /**
+ *
+ * @param commandLine
+ * @param workingDirectory
+ * @return
+ * @throws CoreException
+ * @deprecated This doesn't match JDT behavior. We'll need to work on a better solution.
+ */
public Process exec(List commandLine, File workingDirectory) throws CoreException;
public IPath[] getLibraryLocations();
public String getId();
- public IInterpreterInstallType getInterpreterInstallType();
+ public IInterpreterInstallType getVMInstallType();
public void setLibraryLocations(IPath[] paths);
- public String[] getInterpreterArguments();
+ public String[] getVMArguments();
- public void setInterpreterArguments(String[] vmArgs);
+ public void setVMArguments(String[] vmArgs);
- public IVMRunner getInterpreterRunner(String mode);
+ public IVMRunner getVMRunner(String mode);
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -6,6 +6,6 @@
public String getRubyVersion();
- public void setInterpreterArgs(String vmArgs);
+ public void setVMArgs(String vmArgs);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:48:30 UTC (rev 1793)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:50:52 UTC (rev 1794)
@@ -493,7 +493,7 @@
if (vm == null) {
return null;
}
- IInterpreterInstallType vmType= vm.getInterpreterInstallType();
+ IInterpreterInstallType vmType= vm.getVMInstallType();
String typeID= vmType.getId();
CompositeId id= new CompositeId(new String[] { typeID, vm.getId() });
return id.toString();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 15:48:31
|
Revision: 1793
http://svn.sourceforge.net/rubyeclipse/?rev=1793&view=rev
Author: cawilliams
Date: 2007-01-18 07:48:30 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
doing some renaming back to what JDT uses - it's easier
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall.java 2007-01-18 15:48:30 UTC (rev 1793)
@@ -0,0 +1,37 @@
+package org.rubypeople.rdt.launching;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.rubypeople.rdt.internal.launching.IllegalCommandException;
+
+public interface IVMInstall {
+
+ public File getInstallLocation();
+
+ public void setInstallLocation(File validInstallLocation);
+
+ public String getName();
+
+ public void setName(String newName);
+
+ public String getCommand() throws IllegalCommandException;
+
+ public Process exec(List commandLine, File workingDirectory) throws CoreException;
+
+ public IPath[] getLibraryLocations();
+
+ public String getId();
+
+ public IInterpreterInstallType getInterpreterInstallType();
+
+ public void setLibraryLocations(IPath[] paths);
+
+ public String[] getInterpreterArguments();
+
+ public void setInterpreterArguments(String[] vmArgs);
+
+ public IVMRunner getInterpreterRunner(String mode);
+}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IVMInstall2.java 2007-01-18 15:48:30 UTC (rev 1793)
@@ -0,0 +1,11 @@
+package org.rubypeople.rdt.launching;
+
+public interface IVMInstall2 {
+
+ public String getVMArgs();
+
+ public String getRubyVersion();
+
+ public void setInterpreterArgs(String vmArgs);
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 15:43:50
|
Revision: 1792
http://svn.sourceforge.net/rubyeclipse/?rev=1792&view=rev
Author: cawilliams
Date: 2007-01-18 07:43:49 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
doing some renaming back to what JDT uses - it's easier
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
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/IAddVMDialogRequestor.java
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter2.java
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -18,7 +18,7 @@
import org.rubypeople.rdt.internal.debug.core.RubyLineBreakpoint;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
/*
@@ -36,7 +36,7 @@
// to be set accordingly
String rubyInterpreterPath = FTC_ClassicDebuggerCommunicationTest.RUBY_INTERPRETER ;
System.out.println("Using interpreter: " + rubyInterpreterPath) ;
- IInterpreter rubyInterpreter = new RubyInterpreter("RubyInterpreter", new File(rubyInterpreterPath));
+ IVMInstall rubyInterpreter = new RubyInterpreter("RubyInterpreter", new File(rubyInterpreterPath));
RubyRuntime.getDefault().addInstalledInterpreter(rubyInterpreter) ;
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -38,7 +38,7 @@
import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyEnvironmentTab extends AbstractLaunchConfigurationTab {
@@ -170,7 +170,7 @@
return false;
}
- public void vmAdded(IInterpreter vm) {
+ public void vmAdded(IVMInstall vm) {
RubyRuntime.getDefault().addInstalledInterpreter(vm);
fCombo.add(vm.getName());
fCombo.select(fCombo.indexOf(vm.getName()));
@@ -194,7 +194,7 @@
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- IInterpreter defaultInterpreter = RubyRuntime.getDefault()
+ IVMInstall defaultInterpreter = RubyRuntime.getDefault()
.getSelectedInterpreter();
if (defaultInterpreter != null) {
configuration.setAttribute(
@@ -261,13 +261,13 @@
.size()];
for (int interpreterIndex = 0; interpreterIndex < installedInterpretersWorkingCopy
.size(); interpreterIndex++) {
- IInterpreter interpreter = (IInterpreter) installedInterpretersWorkingCopy
+ IVMInstall interpreter = (IVMInstall) installedInterpretersWorkingCopy
.get(interpreterIndex);
interpreterNames[interpreterIndex] = interpreter.getName();
}
interpreterCombo.setItems(interpreterNames);
- IInterpreter selectedInterpreter = RubyRuntime.getDefault()
+ IVMInstall selectedInterpreter = RubyRuntime.getDefault()
.getSelectedInterpreter();
if (selectedInterpreter != null)
interpreterCombo.select(interpreterCombo
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -31,15 +31,15 @@
import org.rubypeople.rdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
import org.rubypeople.rdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
import org.rubypeople.rdt.internal.ui.wizards.dialogfields.StringDialogField;
-import org.rubypeople.rdt.launching.IInterpreter;
-import org.rubypeople.rdt.launching.IInterpreter2;
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstall2;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
public class EditInterpreterDialog extends StatusDialog {
protected IStatus[] allStatus = new IStatus[2];
- protected IInterpreter fEditedVM;
+ protected IVMInstall fEditedVM;
private StringButtonDialogField fJRERoot;
private StringDialogField fVMName;
@@ -55,7 +55,7 @@
private IAddVMDialogRequestor fRequestor;
- public EditInterpreterDialog(IAddVMDialogRequestor requestor, Shell shell, IInterpreterInstallType[] vmInstallTypes, IInterpreter editedVM) {
+ public EditInterpreterDialog(IAddVMDialogRequestor requestor, Shell shell, IInterpreterInstallType[] vmInstallTypes, IVMInstall editedVM) {
super(shell);
setShellStyle(getShellStyle() | SWT.RESIZE);
fRequestor= requestor;
@@ -102,7 +102,7 @@
private void doOkPressed() {
if (fEditedVM == null) {
- IInterpreter vm= new VMStandin(fSelectedVMType, createUniqueId(fSelectedVMType));
+ IVMInstall vm= new VMStandin(fSelectedVMType, createUniqueId(fSelectedVMType));
setFieldValuesToVM(vm);
fRequestor.vmAdded(vm);
} else {
@@ -216,8 +216,8 @@
fVMName.setText(fEditedVM.getName());
fJRERoot.setText(fEditedVM.getInstallLocation().getAbsolutePath());
// fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
- if (fEditedVM instanceof IInterpreter2) {
- IInterpreter2 vm2 = (IInterpreter2) fEditedVM;
+ if (fEditedVM instanceof IVMInstall2) {
+ IVMInstall2 vm2 = (IVMInstall2) fEditedVM;
String vmArgs = vm2.getVMArgs();
if (vmArgs != null) {
fVMArgs.setText(vmArgs);
@@ -313,7 +313,7 @@
return names;
}
- protected void setFieldValuesToVM(IInterpreter vm) {
+ protected void setFieldValuesToVM(IVMInstall vm) {
File dir = new File(fJRERoot.getText());
try {
vm.setInstallLocation(dir.getCanonicalFile());
@@ -323,8 +323,8 @@
vm.setName(fVMName.getText());
String argString = fVMArgs.getText().trim();
- if (vm instanceof IInterpreter2) {
- IInterpreter2 vm2 = (IInterpreter2) vm;
+ if (vm instanceof IVMInstall2) {
+ IVMInstall2 vm2 = (IVMInstall2) vm;
if (argString != null && argString.length() >0) {
vm2.setInterpreterArgs(argString);
} else {
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-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterLabelProvider.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -5,7 +5,7 @@
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
public class RubyInterpreterLabelProvider implements ITableLabelProvider {
@@ -18,7 +18,7 @@
}
public String getColumnText(Object element, int columnIndex) {
- IInterpreter interpreter = (IInterpreter) element;
+ IVMInstall interpreter = (IVMInstall) element;
switch (columnIndex) {
case 0 :
return interpreter.getName();
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-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -29,7 +29,7 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.debug.ui.rubyvms.IAddVMDialogRequestor;
import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyInterpreterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IAddVMDialogRequestor {
@@ -57,7 +57,7 @@
createButtonGroup(composite);
fVMList.setInput(RubyRuntime.getDefault().getInstalledInterpreters());
- IInterpreter selectedInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
+ IVMInstall selectedInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
if (selectedInterpreter != null)
fVMList.setChecked(selectedInterpreter, true);
@@ -187,7 +187,7 @@
protected void editInterpreter() {
IStructuredSelection selection= (IStructuredSelection)fVMList.getSelection();
- IInterpreter vm= (IInterpreter)selection.getFirstElement();
+ IVMInstall vm= (IVMInstall)selection.getFirstElement();
if (vm == null) {
return;
}
@@ -204,9 +204,9 @@
// }
}
- protected IInterpreter getSelectedInterpreter() {
+ protected IVMInstall getSelectedInterpreter() {
IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection();
- return (IInterpreter) selection.getFirstElement();
+ return (IVMInstall) selection.getFirstElement();
}
public boolean performOk() {
@@ -218,14 +218,14 @@
Object[] checkedElements = fVMList.getCheckedElements();
if (checkedElements.length > 0)
- RubyRuntime.getDefault().setSelectedInterpreter((IInterpreter) checkedElements[0]);
+ RubyRuntime.getDefault().setSelectedInterpreter((IVMInstall) checkedElements[0]);
return super.performOk();
}
public boolean isDuplicateName(String name) {
for (int i= 0; i < fVMs.size(); i++) {
- IInterpreter vm = (IInterpreter)fVMs.get(i);
+ IVMInstall vm = (IVMInstall)fVMs.get(i);
if (vm.getName().equals(name)) {
return true;
}
@@ -233,7 +233,7 @@
return false;
}
- public void vmAdded(IInterpreter vm) {
+ public void vmAdded(IVMInstall vm) {
fVMs.add(vm);
fVMList.refresh();
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.rubypeople.rdt.internal.debug.ui.rubyvms;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
/**
* This interface is implemented by clients of the <code>AddVMDialog</code>.
@@ -31,6 +31,6 @@
*
* @param vm the added vm
*/
- public void vmAdded(IInterpreter vm);
+ public void vmAdded(IVMInstall vm);
}
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -24,7 +24,7 @@
import org.rubypeople.rdt.internal.debug.ui.RubySourceLocator;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.IRubyConstants;
@@ -76,8 +76,8 @@
Assert.assertEquals("All configurations deleted.", 0, this.getLaunchConfigurations().length);
ShamApplicationLaunchConfigurationDelegate.resetLaunches();
- IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:/RubyInstallRootOne"));
- RubyRuntime.getDefault().setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne}));
+ IVMInstall interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:/RubyInstallRootOne"));
+ RubyRuntime.getDefault().setInstalledInterpreters(Arrays.asList(new IVMInstall[] { interpreterOne}));
super.setUp();
}
@@ -90,7 +90,7 @@
public void testNoInterpreterInstalled() throws Exception {
- RubyRuntime.getDefault().setInstalledInterpreters(Arrays.asList(new IInterpreter[] { }));
+ RubyRuntime.getDefault().setInstalledInterpreters(Arrays.asList(new IVMInstall[] { }));
ISelection selection = new StructuredSelection(rubyFile);
shortcut.launch(selection, ILaunchManager.RUN_MODE);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -14,7 +14,7 @@
import org.rubypeople.rdt.internal.debug.core.RdtDebugCorePlugin;
import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy;
import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
public class DebuggerRunner extends InterpreterRunner {
@@ -84,7 +84,7 @@
return RdtLaunchingPlugin.getDefault().getPluginPreferences().getBoolean(PreferenceConstants.VERBOSE_DEBUGGER);
}
- protected IInterpreter convertInterpreter(IInterpreter rubyInterpreter) {
+ protected IVMInstall convertInterpreter(IVMInstall rubyInterpreter) {
if (isUseRubyDebug()) {
IPath rdebugLocation = new Path(rubyInterpreter.getInstallLocation().getAbsolutePath()).removeLastSegments(1);
rdebugLocation = rdebugLocation.append("rdebug");
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -10,7 +10,7 @@
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IProcess;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
public class InterpreterRunner {
@@ -20,7 +20,7 @@
List commandLine = renderCommandLine(configuration);
File workingDirectory = configuration.getAbsoluteWorkingDirectory();
- IInterpreter interpreter = convertInterpreter(configuration.getInterpreter());
+ IVMInstall interpreter = convertInterpreter(configuration.getInterpreter());
Process nativeRubyProcess = interpreter.exec(commandLine, workingDirectory);
Map defaultAttributes = new HashMap();
defaultAttributes.put(IProcess.ATTR_PROCESS_TYPE, "ruby");
@@ -29,7 +29,7 @@
return process ;
}
- protected IInterpreter convertInterpreter(IInterpreter rubyInterpreter) {
+ protected IVMInstall convertInterpreter(IVMInstall rubyInterpreter) {
return rubyInterpreter;
}
@@ -37,7 +37,7 @@
StringBuffer buffer = new StringBuffer();
try {
- IInterpreter interpreter = configuration.getInterpreter();
+ IVMInstall interpreter = configuration.getInterpreter();
buffer.append("Ruby ");
buffer.append(interpreter.getCommand());
buffer.append(" : ");
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -12,7 +12,7 @@
import org.rubypeople.rdt.core.ILoadpathEntry;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.RubyProject;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
public class InterpreterRunnerConfiguration {
@@ -93,7 +93,7 @@
return "";
}
- public IInterpreter getInterpreter() {
+ public IVMInstall getInterpreter() {
String selectedInterpreter = null;
try {
selectedInterpreter = configuration.getAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -6,7 +6,7 @@
import org.rubypeople.rdt.core.IRubyProject;
import org.rubypeople.rdt.core.LoadpathContainerInitializer;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -18,7 +18,7 @@
int size = containerPath.segmentCount();
if (size > 0) {
if (containerPath.segment(0).equals(RubyRuntime.RUBY_CONTAINER)) {
- IInterpreter vm = resolveInterpreter(containerPath);
+ IVMInstall vm = resolveInterpreter(containerPath);
RubyVMContainer container = null;
if (vm != null) {
container = new RubyVMContainer(vm, containerPath);
@@ -35,8 +35,8 @@
* Returns the VM install associated with the container path, or
* <code>null</code> if it does not exist.
*/
- public static IInterpreter resolveInterpreter(IPath containerPath) {
- IInterpreter vm = null;
+ public static IVMInstall resolveInterpreter(IPath containerPath) {
+ IVMInstall vm = null;
if (containerPath.segmentCount() > 1) {
// specific Ruby VM
String vmTypeId = getInterpreterTypeId(containerPath);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyInterpreter.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -10,11 +10,11 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
import org.rubypeople.rdt.launching.IVMRunner;
-public class RubyInterpreter implements IInterpreter {
+public class RubyInterpreter implements IVMInstall {
public static final String END_OF_OPTIONS_DELIMITER = "--";
protected File installLocation;
@@ -83,7 +83,7 @@
public boolean equals(Object other) {
if (other instanceof RubyInterpreter) {
- IInterpreter otherInterpreter = (IInterpreter) other;
+ IVMInstall otherInterpreter = (IVMInstall) other;
if (name.equals(otherInterpreter.getName()))
return installLocation.equals(otherInterpreter.getInstallLocation());
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -9,7 +9,7 @@
import org.rubypeople.rdt.core.ILoadpathContainer;
import org.rubypeople.rdt.core.ILoadpathEntry;
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -17,10 +17,10 @@
public class RubyVMContainer implements ILoadpathContainer {
private static Map fgLoadpathEntries;
- private IInterpreter fInterpreter;
+ private IVMInstall fInterpreter;
private IPath fPath;
- public RubyVMContainer(IInterpreter interpreter, IPath path) {
+ public RubyVMContainer(IVMInstall interpreter, IPath path) {
fInterpreter = interpreter;
fPath = path;
}
@@ -39,12 +39,12 @@
* @param vm
* @return loadpath entries
*/
- private static ILoadpathEntry[] getLoadpathEntries(IInterpreter vm) {
+ private static ILoadpathEntry[] getLoadpathEntries(IVMInstall vm) {
if (fgLoadpathEntries == null) {
fgLoadpathEntries = new HashMap(10);
// add a listener to clear cached value when a VM changes or is removed
IInterpreterInstallChangedListener listener = new IInterpreterInstallChangedListener() {
- public void defaultInterpreterInstallChanged(IInterpreter previous, IInterpreter current) {
+ public void defaultInterpreterInstallChanged(IVMInstall previous, IVMInstall current) {
}
public void interpreterChanged(PropertyChangeEvent event) {
@@ -53,10 +53,10 @@
}
}
- public void interpreterAdded(IInterpreter newVm) {
+ public void interpreterAdded(IVMInstall newVm) {
}
- public void interpreterRemoved(IInterpreter removedVm) {
+ public void interpreterRemoved(IVMInstall removedVm) {
fgLoadpathEntries.remove(removedVm);
}
};
@@ -76,7 +76,7 @@
* @param vm
* @return loadpath entries
*/
- private static ILoadpathEntry[] computeLoadpathEntries(IInterpreter vm) {
+ private static ILoadpathEntry[] computeLoadpathEntries(IVMInstall vm) {
IPath[] libs = vm.getLibraryLocations();
List entries = new ArrayList(libs.length);
for (int i = 0; i < libs.length; i++) {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -29,8 +29,8 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.rubypeople.rdt.launching.IInterpreter;
-import org.rubypeople.rdt.launching.IInterpreter2;
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstall2;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.w3c.dom.Document;
@@ -105,7 +105,7 @@
*
* @param vm the VM to be added to this container
*/
- public void addVM(IInterpreter vm) {
+ public void addVM(IVMInstall vm) {
if (!fVMList.contains(vm)) {
IInterpreterInstallType vmInstallType = vm.getInterpreterInstallType();
List vmList = (List) fVMTypeToVMMap.get(vmInstallType);
@@ -135,7 +135,7 @@
public void addVMList(List vmList) {
Iterator iterator = vmList.iterator();
while (iterator.hasNext()) {
- IInterpreter vm = (IInterpreter) iterator.next();
+ IVMInstall vm = (IVMInstall) iterator.next();
addVM(vm);
}
}
@@ -274,7 +274,7 @@
List vmList = (List) getVMTypeToVMMap().get(vmType);
Iterator vmIterator = vmList.iterator();
while (vmIterator.hasNext()) {
- IInterpreter vm = (IInterpreter) vmIterator.next();
+ IVMInstall vm = (IVMInstall) vmIterator.next();
Element vmElement = vmAsElement(doc, vm);
element.appendChild(vmElement);
}
@@ -285,7 +285,7 @@
/**
* Create and return a node for the specified VM in the specified Document.
*/
- private Element vmAsElement(Document doc, IInterpreter vm) {
+ private Element vmAsElement(Document doc, IVMInstall vm) {
// Create the node for the VM and set its 'id' & 'name' attributes
Element element= doc.createElement("vm"); //$NON-NLS-1$
@@ -307,8 +307,8 @@
element.appendChild(libLocationElement);
}
- if (vm instanceof IInterpreter2) {
- String vmArgs = ((IInterpreter2)vm).getVMArgs();
+ if (vm instanceof IVMInstall2) {
+ String vmArgs = ((IVMInstall2)vm).getVMArgs();
if (vmArgs != null && vmArgs.length() > 0) {
element.setAttribute("vmargs", vmArgs); //$NON-NLS-1$
}
@@ -507,7 +507,7 @@
* Set the LibraryLocations on the specified VM, by extracting the subordinate
* nodes from the specified 'lirbaryLocations' node.
*/
- private static void setLibraryLocations(IInterpreter vm, Element libLocationsElement) {
+ private static void setLibraryLocations(IVMInstall vm, Element libLocationsElement) {
NodeList list = libLocationsElement.getChildNodes();
int length = list.getLength();
List locations = new ArrayList(length);
@@ -529,7 +529,7 @@
*
* @param vm vm intall
*/
- public void removeVM(IInterpreter vm) {
+ public void removeVM(IVMInstall vm) {
fVMList.remove(vm);
fInvalidVMList.remove(vm);
List list = (List) fVMTypeToVMMap.get(vm.getInterpreterInstallType());
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMStandin.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -5,11 +5,11 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
import org.rubypeople.rdt.launching.IVMRunner;
-public class VMStandin implements IInterpreter {
+public class VMStandin implements IVMInstall {
public VMStandin(IInterpreterInstallType vmType, String id) {
// TODO Auto-generated constructor stub
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -25,7 +25,7 @@
* Clients implementing Interpreter installs must subclass this class.
* </p>
*/
-public abstract class AbstractInterpreter implements IInterpreter, IInterpreter2 {
+public abstract class AbstractInterpreter implements IVMInstall, IVMInstall2 {
private IInterpreterInstallType fType;
private String fId;
@@ -183,8 +183,8 @@
* @since 2.1
*/
public boolean equals(Object object) {
- if (object instanceof IInterpreter) {
- IInterpreter vm = (IInterpreter)object;
+ if (object instanceof IVMInstall) {
+ IVMInstall vm = (IVMInstall)object;
return getInterpreterInstallType().equals(vm.getInterpreterInstallType()) &&
getId().equals(vm.getId());
}
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -1,37 +0,0 @@
-package org.rubypeople.rdt.launching;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.rubypeople.rdt.internal.launching.IllegalCommandException;
-
-public interface IInterpreter {
-
- public File getInstallLocation();
-
- public void setInstallLocation(File validInstallLocation);
-
- public String getName();
-
- public void setName(String newName);
-
- public String getCommand() throws IllegalCommandException;
-
- public Process exec(List commandLine, File workingDirectory) throws CoreException;
-
- public IPath[] getLibraryLocations();
-
- public String getId();
-
- public IInterpreterInstallType getInterpreterInstallType();
-
- public void setLibraryLocations(IPath[] paths);
-
- public String[] getInterpreterArguments();
-
- public void setInterpreterArguments(String[] vmArgs);
-
- public IVMRunner getInterpreterRunner(String mode);
-}
\ No newline at end of file
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter2.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter2.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreter2.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -1,11 +0,0 @@
-package org.rubypeople.rdt.launching;
-
-public interface IInterpreter2 {
-
- public String getVMArgs();
-
- public String getRubyVersion();
-
- public void setInterpreterArgs(String vmArgs);
-
-}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallChangedListener.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -32,11 +32,11 @@
public static final String PROPERTY_VM_ARGUMENTS = RdtLaunchingPlugin.getUniqueIdentifier() + ".PROPERTY_VM_ARGUMENTS"; //$NON-NLS-1$
- public void defaultInterpreterInstallChanged(IInterpreter previous, IInterpreter current);
+ public void defaultInterpreterInstallChanged(IVMInstall previous, IVMInstall current);
public void interpreterChanged(PropertyChangeEvent event);
- public void interpreterAdded(IInterpreter newVm);
+ public void interpreterAdded(IVMInstall newVm);
- public void interpreterRemoved(IInterpreter removedVm);
+ public void interpreterRemoved(IVMInstall removedVm);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -7,15 +7,15 @@
public interface IInterpreterInstallType {
- IInterpreter findInterpreterInstallByName(String vmName);
+ IVMInstall findInterpreterInstallByName(String vmName);
String getId();
- IInterpreter[] getInterpreterInstalls();
+ IVMInstall[] getInterpreterInstalls();
IStatus validateInstallLocation(File installLocation);
- IInterpreter findInterpreterInstall(String id);
+ IVMInstall findInterpreterInstall(String id);
IPath[] getDefaultLibraryLocations(File installLocation);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -103,8 +103,8 @@
*/
private static Set<String> fgContributedVMs = new HashSet<String>();
- protected List<IInterpreter> installedInterpreters;
- protected IInterpreter selectedInterpreter;
+ protected List<IVMInstall> installedInterpreters;
+ protected IVMInstall selectedInterpreter;
private static ListenerList fgVMListeners = new ListenerList(5);
protected RubyRuntime() {
@@ -122,26 +122,26 @@
fgVMListeners.remove(listener);
}
- public IInterpreter getSelectedInterpreter() {
+ public IVMInstall getSelectedInterpreter() {
if (selectedInterpreter == null) {
loadRuntimeConfiguration();
}
return selectedInterpreter;
}
- public IInterpreter getInterpreter(String name) {
+ public IVMInstall getInterpreter(String name) {
Iterator interpreters = getInstalledInterpreters().iterator();
while(interpreters.hasNext()) {
- IInterpreter each = (IInterpreter) interpreters.next();
+ IVMInstall each = (IVMInstall) interpreters.next();
if (each.getName().equals(name))
return each;
}
return getSelectedInterpreter();
}
- public void setSelectedInterpreter(IInterpreter anInterpreter) {
+ public void setSelectedInterpreter(IVMInstall anInterpreter) {
if (selectedInterpreter == anInterpreter) return;
- IInterpreter oldInterpreter = selectedInterpreter;
+ IVMInstall oldInterpreter = selectedInterpreter;
selectedInterpreter = anInterpreter;
saveRuntimeConfiguration();
Object[] listeners = fgVMListeners.getListeners();
@@ -151,7 +151,7 @@
}
}
- public void addInstalledInterpreter(IInterpreter anInterpreter) {
+ public void addInstalledInterpreter(IVMInstall anInterpreter) {
getInstalledInterpreters().add(anInterpreter);
if (getInstalledInterpreters().size() == 1)
setSelectedInterpreter(getInstalledInterpreters().get(0));
@@ -159,13 +159,13 @@
saveRuntimeConfiguration();
}
- public List<IInterpreter> getInstalledInterpreters() {
+ public List<IVMInstall> getInstalledInterpreters() {
if (installedInterpreters == null)
loadRuntimeConfiguration();
return installedInterpreters;
}
- public void setInstalledInterpreters(List<IInterpreter> newInstalledInterpreters) {
+ public void setInstalledInterpreters(List<IVMInstall> newInstalledInterpreters) {
installedInterpreters = newInstalledInterpreters;
if (installedInterpreters.size() > 0)
setSelectedInterpreter(installedInterpreters.get(0));
@@ -188,7 +188,7 @@
}
protected void loadRuntimeConfiguration() {
- installedInterpreters = new ArrayList<IInterpreter>();
+ installedInterpreters = new ArrayList<IVMInstall>();
try {
XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
reader.setContentHandler(getRuntimeConfigurationContentHandler());
@@ -213,7 +213,7 @@
protected void writeXML(Writer writer) {
try {
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig>");
- Iterator<IInterpreter> interpretersIterator = installedInterpreters.iterator();
+ Iterator<IVMInstall> interpretersIterator = installedInterpreters.iterator();
while (interpretersIterator.hasNext()) {
writer.write("<");
writer.write(TAG_INTERPRETER);
@@ -221,7 +221,7 @@
writer.write(ATTR_NAME);
writer.write("=\"");
- IInterpreter entry = interpretersIterator.next();
+ IVMInstall entry = interpretersIterator.next();
writer.write(entry.getName());
writer.write("\" ");
writer.write(ATTR_PATH);
@@ -254,7 +254,7 @@
if (TAG_INTERPRETER.equals(qName)) {
String interpreterName = atts.getValue(ATTR_NAME);
File installLocation = new File(atts.getValue(ATTR_PATH));
- IInterpreter interpreter = new RubyInterpreter(interpreterName, installLocation);
+ IVMInstall interpreter = new RubyInterpreter(interpreterName, installLocation);
installedInterpreters.add(interpreter);
if (atts.getValue(ATTR_SELECTED) != null)
selectedInterpreter = interpreter;
@@ -306,7 +306,7 @@
return fgInterpreterTypes;
}
- public static IInterpreter getDefaultInterpreterInstall() {
+ public static IVMInstall getDefaultInterpreterInstall() {
// TODO Auto-generated method stub
return null;
}
@@ -339,7 +339,7 @@
if (defId != null) {
Iterator iterator = vmDefs.getValidVMList().iterator();
while (iterator.hasNext()) {
- IInterpreter vm = (IInterpreter) iterator.next();
+ IVMInstall vm = (IVMInstall) iterator.next();
if (getCompositeIdFromVM(vm).equals(defId)) {
validDef = true;
break;
@@ -351,7 +351,7 @@
setPref = true;
List list = vmDefs.getValidVMList();
if (!list.isEmpty()) {
- IInterpreter vm = (IInterpreter) list.get(0);
+ IVMInstall vm = (IVMInstall) list.get(0);
vmDefs.setDefaultVMInstallCompositeID(getCompositeIdFromVM(vm));
}
}
@@ -380,7 +380,7 @@
IInterpreterInstallType[] installTypes = getInterpreterInstallTypes();
for (int i = 0; i < installTypes.length; i++) {
IInterpreterInstallType type = installTypes[i];
- IInterpreter[] installs = type.getInterpreterInstalls();
+ IVMInstall[] installs = type.getInterpreterInstalls();
for (int j = 0; j < installs.length; j++) {
fireInterpreterAdded(installs[j]);
}
@@ -489,7 +489,7 @@
*
* @since 2.1
*/
- public static String getCompositeIdFromVM(IInterpreter vm) {
+ public static String getCompositeIdFromVM(IVMInstall vm) {
if (vm == null) {
return null;
}
@@ -525,7 +525,7 @@
abort(MessageFormat.format("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
(Object[]) new String[]{id, element.getContributor().getName(), vmType}), null);
}
- IInterpreter install = installType.findInterpreterInstall(id);
+ IVMInstall install = installType.findInterpreterInstall(id);
if (install == null) {
// only load/create if first time we've seen this VM install
String name = element.getAttribute("name"); //$NON-NLS-1$
@@ -627,7 +627,7 @@
throw new CoreException(new Status(IStatus.ERROR, RdtLaunchingPlugin.getUniqueIdentifier(), code, message, exception));
}
- private static void fireInterpreterAdded(IInterpreter interpreter) {
+ private static void fireInterpreterAdded(IVMInstall interpreter) {
// TODO Actually notify IInterpreterInstallChangedListeners
}
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -9,7 +9,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
public class TC_RubyInterpreter extends TestCase {
@@ -17,11 +17,11 @@
private static final File WORKING_DIR = new File("/testDir");
public void testEquals() {
- IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("/InterpreterOnePath"));
- IInterpreter similarInterpreterOne = new RubyInterpreter("InterpreterOne", new File("/InterpreterOnePath"));
+ IVMInstall interpreterOne = new RubyInterpreter("InterpreterOne", new File("/InterpreterOnePath"));
+ IVMInstall similarInterpreterOne = new RubyInterpreter("InterpreterOne", new File("/InterpreterOnePath"));
assertTrue("Interpreters should be equal.", interpreterOne.equals(similarInterpreterOne));
- IInterpreter interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("/InterpreterTwoPath"));
+ IVMInstall interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("/InterpreterTwoPath"));
assertTrue("Interpreters should not be equal.", !interpreterOne.equals(interpreterTwo));
}
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -30,7 +30,7 @@
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
public class TC_RubyRuntime extends TestCase {
@@ -42,8 +42,8 @@
public void testGetInstalledInterpreters() {
ShamRubyRuntime runtime = new ShamRubyRuntime();
- IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:/RubyInstallRootOne"));
- IInterpreter interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("C:/RubyInstallRootTwo"));
+ IVMInstall interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:/RubyInstallRootOne"));
+ IVMInstall interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("C:/RubyInstallRootTwo"));
assertTrue("Runtime should contain all interpreters.", runtime.getInstalledInterpreters().containsAll(Arrays.asList(new Object[] { interpreterOne, interpreterTwo })));
assertTrue("interpreterTwo should be selected interpreter.", runtime.getSelectedInterpreter().equals(interpreterTwo));
@@ -52,12 +52,12 @@
ShamRubyRuntime runtime = new ShamRubyRuntime();
- IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:\\RubyInstallRootOne"));
- runtime.setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne }));
+ IVMInstall interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:\\RubyInstallRootOne"));
+ runtime.setInstalledInterpreters(Arrays.asList(new IVMInstall[] { interpreterOne }));
assertEquals("XML should indicate only one interpreter with it being the selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\" selected=\"true\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
RubyInterpreter interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("C:\\RubyInstallRootTwo"));
- runtime.setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne, interpreterTwo }));
+ runtime.setInstalledInterpreters(Arrays.asList(new IVMInstall[] { interpreterOne, interpreterTwo }));
assertEquals("XML should indicate both interpreters with the first one being selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\" selected=\"true\"/><interpreter name=\"InterpreterTwo\" path=\"C:\\RubyInstallRootTwo\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
runtime.setSelectedInterpreter(interpreterTwo);
@@ -74,7 +74,7 @@
protected Writer getRuntimeConfigurationWriter() {
return runtimeConfigurationWriter;
}
- public void setInstalledInterpreters(List<IInterpreter> newInstalledInterpreters) {
+ public void setInstalledInterpreters(List<IVMInstall> newInstalledInterpreters) {
super.setInstalledInterpreters(newInstalledInterpreters);
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -44,7 +44,7 @@
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility;
import org.rubypeople.rdt.internal.ui.rdocexport.RdocListener;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -138,18 +138,18 @@
form.setWeights(new int[]{1, 3});
runtimeListener = new IInterpreterInstallChangedListener() {
- public void defaultInterpreterInstallChanged(IInterpreter previous,
- IInterpreter current) {
+ public void defaultInterpreterInstallChanged(IVMInstall previous,
+ IVMInstall current) {
updatePage();
}
- public void interpreterAdded(IInterpreter newVm) {
+ public void interpreterAdded(IVMInstall newVm) {
}
public void interpreterChanged(PropertyChangeEvent event) {
}
- public void interpreterRemoved(IInterpreter removedVm) {
+ public void interpreterRemoved(IVMInstall removedVm) {
}
};
RubyRuntime.addInterpreterInstallChangedListener(runtimeListener);
@@ -183,7 +183,7 @@
}
private void updatePage() {
- IInterpreter interpreter = RubyRuntime.getDefault().getSelectedInterpreter();
+ IVMInstall interpreter = RubyRuntime.getDefault().getSelectedInterpreter();
if (interpreter != null) {
initSearchList();
if( riFound ){
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -20,7 +20,7 @@
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.RubyUIMessages;
import org.rubypeople.rdt.internal.ui.dialogs.StatusInfo;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
@@ -85,7 +85,7 @@
public final void invoke() {
log("Generating RDoc for " + resource.getName());
- IInterpreter interpreter = RubyRuntime.getDefault().getSelectedInterpreter();
+ IVMInstall interpreter = RubyRuntime.getDefault().getSelectedInterpreter();
if (interpreter == null) {
MessageDialog.openInformation(RubyPlugin.getActiveWorkbenchShell(), RdtLaunchingMessages.RdtLaunchingPlugin_noInterpreterSelectedTitle, RdtLaunchingMessages.RdtLaunchingPlugin_noInterpreterSelected);
return ;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -14,7 +14,7 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.ui.IEditorInput;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
import org.rubypeople.rdt.ui.extensions.ITextHoverProvider;
@@ -34,7 +34,7 @@
try {
String symbol = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
args.add(symbol);
- IInterpreter selectedInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
+ IVMInstall selectedInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
if (selectedInterpreter == null) return null;
Process p = selectedInterpreter.exec(args, null);
br = new BufferedReader(new InputStreamReader(p.getInputStream()));
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-01-18 15:41:21 UTC (rev 1791)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-01-18 15:43:49 UTC (rev 1792)
@@ -7,7 +7,7 @@
import org.eclipse.swt.graphics.RGB;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager;
-import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.RubyRuntime;
public class PreferenceConstants {
@@ -653,7 +653,7 @@
}
private static String getDefaultPath(String programName) {
- IInterpreter interpreter = RubyRuntime.getDefault().getSelectedInterpreter();
+ IVMInstall interpreter = RubyRuntime.getDefault().getSelectedInterpreter();
if (interpreter == null) { return programName; }
File path = interpreter.getInstallLocation();
return path.getParent() + File.separator + programName;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 15:41:36
|
Revision: 1791
http://svn.sourceforge.net/rubyeclipse/?rev=1791&view=rev
Author: cawilliams
Date: 2007-01-18 07:41:21 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
More tweaking around interpreters
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties
Added Paths:
-----------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.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/launcher/RubyEnvironmentTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-18 14:36:55 UTC (rev 1790)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-18 15:41:21 UTC (rev 1791)
@@ -10,6 +10,7 @@
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -23,6 +24,7 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.rubypeople.rdt.core.ILoadpathEntry;
@@ -32,7 +34,8 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
import org.rubypeople.rdt.internal.debug.ui.preferences.EditInterpreterDialog;
-import org.rubypeople.rdt.internal.launching.RubyInterpreter;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.IAddVMDialogRequestor;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.launching.IInterpreter;
@@ -40,8 +43,11 @@
public class RubyEnvironmentTab extends AbstractLaunchConfigurationTab {
protected ListViewer loadPathListViewer;
+
protected java.util.List installedInterpretersWorkingCopy;
+
protected Combo interpreterCombo;
+
protected Button loadPathDefaultButton;
public RubyEnvironmentTab() {
@@ -63,28 +69,39 @@
Composite loadPathComposite = new Composite(tabFolder, SWT.NONE);
loadPathComposite.setLayout(new GridLayout());
- loadPathListViewer = new ListViewer(loadPathComposite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
+ loadPathListViewer = new ListViewer(loadPathComposite, SWT.BORDER
+ | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
loadPathListViewer.setContentProvider(new ArrayContentProvider());
loadPathListViewer.setLabelProvider(new LoadPathEntryLabelProvider());
- loadPathListViewer.getList().setLayoutData(new GridData(GridData.FILL_BOTH));
+ loadPathListViewer.getList().setLayoutData(
+ new GridData(GridData.FILL_BOTH));
TabItem loadPathTab = new TabItem(tabFolder, SWT.NONE, 0);
- loadPathTab.setText(RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.loadPathTab.label"));
+ loadPathTab
+ .setText(RdtDebugUiMessages
+ .getString("LaunchConfigurationTab.RubyEnvironment.loadPathTab.label"));
loadPathTab.setControl(loadPathComposite);
loadPathTab.setData(loadPathListViewer);
loadPathDefaultButton = new Button(loadPathComposite, SWT.CHECK);
- loadPathDefaultButton.setText(RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.loadPathDefaultButton.label"));
- loadPathDefaultButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- loadPathDefaultButton.addSelectionListener(getLoadPathDefaultButtonSelectionListener());
-
- loadPathDefaultButton.setEnabled(false); //for now, until the load path is customizable on the configuration
+ loadPathDefaultButton
+ .setText(RdtDebugUiMessages
+ .getString("LaunchConfigurationTab.RubyEnvironment.loadPathDefaultButton.label"));
+ loadPathDefaultButton.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_BEGINNING));
+ loadPathDefaultButton
+ .addSelectionListener(getLoadPathDefaultButtonSelectionListener());
+
+ loadPathDefaultButton.setEnabled(false); // for now, until the load
+ // path is customizable on
+ // the configuration
}
protected SelectionListener getLoadPathSelectionListener() {
return new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- System.out.println("Loadpath list selection occurred: " + e.getSource());
+ System.out.println("Loadpath list selection occurred: "
+ + e.getSource());
}
};
}
@@ -104,7 +121,8 @@
layout.marginHeight = 0;
layout.marginWidth = 0;
interpreterComposite.setLayout(layout);
- interpreterComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ interpreterComposite.setLayoutData(new GridData(
+ GridData.FILL_HORIZONTAL));
createVerticalSpacer(interpreterComposite, 2);
@@ -114,26 +132,52 @@
interpreterCombo.addModifyListener(getInterpreterComboModifyListener());
Button interpreterAddButton = new Button(interpreterComposite, SWT.PUSH);
- interpreterAddButton.setText(RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.interpreterAddButton.label"));
- interpreterAddButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- IInterpreter newInterpreter = new RubyInterpreter(null, null);
- EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.editInterpreterDialog.title"));
- editor.create();
- editor.setInterpreterToEdit(newInterpreter);
- if (EditInterpreterDialog.OK == editor.open()) {
- RubyRuntime.getDefault().addInstalledInterpreter(newInterpreter);
- interpreterCombo.add(newInterpreter.getName());
- interpreterCombo.select(interpreterCombo.indexOf(newInterpreter.getName()));
- }
- }
- });
+ interpreterAddButton
+ .setText(RdtDebugUiMessages
+ .getString("LaunchConfigurationTab.RubyEnvironment.interpreterAddButton.label"));
+ interpreterAddButton.addSelectionListener(new AddInterpreterSelectionAdapter(interpreterCombo, getShell()));
TabItem interpreterTab = new TabItem(tabFolder, SWT.NONE);
- interpreterTab.setText(RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.interpreterTab.label"));
+ interpreterTab
+ .setText(RdtDebugUiMessages
+ .getString("LaunchConfigurationTab.RubyEnvironment.interpreterTab.label"));
interpreterTab.setControl(interpreterComposite);
}
+ private static class AddInterpreterSelectionAdapter extends
+ SelectionAdapter implements IAddVMDialogRequestor {
+
+ private Combo fCombo;
+ private Shell fShell;
+
+ public AddInterpreterSelectionAdapter(Combo combo, Shell shell) {
+ fCombo = combo;
+ fShell = shell;
+ }
+
+ public void widgetSelected(SelectionEvent evt) {
+ EditInterpreterDialog dialog = new EditInterpreterDialog(this,
+ fShell, RubyRuntime.getInterpreterInstallTypes(),
+ null);
+ dialog.setTitle(RubyVMMessages.InstalledJREsBlock_7);
+ if (dialog.open() != Window.OK) {
+ return;
+ }
+ }
+
+ public boolean isDuplicateName(String name) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void vmAdded(IInterpreter vm) {
+ RubyRuntime.getDefault().addInstalledInterpreter(vm);
+ fCombo.add(vm.getName());
+ fCombo.select(fCombo.indexOf(vm.getName()));
+ }
+
+ }
+
protected ModifyListener getInterpreterComboModifyListener() {
return new ModifyListener() {
public void modifyText(ModifyEvent evt) {
@@ -150,9 +194,12 @@
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- IInterpreter defaultInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
- if (defaultInterpreter != null) {
- configuration.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, defaultInterpreter.getName());
+ IInterpreter defaultInterpreter = RubyRuntime.getDefault()
+ .getSelectedInterpreter();
+ if (defaultInterpreter != null) {
+ configuration.setAttribute(
+ RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER,
+ defaultInterpreter.getName());
}
}
@@ -164,14 +211,20 @@
protected void initializeLoadPath(ILaunchConfiguration configuration) {
boolean useDefaultLoadPath = true;
try {
- useDefaultLoadPath = configuration.getAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_LOAD_PATH, true);
+ useDefaultLoadPath = configuration.getAttribute(
+ RubyLaunchConfigurationAttribute.USE_DEFAULT_LOAD_PATH,
+ true);
setUseLoadPathDefaults(useDefaultLoadPath);
if (useDefaultLoadPath) {
- String projectName = configuration.getAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, "");
+ String projectName = configuration.getAttribute(
+ RubyLaunchConfigurationAttribute.PROJECT_NAME, "");
if (projectName.length() != 0) {
- IRubyProject project = RubyModelManager.getRubyModelManager().getRubyModel().getRubyProject(projectName);
+ IRubyProject project = RubyModelManager
+ .getRubyModelManager().getRubyModel()
+ .getRubyProject(projectName);
if (project != null) {
- ILoadpathEntry[] entries = project.getResolvedLoadpath(true);
+ ILoadpathEntry[] entries = project
+ .getResolvedLoadpath(true);
loadPathListViewer.setInput(entries);
}
}
@@ -186,10 +239,12 @@
loadPathDefaultButton.setSelection(useDefaults);
}
- protected void initializeInterpreterSelection(ILaunchConfiguration configuration) {
+ protected void initializeInterpreterSelection(
+ ILaunchConfiguration configuration) {
String interpreterName = null;
try {
- interpreterName = configuration.getAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
+ interpreterName = configuration.getAttribute(
+ RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
} catch (CoreException e) {
log(e);
}
@@ -199,35 +254,48 @@
protected void initializeInterpreterCombo(Combo interpreterCombo) {
installedInterpretersWorkingCopy = new ArrayList();
- installedInterpretersWorkingCopy.addAll(RubyRuntime.getDefault().getInstalledInterpreters());
+ installedInterpretersWorkingCopy.addAll(RubyRuntime.getDefault()
+ .getInstalledInterpreters());
- String[] interpreterNames = new String[installedInterpretersWorkingCopy.size()];
- for (int interpreterIndex = 0; interpreterIndex < installedInterpretersWorkingCopy.size(); interpreterIndex++) {
- IInterpreter interpreter = (IInterpreter) installedInterpretersWorkingCopy.get(interpreterIndex);
+ String[] interpreterNames = new String[installedInterpretersWorkingCopy
+ .size()];
+ for (int interpreterIndex = 0; interpreterIndex < installedInterpretersWorkingCopy
+ .size(); interpreterIndex++) {
+ IInterpreter interpreter = (IInterpreter) installedInterpretersWorkingCopy
+ .get(interpreterIndex);
interpreterNames[interpreterIndex] = interpreter.getName();
}
interpreterCombo.setItems(interpreterNames);
- IInterpreter selectedInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
+ IInterpreter selectedInterpreter = RubyRuntime.getDefault()
+ .getSelectedInterpreter();
if (selectedInterpreter != null)
- interpreterCombo.select(interpreterCombo.indexOf(selectedInterpreter.getName()));
+ interpreterCombo.select(interpreterCombo
+ .indexOf(selectedInterpreter.getName()));
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
int selectionIndex = interpreterCombo.getSelectionIndex();
if (selectionIndex >= 0)
- configuration.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, interpreterCombo.getItem(selectionIndex));
+ configuration.setAttribute(
+ RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER,
+ interpreterCombo.getItem(selectionIndex));
- configuration.setAttribute(RubyLaunchConfigurationAttribute.USE_DEFAULT_LOAD_PATH, loadPathDefaultButton.getSelection());
+ configuration.setAttribute(
+ RubyLaunchConfigurationAttribute.USE_DEFAULT_LOAD_PATH,
+ loadPathDefaultButton.getSelection());
if (!loadPathDefaultButton.getSelection()) {
List loadPathEntries = (List) loadPathListViewer.getInput();
List loadPathStrings = new ArrayList();
- for (Iterator iterator = loadPathEntries.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = loadPathEntries.iterator(); iterator
+ .hasNext();) {
LoadpathEntry entry = (LoadpathEntry) iterator.next();
loadPathStrings.add(entry.getPath().toString());
}
- configuration.setAttribute(RubyLaunchConfigurationAttribute.CUSTOM_LOAD_PATH, loadPathStrings);
+ configuration.setAttribute(
+ RubyLaunchConfigurationAttribute.CUSTOM_LOAD_PATH,
+ loadPathStrings);
}
}
@@ -243,24 +311,27 @@
}
public String getName() {
- return RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.name");
+ return RdtDebugUiMessages
+ .getString("LaunchConfigurationTab.RubyEnvironment.name");
}
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
- String selectedInterpreter = launchConfig.getAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
+ String selectedInterpreter = launchConfig.getAttribute(
+ RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, "");
if (selectedInterpreter.length() == 0) {
- setErrorMessage(RdtDebugUiMessages.getString("LaunchConfigurationTab.RubyEnvironment.interpreter_not_selected_error_message"));
+ setErrorMessage(RdtDebugUiMessages
+ .getString("LaunchConfigurationTab.RubyEnvironment.interpreter_not_selected_error_message"));
return false;
}
} catch (CoreException e) {
log(e);
}
-
+
setErrorMessage(null);
return true;
}
-
+
protected void log(Throwable t) {
RdtDebugUiPlugin.log(t);
}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 14:36:55 UTC (rev 1790)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/EditInterpreterDialog.java 2007-01-18 15:41:21 UTC (rev 1791)
@@ -1,19 +1,17 @@
package org.rubypeople.rdt.internal.debug.ui.preferences;
import java.io.File;
+import java.io.IOException;
+import java.text.MessageFormat;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.FileDialog;
@@ -22,140 +20,326 @@
import org.eclipse.swt.widgets.Text;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
-import org.rubypeople.rdt.internal.launching.RubyInterpreter;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.IAddVMDialogRequestor;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
+import org.rubypeople.rdt.internal.launching.VMStandin;
import org.rubypeople.rdt.internal.ui.dialogs.StatusDialog;
+import org.rubypeople.rdt.internal.ui.dialogs.StatusInfo;
+import org.rubypeople.rdt.internal.ui.wizards.dialogfields.ComboDialogField;
+import org.rubypeople.rdt.internal.ui.wizards.dialogfields.DialogField;
+import org.rubypeople.rdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
+import org.rubypeople.rdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
+import org.rubypeople.rdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
+import org.rubypeople.rdt.internal.ui.wizards.dialogfields.StringDialogField;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IInterpreter2;
+import org.rubypeople.rdt.launching.IInterpreterInstallType;
public class EditInterpreterDialog extends StatusDialog {
- protected IInterpreter interpreterToEdit;
- protected Text interpreterNameText, interpreterLocationText;
+
protected IStatus[] allStatus = new IStatus[2];
+
+ protected IInterpreter fEditedVM;
+ private StringButtonDialogField fJRERoot;
+ private StringDialogField fVMName;
+
+ private StringDialogField fVMArgs;
+
+ private IInterpreterInstallType fSelectedVMType;
+ private IInterpreterInstallType[] fVMTypes;
+ private ComboDialogField fVMTypeCombo;
+
+ private IStatus[] fStati;
+
+ private int fPrevIndex = -1;
- public EditInterpreterDialog(Shell parentShell, String aDialogTitle) {
- super(parentShell);
- setTitle(aDialogTitle);
+ private IAddVMDialogRequestor fRequestor;
+
+ public EditInterpreterDialog(IAddVMDialogRequestor requestor, Shell shell, IInterpreterInstallType[] vmInstallTypes, IInterpreter editedVM) {
+ super(shell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ fRequestor= requestor;
+ fStati= new IStatus[5];
+ for (int i= 0; i < fStati.length; i++) {
+ fStati[i]= new StatusInfo();
+ }
+
+ fVMTypes= vmInstallTypes;
+ fSelectedVMType= editedVM != null ? editedVM.getInterpreterInstallType() : vmInstallTypes[0];
+
+ fEditedVM= editedVM;
}
- public void setInterpreterToEdit(IInterpreter anInterpreter) {
- interpreterToEdit = anInterpreter;
-
- String interpreterName = interpreterToEdit.getName();
- interpreterNameText.setText(interpreterName != null ? interpreterName : ""); //$NON-NLS-1$
+ protected IStatus validateInterpreterLocationText() {
+ String locationName = fJRERoot.getText();
+ if (locationName.length() == 0) {
+ return new StatusInfo(IStatus.INFO, RubyVMMessages.addVMDialog_enterLocation);
+ }
+ File file = new File(locationName);
+ if (!file.exists()) {
+ return new StatusInfo(IStatus.ERROR, RubyVMMessages.addVMDialog_locationNotExists);
+ }
+ // FIXME We want the user to select a directory as the home of the ruby install!
+ if(file.isFile()){
+ return new Status(IStatus.OK, RdtDebugUiPlugin.PLUGIN_ID, 0, "", null);
+ }
+ return new Status(IStatus.ERROR, RdtDebugUiPlugin.PLUGIN_ID, 1, RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.path.error"), null);
+ }
- File installLocation = interpreterToEdit.getInstallLocation();
- interpreterLocationText.setText(installLocation != null ? installLocation.getAbsolutePath() : ""); //$NON-NLS-1$
+ protected void browseForInstallLocation() {
+ FileDialog dialog = new FileDialog(getShell());
+ dialog.setFilterPath(fJRERoot.getText());
+ dialog.setText(RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.path.browse.message")); //$NON-NLS-1$
+ String newPath = dialog.open();
+ if (newPath != null)
+ fJRERoot.setText(newPath);
}
- protected void createLocationEntryField(Composite composite) {
- new Label(composite, SWT.NONE).setText(RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.path.label")); //$NON-NLS-1$
-
- Composite locationComposite = new Composite(composite, SWT.NONE);
- RowLayout locationLayout = new RowLayout();
- locationLayout.marginLeft = 0;
- locationComposite.setLayout(locationLayout);
-
- interpreterLocationText = new Text(locationComposite, SWT.SINGLE | SWT.BORDER);
- interpreterLocationText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- allStatus[1] = validateInterpreterLocationText();
- updateStatusLine();
+ protected void okPressed() {
+ doOkPressed();
+ super.okPressed();
+ }
+
+ private void doOkPressed() {
+ if (fEditedVM == null) {
+ IInterpreter vm= new VMStandin(fSelectedVMType, createUniqueId(fSelectedVMType));
+ setFieldValuesToVM(vm);
+ fRequestor.vmAdded(vm);
+ } else {
+ setFieldValuesToVM(fEditedVM);
+ }
+ }
+
+ public void create() {
+ super.create();
+ fVMName.setFocus();
+ selectVMType();
+ }
+
+ private String createUniqueId(IInterpreterInstallType vmType) {
+ String id= null;
+ do {
+ id= String.valueOf(System.currentTimeMillis());
+ } while (vmType.findInterpreterInstall(id) != null);
+ return id;
+ }
+
+ private void selectVMType() {
+ for (int i= 0; i < fVMTypes.length; i++) {
+ if (fSelectedVMType == fVMTypes[i]) {
+ fVMTypeCombo.selectItem(i);
+ return;
}
- });
- interpreterLocationText.setLayoutData(new RowData(120, SWT.DEFAULT));
-
- Button browseButton = new Button(composite, SWT.PUSH);
- browseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
- browseButton.setText(RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.path.browse.button.label")); //$NON-NLS-1$
- browseButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- browseForInstallLocation();
+ }
+ }
+
+ private void updateVMType() {
+ int selIndex= fVMTypeCombo.getSelectionIndex();
+ if (selIndex == fPrevIndex) {
+ return;
+ }
+ fPrevIndex = selIndex;
+ if (selIndex >= 0 && selIndex < fVMTypes.length) {
+ fSelectedVMType= fVMTypes[selIndex];
+ }
+ setJRELocationStatus(validateInterpreterLocationText());
+// fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
+ updateStatusLine();
+ }
+
+ private void setJRELocationStatus(IStatus status) {
+ fStati[1]= status;
+ }
+
+ protected void updateStatusLine() {
+ IStatus max= null;
+ for (int i= 0; i < fStati.length; i++) {
+ IStatus curr= fStati[i];
+ if (curr.matches(IStatus.ERROR)) {
+ updateStatus(curr);
+ return;
}
- });
+ if (max == null || curr.getSeverity() > max.getSeverity()) {
+ max= curr;
+ }
+ }
+ updateStatus(max);
}
+
+ protected Control createDialogArea(Composite ancestor) {
+ createDialogFields();
+ Composite parent = (Composite)super.createDialogArea(ancestor);
+ ((GridLayout)parent.getLayout()).numColumns= 3;
+
+ fVMTypeCombo.doFillIntoGrid(parent, 3);
+ ((GridData)fVMTypeCombo.getComboControl(null).getLayoutData()).widthHint= convertWidthInCharsToPixels(50);
- protected void updateStatusLine() {
- updateStatus(getMostSevereStatus());
+ fVMName.doFillIntoGrid(parent, 3);
+
+ fJRERoot.doFillIntoGrid(parent, 3);
+
+ fVMArgs.doFillIntoGrid(parent, 3);
+ ((GridData)fVMArgs.getTextControl(null).getLayoutData()).widthHint= convertWidthInCharsToPixels(50);
+
+ Label l = new Label(parent, SWT.NONE);
+ l.setText(RubyVMMessages.AddVMDialog_JRE_system_libraries__1);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ l.setLayoutData(gd);
+
+// fLibraryBlock = new VMLibraryBlock(this);
+// Control block = fLibraryBlock.createControl(parent);
+// gd = new GridData(GridData.FILL_BOTH);
+// gd.horizontalSpan = 3;
+// block.setLayoutData(gd);
+
+ Text t= fJRERoot.getTextControl(parent);
+ gd= (GridData)t.getLayoutData();
+ gd.grabExcessHorizontalSpace=true;
+ gd.widthHint= convertWidthInCharsToPixels(50);
+
+ initializeFields();
+ createFieldListeners();
+ applyDialogFont(parent);
+ return parent;
}
-
- protected IStatus getMostSevereStatus() {
- IStatus max = new Status(0, RdtDebugUiPlugin.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$
- for (int i = 0; i < allStatus.length; i++) {
- IStatus curr = allStatus[i];
- if (curr != null) {
- if (curr.matches(IStatus.ERROR)) {
- return curr;
+
+ private void initializeFields() {
+ fVMTypeCombo.setItems(getVMTypeNames());
+ if (fEditedVM == null) {
+ fVMName.setText(""); //$NON-NLS-1$
+ fJRERoot.setText(""); //$NON-NLS-1$
+// fLibraryBlock.initializeFrom(null, fSelectedVMType);
+ fVMArgs.setText(""); //$NON-NLS-1$
+ } else {
+ fVMTypeCombo.setEnabled(false);
+ fVMName.setText(fEditedVM.getName());
+ fJRERoot.setText(fEditedVM.getInstallLocation().getAbsolutePath());
+// fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
+ if (fEditedVM instanceof IInterpreter2) {
+ IInterpreter2 vm2 = (IInterpreter2) fEditedVM;
+ String vmArgs = vm2.getVMArgs();
+ if (vmArgs != null) {
+ fVMArgs.setText(vmArgs);
}
- if (max == null || curr.getSeverity() > max.getSeverity()) {
- max = curr;
- }
+ } else {
+ String[] vmArgs = fEditedVM.getInterpreterArguments();
+ if (vmArgs != null) {
+ StringBuffer buffer = new StringBuffer();
+ int length= vmArgs.length;
+ if (length > 0) {
+ buffer.append(vmArgs[0]);
+ for (int i = 1; i < length; i++) {
+ buffer.append(' ').append(vmArgs[i]);
+ }
+ }
+ fVMArgs.setText(buffer.toString());
+ }
}
}
- return max;
+ setVMNameStatus(validateVMName());
+ updateStatusLine();
}
-
- protected IStatus validateInterpreterLocationText() {
- File path = new File(interpreterLocationText.getText());
- if(path.isFile()){
- return new Status(IStatus.OK, RdtDebugUiPlugin.PLUGIN_ID, 0, "", null);
- }
- return new Status(IStatus.ERROR, RdtDebugUiPlugin.PLUGIN_ID, 1, RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.path.error"), null);
+
+ private void setVMNameStatus(IStatus status) {
+ fStati[0]= status;
}
-
- protected void createNameEntryField(Composite composite) {
- new Label(composite, SWT.NONE).setText(RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.name")); //$NON-NLS-1$
-
- GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gridData.horizontalSpan = 2;
-
- interpreterNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- interpreterNameText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- allStatus[0] = validateInterpreterNameText();
+
+ protected void createFieldListeners() {
+ fVMTypeCombo.setDialogFieldListener(new IDialogFieldListener() {
+ public void dialogFieldChanged(DialogField field) {
+ updateVMType();
+ }
+ });
+
+ fVMName.setDialogFieldListener(new IDialogFieldListener() {
+ public void dialogFieldChanged(DialogField field) {
+ setVMNameStatus(validateVMName());
updateStatusLine();
}
});
- interpreterNameText.setLayoutData(gridData);
+
+ fJRERoot.setDialogFieldListener(new IDialogFieldListener() {
+ public void dialogFieldChanged(DialogField field) {
+ setJRELocationStatus(validateInterpreterLocationText());
+ updateStatusLine();
+ }
+ });
}
-
- protected IStatus validateInterpreterNameText() {
- int status = IStatus.OK;
- String message = ""; //$NON-NLS-1$
-
- if (interpreterNameText.getText() == null || interpreterNameText.getText().length() <= 0) {
- status = IStatus.ERROR;
- message = RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.name.error"); //$NON-NLS-1$
+
+ private IStatus validateVMName() {
+ StatusInfo status= new StatusInfo();
+ String name= fVMName.getText();
+ if (name == null || name.trim().length() == 0) {
+ status.setInfo(RubyVMMessages.addVMDialog_enterName);
+ } else {
+ if (fRequestor.isDuplicateName(name) && (fEditedVM == null || !name.equals(fEditedVM.getName()))) {
+ status.setError(RubyVMMessages.addVMDialog_duplicateName);
+ } else {
+ IStatus s = ResourcesPlugin.getWorkspace().validateName(name, IResource.FILE);
+ if (!s.isOK()) {
+ status.setError(MessageFormat.format(RubyVMMessages.AddVMDialog_JRE_name_must_be_a_valid_file_name___0__1, new String[]{s.getMessage()}));
+ }
+ }
}
-
- return new Status(status, RdtDebugUiPlugin.PLUGIN_ID, 0, message, null);
+ return status;
}
-
- protected void browseForInstallLocation() {
- FileDialog dialog = new FileDialog(getShell());
- dialog.setFilterPath(interpreterLocationText.getText());
- dialog.setText(RdtDebugUiMessages.getString("EditInterpreterDialog.rubyInterpreter.path.browse.message")); //$NON-NLS-1$
- String newPath = dialog.open();
- if (newPath != null)
- interpreterLocationText.setText(newPath);
+
+ protected void createDialogFields() {
+ fVMTypeCombo= new ComboDialogField(SWT.READ_ONLY);
+ fVMTypeCombo.setLabelText(RubyVMMessages.addVMDialog_jreType);
+ fVMTypeCombo.setItems(getVMTypeNames());
+
+ fVMName= new StringDialogField();
+ fVMName.setLabelText(RubyVMMessages.addVMDialog_jreName);
+
+ fJRERoot= new StringButtonDialogField(new IStringButtonAdapter() {
+ public void changeControlPressed(DialogField field) {
+ browseForInstallLocation();
+ }
+ });
+ fJRERoot.setLabelText(RubyVMMessages.addVMDialog_jreHome);
+ fJRERoot.setButtonLabel(RubyVMMessages.addVMDialog_browse1);
+
+ fVMArgs= new StringDialogField();
+ fVMArgs.setLabelText(RubyVMMessages.AddVMDialog_23);
}
-
- protected void okPressed() {
- if (interpreterToEdit == null)
- interpreterToEdit = new RubyInterpreter(null, null);
-
- interpreterToEdit.setName(interpreterNameText.getText());
- interpreterToEdit.setInstallLocation(new File(interpreterLocationText.getText()));
- super.okPressed();
+
+ private String[] getVMTypeNames() {
+ String[] names= new String[fVMTypes.length];
+ for (int i= 0; i < fVMTypes.length; i++) {
+ names[i]= fVMTypes[i].getName();
+ }
+ return names;
}
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- composite.setLayout(layout);
+
+ protected void setFieldValuesToVM(IInterpreter vm) {
+ File dir = new File(fJRERoot.getText());
+ try {
+ vm.setInstallLocation(dir.getCanonicalFile());
+ } catch (IOException e) {
+ vm.setInstallLocation(dir.getAbsoluteFile());
+ }
+ vm.setName(fVMName.getText());
+
+ String argString = fVMArgs.getText().trim();
+ if (vm instanceof IInterpreter2) {
+ IInterpreter2 vm2 = (IInterpreter2) vm;
+ if (argString != null && argString.length() >0) {
+ vm2.setInterpreterArgs(argString);
+ } else {
+ vm2.setInterpreterArgs(null);
+ }
+ } else {
+ if (argString != null && argString.length() >0) {
+ vm.setInterpreterArguments(DebugPlugin.parseArguments(argString));
+ } else {
+ vm.setInterpreterArguments(null);
+ }
+ }
+
- createNameEntryField(composite);
- createLocationEntryField(composite);
-
- return composite;
+// fLibraryBlock.performApply(vm);
}
}
\ No newline at end of file
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-18 14:36:55 UTC (rev 1790)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java 2007-01-18 15:41:21 UTC (rev 1791)
@@ -12,6 +12,7 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -26,12 +27,19 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
-import org.rubypeople.rdt.internal.launching.RubyInterpreter;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.IAddVMDialogRequestor;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
import org.rubypeople.rdt.launching.IInterpreter;
import org.rubypeople.rdt.launching.RubyRuntime;
-public class RubyInterpreterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- protected CheckboxTableViewer tableViewer;
+public class RubyInterpreterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IAddVMDialogRequestor {
+
+ /**
+ * VMs being displayed
+ */
+ private List fVMs = new ArrayList();
+
+ protected CheckboxTableViewer fVMList;
protected Button addButton, editButton, removeButton;
public RubyInterpreterPreferencePage() {
@@ -48,10 +56,10 @@
createInstalledInterpretersTableViewer(table);
createButtonGroup(composite);
- tableViewer.setInput(RubyRuntime.getDefault().getInstalledInterpreters());
+ fVMList.setInput(RubyRuntime.getDefault().getInstalledInterpreters());
IInterpreter selectedInterpreter = RubyRuntime.getDefault().getSelectedInterpreter();
if (selectedInterpreter != null)
- tableViewer.setChecked(selectedInterpreter, true);
+ fVMList.setChecked(selectedInterpreter, true);
enableButtons();
@@ -95,24 +103,24 @@
}
protected void createInstalledInterpretersTableViewer(Table table) {
- tableViewer = new CheckboxTableViewer(table);
+ fVMList = new CheckboxTableViewer(table);
- tableViewer.setLabelProvider(new RubyInterpreterLabelProvider());
- tableViewer.setContentProvider(new RubyInterpreterContentProvider());
+ fVMList.setLabelProvider(new RubyInterpreterLabelProvider());
+ fVMList.setContentProvider(new RubyInterpreterContentProvider());
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ fVMList.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent evt) {
enableButtons();
}
});
- tableViewer.addCheckStateListener(new ICheckStateListener() {
+ fVMList.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
updateSelectedInterpreter(event.getElement());
}
});
- tableViewer.addDoubleClickListener(new IDoubleClickListener() {
+ fVMList.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent e) {
editInterpreter();
}
@@ -147,21 +155,15 @@
}
protected void addInterpreter() {
- IInterpreter newInterpreter = new RubyInterpreter(null, null);
- EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), RdtDebugUiMessages.getString("RubyInterpreterPreferencePage.EditInterpreterDialog.addInterpreter.title")); //$NON-NLS-1$
- editor.create();
- editor.setInterpreterToEdit(newInterpreter);
- if (EditInterpreterDialog.OK == editor.open()) {
- tableViewer.add(newInterpreter);
- Object[] checked = tableViewer.getCheckedElements();
- if(checked == null || checked.length == 0) {
- tableViewer.setChecked(newInterpreter, true);
- }
+ EditInterpreterDialog dialog = new EditInterpreterDialog(this, getShell(), RubyRuntime.getInterpreterInstallTypes(), null);
+ dialog.setTitle(RubyVMMessages.InstalledJREsBlock_7);
+ if (dialog.open() != Window.OK) {
+ return;
}
}
protected void removeInterpreter() {
- tableViewer.remove(getSelectedInterpreter());
+ fVMList.remove(getSelectedInterpreter());
}
protected void enableButtons() {
@@ -175,41 +177,65 @@
}
protected void updateSelectedInterpreter(Object interpreter) {
- Object[] checkedElements = tableViewer.getCheckedElements();
+ Object[] checkedElements = fVMList.getCheckedElements();
for (int i = 0; i < checkedElements.length; i++) {
- tableViewer.setChecked(checkedElements[i], false);
+ fVMList.setChecked(checkedElements[i], false);
}
- tableViewer.setChecked(interpreter, true);
+ fVMList.setChecked(interpreter, true);
}
protected void editInterpreter() {
- EditInterpreterDialog editor = new EditInterpreterDialog(getShell(), RdtDebugUiMessages.getString("RubyInterpreterPreferencePage.EditInterpreterDialog.editInterpreter.title")); //$NON-NLS-1$
- editor.create();
-
- IInterpreter anInterpreter = getSelectedInterpreter();
- editor.setInterpreterToEdit(anInterpreter);
- if (EditInterpreterDialog.OK == editor.open())
- tableViewer.update(anInterpreter, null);
+ IStructuredSelection selection= (IStructuredSelection)fVMList.getSelection();
+ IInterpreter vm= (IInterpreter)selection.getFirstElement();
+ if (vm == null) {
+ return;
+ }
+// if (isContributed(vm)) {
+// VMDetailsDialog dialog= new VMDetailsDialog(getShell(), vm);
+// dialog.open();
+// } else {
+ EditInterpreterDialog dialog= new EditInterpreterDialog(this, getShell(), RubyRuntime.getInterpreterInstallTypes(), vm);
+ dialog.setTitle(RubyVMMessages.InstalledJREsBlock_8);
+ if (dialog.open() != Window.OK) {
+ return;
+ }
+ fVMList.refresh(vm);
+// }
}
protected IInterpreter getSelectedInterpreter() {
- IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
+ IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection();
return (IInterpreter) selection.getFirstElement();
}
public boolean performOk() {
- TableItem[] tableItems = tableViewer.getTable().getItems();
+ TableItem[] tableItems = fVMList.getTable().getItems();
List installedInterpreters = new ArrayList(tableItems.length);
for (int i = 0; i < tableItems.length; i++)
installedInterpreters.add(tableItems[i].getData());
RubyRuntime.getDefault().setInstalledInterpreters(installedInterpreters);
- Object[] checkedElements = tableViewer.getCheckedElements();
+ Object[] checkedElements = fVMList.getCheckedElements();
if (checkedElements.length > 0)
RubyRuntime.getDefault().setSelectedInterpreter((IInterpreter) checkedElements[0]);
return super.performOk();
}
+ public boolean isDuplicateName(String name) {
+ for (int i= 0; i < fVMs.size(); i++) {
+ IInterpreter vm = (IInterpreter)fVMs.get(i);
+ if (vm.getName().equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void vmAdded(IInterpreter vm) {
+ fVMs.add(vm);
+ fVMList.refresh();
+ }
+
}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/IAddVMDialogRequestor.java 2007-01-18 15:41:21 UTC (rev 1791)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.internal.debug.ui.rubyvms;
+
+import org.rubypeople.rdt.launching.IInterpreter;
+
+/**
+ * This interface is implemented by clients of the <code>AddVMDialog</code>.
+ */
+public interface IAddVMDialogRequestor {
+
+ /**
+ * Reply whether or not a new VM of the specified name would
+ * constitute a duplicate.
+ *
+ * @param name the name of a potential new VM
+ * @return whether a new VM with the specified name would be a duplicate VM
+ */
+ public boolean isDuplicateName(String name);
+
+ /**
+ * Notification that a VM has been added from the <code>AddVMDialog</code>.
+ *
+ * @param vm the added vm
+ */
+ public void vmAdded(IInterpreter vm);
+
+}
Added: 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 (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java 2007-01-18 15:41:21 UTC (rev 1791)
@@ -0,0 +1,27 @@
+package org.rubypeople.rdt.internal.debug.ui.rubyvms;
+
+import org.eclipse.osgi.util.NLS;
+
+public class RubyVMMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages";//$NON-NLS-1$
+
+ public static String addVMDialog_enterLocation;
+ public static String addVMDialog_locationNotExists;
+
+ public static String AddVMDialog_JRE_system_libraries__1;
+ public static String addVMDialog_jreType;
+ public static String addVMDialog_jreName;
+ public static String addVMDialog_jreHome;
+ public static String addVMDialog_browse1;
+ public static String AddVMDialog_23;
+ public static String addVMDialog_enterName;
+ public static String addVMDialog_duplicateName;
+ public static String AddVMDialog_JRE_name_must_be_a_valid_file_name___0__1;
+ public static String InstalledJREsBlock_7;
+ public static String InstalledJREsBlock_8;
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, RubyVMMessages.class);
+ }
+}
Added: 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 (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-18 15:41:21 UTC (rev 1791)
@@ -0,0 +1,2 @@
+addVMDialog_enterLocation=Enter the location of the Ruby VM.
+addVMDialog_locationNotExists=The location does not exist.
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 14:36:55 UTC (rev 1790)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IInterpreterInstallType.java 2007-01-18 15:41:21 UTC (rev 1791)
@@ -19,4 +19,6 @@
IPath[] getDefaultLibraryLocations(File installLocation);
+ String getName();
+
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties 2007-01-18 14:36:55 UTC (rev 1790)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties 2007-01-18 15:41:21 UTC (rev 1791)
@@ -66,9 +66,7 @@
# Wizards
#########################################
ToggleMenuRubyFilesOnly=Show Ruby Files Only
-ToggleMenuRubyFilesOnly.Tooltip=If this is enabled, only ruby resources are shown. If it is disabled, the common filter rules apply.
-
###########
## viewsupport
###########
@@ -93,15 +91,7 @@
RDocPathErrorTitle=RDoc path error
RDocPathError=The input path for RDoc is blank or incorrect. Use preferences to enter a valid RDoc path.
-RDocExecutionErrorTitle=Ruby process exited with value {0}
-RDocExecutionError=Ruby running rdoc exited abnormally. A possble reason is a wrong Rdoc path. Please check the path for rdoc in the preference page.
-RDocExecutionErrorAdditionalMessageWithStderr=The process was started with: {0}. The last line of stderr of the ruby process: {1}.
-RDocExecutionErrorAdditionalMessage=The process was started with: {0}. The process did not write any messages to stderr.
-ErrorRunningRdocTitle=Error running RDoc
-ToggleComment.error.title=Toggle Comment
-ToggleComment.error.message=An error occurred while toggling comments.
-
CoreUtility_job_title=Rebuilding
CoreUtility_buildall_taskname=Build all...
CoreUtility_buildproject_taskname=Build project ''{0}''...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 14:36:57
|
Revision: 1790
http://svn.sourceforge.net/rubyeclipse/?rev=1790&view=rev
Author: cawilliams
Date: 2007-01-18 06:36:55 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java 2007-01-18 14:26:54 UTC (rev 1789)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java 2007-01-18 14:36:55 UTC (rev 1790)
@@ -60,7 +60,7 @@
}
/**
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
+ * @see IBaseLabelProvider#removeInterpreterInstallChangedListener(ILabelProviderListener)
*/
public void removeListener(ILabelProviderListener listener) {
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 14:26:54 UTC (rev 1789)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 14:36:55 UTC (rev 1790)
@@ -35,6 +35,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.variables.VariablesPlugin;
import org.rubypeople.rdt.internal.launching.CompositeId;
+import org.rubypeople.rdt.internal.launching.ListenerList;
import org.rubypeople.rdt.internal.launching.RdtLaunchingMessages;
import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
@@ -104,12 +105,8 @@
protected List<IInterpreter> installedInterpreters;
protected IInterpreter selectedInterpreter;
- private List<Listener> listeners = new ArrayList<Listener>();
+ private static ListenerList fgVMListeners = new ListenerList(5);
- public static interface Listener {
- void selectedInterpreterChanged();
- }
-
protected RubyRuntime() {
super();
}
@@ -120,14 +117,10 @@
}
return runtime;
}
-
- public void addListener(Listener listener) {
- listeners.add(listener);
+
+ public static void removeInterpreterInstallChangedListener(IInterpreterInstallChangedListener listener) {
+ fgVMListeners.remove(listener);
}
-
- public void removeListener(Listener listener) {
- listeners.remove(listener);
- }
public IInterpreter getSelectedInterpreter() {
if (selectedInterpreter == null) {
@@ -142,19 +135,20 @@
IInterpreter each = (IInterpreter) interpreters.next();
if (each.getName().equals(name))
return each;
- }
-
+ }
return getSelectedInterpreter();
}
public void setSelectedInterpreter(IInterpreter anInterpreter) {
if (selectedInterpreter == anInterpreter) return;
- selectedInterpreter = anInterpreter;
- saveRuntimeConfiguration();
- for (Iterator<Listener> iter = listeners.iterator(); iter.hasNext();) {
- Listener listener = iter.next();
- listener.selectedInterpreterChanged();
- }
+ IInterpreter oldInterpreter = selectedInterpreter;
+ selectedInterpreter = anInterpreter;
+ saveRuntimeConfiguration();
+ Object[] listeners = fgVMListeners.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ IInterpreterInstallChangedListener listener = (IInterpreterInstallChangedListener)listeners[i];
+ listener.defaultInterpreterInstallChanged(oldInterpreter, anInterpreter);
+ }
}
public void addInstalledInterpreter(IInterpreter anInterpreter) {
@@ -198,31 +192,16 @@
try {
XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
reader.setContentHandler(getRuntimeConfigurationContentHandler());
- Reader fileReader = this.getRuntimeConfigurationReader() ;
+ Reader fileReader = this.getRuntimeConfigurationReader();
if (fileReader == null) {
- // FIXME If we get a better algorithm for auto detection we should use it, but apparently this didn't make people happy
-// autoDetectRubyInterpreter();
return ;
}
- reader.parse(new InputSource(fileReader)) ;
+ reader.parse(new InputSource(fileReader));
} catch(Exception e) {
RdtLaunchingPlugin.log(e);
}
}
- private void autoDetectRubyInterpreter() {
- File path = null;
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- path = new File("/ruby/bin/ruby.exe");
- } else {
- //FIXME Why not use `which ruby` or something?
- path = new File("/usr/local/bin/ruby");
- }
- IInterpreter interpreter = new RubyInterpreter("Default Ruby Interpreter", path);
- installedInterpreters.add(interpreter);
- selectedInterpreter = interpreter;
- }
-
protected Reader getRuntimeConfigurationReader() {
try {
return new FileReader(getRuntimeConfigurationFile());
@@ -296,9 +275,9 @@
}
public static void addInterpreterInstallChangedListener(IInterpreterInstallChangedListener listener) {
- // TODO Implement and add to listeners, and replace the addListener(Listener) stuff
-
+ fgVMListeners.add(listener);
}
+
/**
* Returns the VM install type with the given unique id.
* @param id the VM install type unique id
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-18 14:26:54 UTC (rev 1789)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-18 14:36:55 UTC (rev 1790)
@@ -45,6 +45,8 @@
import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility;
import org.rubypeople.rdt.internal.ui.rdocexport.RdocListener;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
@@ -60,7 +62,7 @@
private List possibleMatches = new ArrayList();
private SearchValue itemToSearch = new SearchValue();
private DescriptionUpdater descriptionUpdater = new DescriptionUpdater();
- private RubyRuntime.Listener runtimeListener;
+ private IInterpreterInstallChangedListener runtimeListener;
private ListContentProvider contentProvider = new ListContentProvider();
/**
@@ -135,12 +137,22 @@
form.setWeights(new int[]{1, 3});
- runtimeListener = new RubyRuntime.Listener() {
- public void selectedInterpreterChanged() {
- updatePage();
+ runtimeListener = new IInterpreterInstallChangedListener() {
+ public void defaultInterpreterInstallChanged(IInterpreter previous,
+ IInterpreter current) {
+ updatePage();
}
+
+ public void interpreterAdded(IInterpreter newVm) {
+ }
+
+ public void interpreterChanged(PropertyChangeEvent event) {
+ }
+
+ public void interpreterRemoved(IInterpreter removedVm) {
+ }
};
- RubyRuntime.getDefault().addListener(runtimeListener);
+ RubyRuntime.addInterpreterInstallChangedListener(runtimeListener);
RubyPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) {
@@ -190,7 +202,7 @@
public void dispose() {
descriptionUpdater.requestStop();
- RubyRuntime.getDefault().removeListener(runtimeListener);
+ RubyRuntime.removeInterpreterInstallChangedListener(runtimeListener);
super.dispose();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 14:26:56
|
Revision: 1789
http://svn.sourceforge.net/rubyeclipse/?rev=1789&view=rev
Author: cawilliams
Date: 2007-01-18 06:26:54 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
move RubyRuntime to externally facing package (like JavaRuntime is)
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-18 14:26:54 UTC (rev 1789)
@@ -0,0 +1,660 @@
+package org.rubypeople.rdt.launching;
+
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.transform.TransformerException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.variables.VariablesPlugin;
+import org.rubypeople.rdt.internal.launching.CompositeId;
+import org.rubypeople.rdt.internal.launching.RdtLaunchingMessages;
+import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin;
+import org.rubypeople.rdt.internal.launching.RubyInterpreter;
+import org.rubypeople.rdt.internal.launching.VMDefinitionsContainer;
+import org.rubypeople.rdt.internal.launching.VMStandin;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+public class RubyRuntime {
+ private static final String TAG_INTERPRETER = "interpreter";
+ private static final String ATTR_PATH = "path";
+ private static final String ATTR_NAME = "name";
+ private static final String ATTR_SELECTED = "selected";
+
+ /**
+ * Loadpath container used for a project's Ruby
+ * (value <code>"org.rubypeople.rdt.launching.RUBY_CONTAINER"</code>). A
+ * container is resolved in the context of a specific Ruby project, to one
+ * or more system libraries contained in the Ruby std library. The container can have zero
+ * or two path segments following the container name. When no segments
+ * follow the container name, the workspace default Ruby is used to build a
+ * project. Otherwise the segments identify a specific Ruby used to build a
+ * project:
+ * <ol>
+ * <li>VM Install Type Identifier - identifies the type of Ruby VM used to build the
+ * project. For example, the standard VM.</li>
+ * <li>VM Install Name - a user defined name that identifies that a specific VM
+ * of the above kind. For example, <code>JRuby 1.8.4</code>. This information is
+ * shared in a projects loadpath file, so teams must agree on Ruby VM naming
+ * conventions.</li>
+ * </ol>
+ * @since 0.9.0
+ */
+ public static final String RUBY_CONTAINER = RdtLaunchingPlugin.getUniqueIdentifier() + "RUBY_CONTAINER"; //$NON-NLS-1$
+
+ /**
+ * Preference key for the String of XML that defines all installed VMs.
+ *
+ * @since 0.9.0
+ */
+ public static final String PREF_VM_XML = RdtLaunchingPlugin.getUniqueIdentifier() + ".PREF_VM_XML"; //$NON-NLS-1$
+
+ /**
+ * Simple identifier constant (value <code>"vmInstalls"</code>) for the
+ * VM installs extension point.
+ *
+ * @since 0.9.0
+ */
+ public static final String EXTENSION_POINT_VM_INSTALLS = "vmInstalls"; //$NON-NLS-1$
+
+ private static IInterpreterInstallType[] fgInterpreterTypes= null;
+
+ protected static RubyRuntime runtime;
+ private static Object fgVMLock = new Object();
+ private static boolean fgInitializingVMs;
+ private static String fgDefaultVMId;
+ private static String fgDefaultVMConnectorId;
+
+ /**
+ * Set of IDs of VMs contributed via vmInstalls extension point.
+ */
+ private static Set<String> fgContributedVMs = new HashSet<String>();
+
+ protected List<IInterpreter> installedInterpreters;
+ protected IInterpreter selectedInterpreter;
+ private List<Listener> listeners = new ArrayList<Listener>();
+
+ public static interface Listener {
+ void selectedInterpreterChanged();
+ }
+
+ protected RubyRuntime() {
+ super();
+ }
+
+ public static RubyRuntime getDefault() {
+ if (runtime == null) {
+ runtime = new RubyRuntime();
+ }
+ return runtime;
+ }
+
+ public void addListener(Listener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(Listener listener) {
+ listeners.remove(listener);
+ }
+
+ public IInterpreter getSelectedInterpreter() {
+ if (selectedInterpreter == null) {
+ loadRuntimeConfiguration();
+ }
+ return selectedInterpreter;
+ }
+
+ public IInterpreter getInterpreter(String name) {
+ Iterator interpreters = getInstalledInterpreters().iterator();
+ while(interpreters.hasNext()) {
+ IInterpreter each = (IInterpreter) interpreters.next();
+ if (each.getName().equals(name))
+ return each;
+ }
+
+ return getSelectedInterpreter();
+ }
+
+ public void setSelectedInterpreter(IInterpreter anInterpreter) {
+ if (selectedInterpreter == anInterpreter) return;
+ selectedInterpreter = anInterpreter;
+ saveRuntimeConfiguration();
+ for (Iterator<Listener> iter = listeners.iterator(); iter.hasNext();) {
+ Listener listener = iter.next();
+ listener.selectedInterpreterChanged();
+ }
+ }
+
+ public void addInstalledInterpreter(IInterpreter anInterpreter) {
+ getInstalledInterpreters().add(anInterpreter);
+ if (getInstalledInterpreters().size() == 1)
+ setSelectedInterpreter(getInstalledInterpreters().get(0));
+ else
+ saveRuntimeConfiguration();
+ }
+
+ public List<IInterpreter> getInstalledInterpreters() {
+ if (installedInterpreters == null)
+ loadRuntimeConfiguration();
+ return installedInterpreters;
+ }
+
+ public void setInstalledInterpreters(List<IInterpreter> newInstalledInterpreters) {
+ installedInterpreters = newInstalledInterpreters;
+ if (installedInterpreters.size() > 0)
+ setSelectedInterpreter(installedInterpreters.get(0));
+ else
+ setSelectedInterpreter(null);
+ saveRuntimeConfiguration();
+ }
+
+ protected void saveRuntimeConfiguration() {
+ writeXML(getRuntimeConfigurationWriter());
+ }
+
+ protected Writer getRuntimeConfigurationWriter() {
+ try {
+ OutputStream stream = new BufferedOutputStream(new FileOutputStream(getRuntimeConfigurationFile()));
+ return new OutputStreamWriter(stream);
+ } catch (FileNotFoundException e) {}
+
+ return null;
+ }
+
+ protected void loadRuntimeConfiguration() {
+ installedInterpreters = new ArrayList<IInterpreter>();
+ try {
+ XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
+ reader.setContentHandler(getRuntimeConfigurationContentHandler());
+ Reader fileReader = this.getRuntimeConfigurationReader() ;
+ if (fileReader == null) {
+ // FIXME If we get a better algorithm for auto detection we should use it, but apparently this didn't make people happy
+// autoDetectRubyInterpreter();
+ return ;
+ }
+ reader.parse(new InputSource(fileReader)) ;
+ } catch(Exception e) {
+ RdtLaunchingPlugin.log(e);
+ }
+ }
+
+ private void autoDetectRubyInterpreter() {
+ File path = null;
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ path = new File("/ruby/bin/ruby.exe");
+ } else {
+ //FIXME Why not use `which ruby` or something?
+ path = new File("/usr/local/bin/ruby");
+ }
+ IInterpreter interpreter = new RubyInterpreter("Default Ruby Interpreter", path);
+ installedInterpreters.add(interpreter);
+ selectedInterpreter = interpreter;
+ }
+
+ protected Reader getRuntimeConfigurationReader() {
+ try {
+ return new FileReader(getRuntimeConfigurationFile());
+ } catch(FileNotFoundException e) {
+ return null ;
+ }
+ }
+
+ protected void writeXML(Writer writer) {
+ try {
+ writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig>");
+ Iterator<IInterpreter> interpretersIterator = installedInterpreters.iterator();
+ while (interpretersIterator.hasNext()) {
+ writer.write("<");
+ writer.write(TAG_INTERPRETER);
+ writer.write(" ");
+ writer.write(ATTR_NAME);
+ writer.write("=\"");
+
+ IInterpreter entry = interpretersIterator.next();
+ writer.write(entry.getName());
+ writer.write("\" ");
+ writer.write(ATTR_PATH);
+ writer.write("=\"");
+ writer.write(entry.getInstallLocation().getPath());
+ writer.write("\"");
+ if (entry.equals(selectedInterpreter)) {
+ writer.write(" ");
+ writer.write(ATTR_SELECTED);
+ writer.write("=\"true\"");
+ }
+
+ writer.write("/>");
+ }
+ writer.write("</runtimeconfig>");
+ writer.flush();
+ } catch(IOException e) {
+ RdtLaunchingPlugin.log(e);
+ }
+ }
+
+ protected ContentHandler getRuntimeConfigurationContentHandler() {
+ return new ContentHandler() {
+ public void setDocumentLocator(Locator locator) {}
+ public void startDocument() throws SAXException {}
+ public void endDocument() throws SAXException {}
+ public void startPrefixMapping(String prefix, String uri) throws SAXException {}
+ public void endPrefixMapping(String prefix) throws SAXException {}
+ public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+ if (TAG_INTERPRETER.equals(qName)) {
+ String interpreterName = atts.getValue(ATTR_NAME);
+ File installLocation = new File(atts.getValue(ATTR_PATH));
+ IInterpreter interpreter = new RubyInterpreter(interpreterName, installLocation);
+ installedInterpreters.add(interpreter);
+ if (atts.getValue(ATTR_SELECTED) != null)
+ selectedInterpreter = interpreter;
+ }
+ }
+ public void endElement(String namespaceURI, String localName, String qName) throws SAXException {}
+ public void characters(char[] ch, int start, int length) throws SAXException {}
+ public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
+ public void processingInstruction(String target, String data) throws SAXException {}
+ public void skippedEntity(String name) throws SAXException {}
+ };
+ }
+
+ protected File getRuntimeConfigurationFile() {
+ IPath stateLocation = RdtLaunchingPlugin.getDefault().getStateLocation();
+ IPath fileLocation = stateLocation.append("runtimeConfiguration.xml");
+ return new File(fileLocation.toOSString());
+ }
+
+ public static void addInterpreterInstallChangedListener(IInterpreterInstallChangedListener listener) {
+ // TODO Implement and add to listeners, and replace the addListener(Listener) stuff
+
+ }
+ /**
+ * Returns the VM install type with the given unique id.
+ * @param id the VM install type unique id
+ * @return The VM install type for the given id, or <code>null</code> if no
+ * VM install type with the given id is registered.
+ */
+ public static IInterpreterInstallType getInterpreterInstallType(String id) {
+ IInterpreterInstallType[] vmTypes= getInterpreterInstallTypes();
+ for (int i= 0; i < vmTypes.length; i++) {
+ if (vmTypes[i].getId().equals(id)) {
+ return vmTypes[i];
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the list of registered VM types. VM types are registered via
+ * <code>"org.rubypeople.rdt.launching.vmTypes"</code> extension point.
+ * Returns an empty list if there are no registered VM types.
+ *
+ * @return the list of registered VM types
+ */
+ public static IInterpreterInstallType[] getInterpreterInstallTypes() {
+ initializeInterpreters();
+ return fgInterpreterTypes;
+ }
+
+ public static IInterpreter getDefaultInterpreterInstall() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Perform VM type and VM install initialization. Does not hold locks
+ * while performing change notification.
+ *
+ * @since 3.2
+ */
+ private static void initializeInterpreters() {
+ VMDefinitionsContainer vmDefs = null;
+ boolean setPref = false;
+ synchronized (fgVMLock) {
+ if (fgInterpreterTypes == null) {
+ try {
+ fgInitializingVMs = true;
+ // 1. load VM type extensions
+ initializeVMTypeExtensions();
+ try {
+ vmDefs = new VMDefinitionsContainer();
+ // 2. add persisted VMs
+ setPref = addPersistedVMs(vmDefs);
+
+ // 3. load contributed VM installs
+ addVMExtensions(vmDefs);
+ // 4. verify default VM is valid
+ String defId = vmDefs.getDefaultVMInstallCompositeID();
+ boolean validDef = false;
+ if (defId != null) {
+ Iterator iterator = vmDefs.getValidVMList().iterator();
+ while (iterator.hasNext()) {
+ IInterpreter vm = (IInterpreter) iterator.next();
+ if (getCompositeIdFromVM(vm).equals(defId)) {
+ validDef = true;
+ break;
+ }
+ }
+ }
+ if (!validDef) {
+ // use the first as the default
+ setPref = true;
+ List list = vmDefs.getValidVMList();
+ if (!list.isEmpty()) {
+ IInterpreter vm = (IInterpreter) list.get(0);
+ vmDefs.setDefaultVMInstallCompositeID(getCompositeIdFromVM(vm));
+ }
+ }
+ fgDefaultVMId = vmDefs.getDefaultVMInstallCompositeID();
+ fgDefaultVMConnectorId = vmDefs.getDefaultVMInstallConnectorTypeID();
+
+ // Create the underlying VMs for each valid VM
+ List vmList = vmDefs.getValidVMList();
+ Iterator vmListIterator = vmList.iterator();
+ while (vmListIterator.hasNext()) {
+ VMStandin vmStandin = (VMStandin) vmListIterator.next();
+ vmStandin.convertToRealVM();
+ }
+
+
+ } catch (IOException e) {
+ RdtLaunchingPlugin.log(e);
+ }
+ } finally {
+ fgInitializingVMs = false;
+ }
+ }
+ }
+ if (vmDefs != null) {
+ // notify of initial VMs for backwards compatibility
+ IInterpreterInstallType[] installTypes = getInterpreterInstallTypes();
+ for (int i = 0; i < installTypes.length; i++) {
+ IInterpreterInstallType type = installTypes[i];
+ IInterpreter[] installs = type.getInterpreterInstalls();
+ for (int j = 0; j < installs.length; j++) {
+ fireInterpreterAdded(installs[j]);
+ }
+ }
+
+ // save settings if required
+ if (setPref) {
+ try {
+ String xml = vmDefs.getAsXML();
+ RdtLaunchingPlugin.getDefault().getPluginPreferences().setValue(PREF_VM_XML, xml);
+ } catch (ParserConfigurationException e) {
+ RdtLaunchingPlugin.log(e);
+ } catch (IOException e) {
+ RdtLaunchingPlugin.log(e);
+ } catch (TransformerException e) {
+ RdtLaunchingPlugin.log(e);
+ }
+
+ }
+ }
+ }
+
+ /**
+ * Initializes vm type extensions.
+ */
+ private static void initializeVMTypeExtensions() {
+ IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(RdtLaunchingPlugin.PLUGIN_ID, "vmInstallTypes"); //$NON-NLS-1$
+ IConfigurationElement[] configs= extensionPoint.getConfigurationElements();
+ MultiStatus status= new MultiStatus(RdtLaunchingPlugin.getUniqueIdentifier(), IStatus.OK, RdtLaunchingMessages.RubyRuntime_exceptionOccurred, null);
+ fgInterpreterTypes= new IInterpreterInstallType[configs.length];
+
+ for (int i= 0; i < configs.length; i++) {
+ try {
+ IInterpreterInstallType vmType= (IInterpreterInstallType)configs[i].createExecutableExtension("class"); //$NON-NLS-1$
+ fgInterpreterTypes[i]= vmType;
+ } catch (CoreException e) {
+ status.add(e.getStatus());
+ }
+ }
+ if (!status.isOK()) {
+ //only happens on a CoreException
+ RdtLaunchingPlugin.log(status);
+ //cleanup null entries in fgVMTypes
+ List<IInterpreterInstallType> temp= new ArrayList<IInterpreterInstallType>(fgInterpreterTypes.length);
+ for (int i = 0; i < fgInterpreterTypes.length; i++) {
+ if(fgInterpreterTypes[i] != null) {
+ temp.add(fgInterpreterTypes[i]);
+ }
+ fgInterpreterTypes= new IInterpreterInstallType[temp.size()];
+ fgInterpreterTypes= temp.toArray(fgInterpreterTypes);
+ }
+ }
+ }
+
+ /**
+ * This method loads installed JREs based an existing user preference
+ * or old vm configurations file. The VMs found in the preference
+ * or vm configurations file are added to the given VM definitions container.
+ *
+ * Returns whether the user preferences should be set - i.e. if it was
+ * not already set when initialized.
+ */
+ private static boolean addPersistedVMs(VMDefinitionsContainer vmDefs) throws IOException {
+ // Try retrieving the VM preferences from the preference store
+ String vmXMLString = getPreferences().getString(PREF_VM_XML);
+
+ // If the preference was found, load VMs from it into memory
+ if (vmXMLString.length() > 0) {
+ try {
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(vmXMLString.getBytes());
+ VMDefinitionsContainer.parseXMLIntoContainer(inputStream, vmDefs);
+ return false;
+ } catch (IOException ioe) {
+ RdtLaunchingPlugin.log(ioe);
+ }
+ } else {
+ // Otherwise, look for the old file that previously held the VM definitions
+ IPath stateLocation= RdtLaunchingPlugin.getDefault().getStateLocation();
+ IPath stateFile= stateLocation.append("vmConfiguration.xml"); //$NON-NLS-1$
+ File file = new File(stateFile.toOSString());
+
+ if (file.exists()) {
+ // If file exists, load VM definitions from it into memory and write the definitions to
+ // the preference store WITHOUT triggering any processing of the new value
+ FileInputStream fileInputStream = new FileInputStream(file);
+ VMDefinitionsContainer.parseXMLIntoContainer(fileInputStream, vmDefs);
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Returns the preference store for the launching plug-in.
+ *
+ * @return the preference store for the launching plug-in
+ * @since 0.9.0
+ */
+ public static Preferences getPreferences() {
+ return RdtLaunchingPlugin.getDefault().getPluginPreferences();
+ }
+
+ /**
+ * Returns a String that uniquely identifies the specified VM across all VM types.
+ *
+ * @param vm the instance of IVMInstallType to be identified
+ *
+ * @since 2.1
+ */
+ public static String getCompositeIdFromVM(IInterpreter vm) {
+ if (vm == null) {
+ return null;
+ }
+ IInterpreterInstallType vmType= vm.getInterpreterInstallType();
+ String typeID= vmType.getId();
+ CompositeId id= new CompositeId(new String[] { typeID, vm.getId() });
+ return id.toString();
+ }
+
+ /**
+ * Loads contributed VM installs
+ * @since 3.2
+ */
+ private static void addVMExtensions(VMDefinitionsContainer vmDefs) {
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(RdtLaunchingPlugin.PLUGIN_ID, RubyRuntime.EXTENSION_POINT_VM_INSTALLS);
+ IConfigurationElement[] configs= extensionPoint.getConfigurationElements();
+ for (int i = 0; i < configs.length; i++) {
+ IConfigurationElement element = configs[i];
+ try {
+ if ("vmInstall".equals(element.getName())) { //$NON-NLS-1$
+ String vmType = element.getAttribute("vmInstallType"); //$NON-NLS-1$
+ if (vmType == null) {
+ abort(MessageFormat.format("Missing required vmInstallType attribute for vmInstall contributed by {0}", //$NON-NLS-1$
+ (Object[]) new String[]{element.getContributor().getName()}), null);
+ }
+ String id = element.getAttribute("id"); //$NON-NLS-1$
+ if (id == null) {
+ abort(MessageFormat.format("Missing required id attribute for vmInstall contributed by {0}", //$NON-NLS-1$
+ (Object[]) new String[]{element.getContributor().getName()}), null);
+ }
+ IInterpreterInstallType installType = getInterpreterInstallType(vmType);
+ if (installType == null) {
+ abort(MessageFormat.format("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
+ (Object[]) new String[]{id, element.getContributor().getName(), vmType}), null);
+ }
+ IInterpreter install = installType.findInterpreterInstall(id);
+ if (install == null) {
+ // only load/create if first time we've seen this VM install
+ String name = element.getAttribute("name"); //$NON-NLS-1$
+ if (name == null) {
+ abort(MessageFormat.format("vmInstall {0} contributed by {1} missing required attribute name", //$NON-NLS-1$
+ (Object[]) new String[]{id, element.getContributor().getName()}), null);
+ }
+ String home = element.getAttribute("home"); //$NON-NLS-1$
+ if (home == null) {
+ abort(MessageFormat.format("vmInstall {0} contributed by {1} missing required attribute home", //$NON-NLS-1$
+ (Object[]) new String[]{id, element.getContributor().getName()}), null);
+ }
+ String vmArgs = element.getAttribute("vmArgs"); //$NON-NLS-1$
+ VMStandin standin = new VMStandin(installType, id);
+ standin.setName(name);
+ home = substitute(home);
+ File homeDir = new File(home);
+ if (homeDir.exists()) {
+ try {
+ // adjust for relative path names
+ home = homeDir.getCanonicalPath();
+ homeDir = new File(home);
+ } catch (IOException e) {
+ }
+ }
+ IStatus status = installType.validateInstallLocation(homeDir);
+ if (!status.isOK()) {
+ abort(MessageFormat.format("Illegal install location {0} for vmInstall {1} contributed by {2}: {3}", //$NON-NLS-1$
+ (Object[]) new String[]{home, id, element.getContributor().getName(), status.getMessage()}), null);
+ }
+ standin.setInstallLocation(homeDir);
+ if (vmArgs != null) {
+ standin.setVMArgs(vmArgs);
+ }
+ IConfigurationElement[] libraries = element.getChildren("library"); //$NON-NLS-1$
+ IPath[] locations = null;
+ if (libraries.length > 0) {
+ locations = new IPath[libraries.length];
+ for (int j = 0; j < libraries.length; j++) {
+ IConfigurationElement library = libraries[j];
+ String libPathStr = library.getAttribute("path"); //$NON-NLS-1$
+ if (libPathStr == null) {
+ abort(MessageFormat.format("library for vmInstall {0} contributed by {1} missing required attribute libPath", //$NON-NLS-1$
+ (Object[]) new String[]{id, element.getContributor().getName()}), null);
+ }
+
+ IPath homePath = new Path(home);
+ IPath libPath = homePath.append(substitute(libPathStr));
+ locations[j] = libPath;
+ }
+ }
+ standin.setLibraryLocations(locations);
+ vmDefs.addVM(standin);
+ }
+ fgContributedVMs.add(id);
+ } else {
+ abort(MessageFormat.format("Illegal element {0} in vmInstalls extension contributed by {1}", //$NON-NLS-1$
+ (Object[]) new String[]{element.getName(), element.getContributor().getName()}), null);
+ }
+ } catch (CoreException e) {
+ RdtLaunchingPlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Performs string substitution on the given expression.
+ *
+ * @param expression
+ * @return expression after string substitution
+ * @throws CoreException
+ * @since 0.9.0
+ */
+ private static String substitute(String expression) throws CoreException {
+ return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(expression);
+ }
+
+ /**
+ * Throws a core exception with an internal error status.
+ *
+ * @param message the status message
+ * @param exception lower level exception associated with the
+ * error, or <code>null</code> if none
+ */
+ private static void abort(String message, Throwable exception) throws CoreException {
+ abort(message, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR, exception);
+ }
+
+ /**
+ * Throws a core exception with an internal error status.
+ *
+ * @param message the status message
+ * @param code status code
+ * @param exception lower level exception associated with the
+ *
+ * error, or <code>null</code> if none
+ */
+ private static void abort(String message, int code, Throwable exception) throws CoreException {
+ throw new CoreException(new Status(IStatus.ERROR, RdtLaunchingPlugin.getUniqueIdentifier(), code, message, exception));
+ }
+
+ private static void fireInterpreterAdded(IInterpreter interpreter) {
+ // TODO Actually notify IInterpreterInstallChangedListeners
+
+ }
+
+ public static void fireInterpreterChanged(PropertyChangeEvent event) {
+ // TODO Actually notify IInterpreterInstallChangedListeners
+
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
___________________________________________________________________
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 14:26:17
|
Revision: 1788
http://svn.sourceforge.net/rubyeclipse/?rev=1788&view=rev
Author: cawilliams
Date: 2007-01-18 06:26:08 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
move RubyRuntime to externally facing package (like JavaRuntime is)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyApplicationLaunchConfigurationDelegate.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/ListenerList.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_DebuggerLaunch.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -18,8 +18,8 @@
import org.rubypeople.rdt.internal.debug.core.RubyLineBreakpoint;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
/*
*
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyApplicationShortcut.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -26,8 +26,8 @@
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyApplicationShortcut implements ILaunchShortcut {
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -34,9 +34,9 @@
import org.rubypeople.rdt.internal.debug.ui.preferences.EditInterpreterDialog;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyEnvironmentTab extends AbstractLaunchConfigurationTab {
protected ListViewer loadPathListViewer;
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-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -27,8 +27,8 @@
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyInterpreterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
protected CheckboxTableViewer tableViewer;
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -24,8 +24,8 @@
import org.rubypeople.rdt.internal.debug.ui.RubySourceLocator;
import org.rubypeople.rdt.internal.launching.RubyInterpreter;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.IRubyConstants;
public class TC_RubyApplicationShortcut extends ModifyingResourceTest {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -13,6 +13,7 @@
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.RubyProject;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class InterpreterRunnerConfiguration {
protected ILaunchConfiguration configuration;
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/ListenerList.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/ListenerList.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/ListenerList.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.internal.launching;
+
+
+/**
+ * Local version of org.eclipse.jface.util.ListenerList (modified)s
+ */
+public class ListenerList {
+ /**
+ * The current number of listeners.
+ * Maintains invariant: 0 <= fSize <= listeners.length.
+ */
+ private int fSize;
+
+ /**
+ * The list of listeners. Initially <code>null</code> but initialized
+ * to an array of size capacity the first time a listener is added.
+ * Maintains invariant: listeners != null if and only if fSize != 0
+ */
+ private Object[] fListeners= null;
+
+ /**
+ * The empty array singleton instance, returned by getListeners()
+ * when size == 0.
+ */
+ private static final Object[] EmptyArray= new Object[0];
+
+ /**
+ * Creates a listener list with the given initial capacity.
+ *
+ * @param capacity the number of listeners which this list can initially accept
+ * without growing its internal representation; must be at least 1
+ */
+ public ListenerList(int capacity) {
+ if (capacity < 1) {
+ throw new IllegalArgumentException();
+ }
+ fListeners= new Object[capacity];
+ fSize= 0;
+ }
+
+ /**
+ * Adds a listener to the list.
+ * Has no effect if an identical listener is already registered.
+ *
+ * @param listener a listener
+ */
+ public synchronized void add(Object listener) {
+ if (listener == null) {
+ throw new IllegalArgumentException();
+ }
+ // check for duplicates using identity
+ for (int i= 0; i < fSize; ++i) {
+ if (fListeners[i] == listener) {
+ return;
+ }
+ }
+ // grow array if necessary
+ if (fSize == fListeners.length) {
+ Object[] temp= new Object[(fSize * 2) + 1];
+ System.arraycopy(fListeners, 0, temp, 0, fSize);
+ fListeners= temp;
+ }
+ fListeners[fSize++]= listener;
+ }
+
+ /**
+ * Returns an array containing all the registered listeners.
+ * The resulting array is unaffected by subsequent adds or removes.
+ * If there are no listeners registered, the result is an empty array
+ * singleton instance (no garbage is created).
+ * Use this method when notifying listeners, so that any modifications
+ * to the listener list during the notification will have no effect on the
+ * notification itself.
+ */
+ public synchronized Object[] getListeners() {
+ if (fSize == 0) {
+ return EmptyArray;
+ }
+ Object[] result= new Object[fSize];
+ System.arraycopy(fListeners, 0, result, 0, fSize);
+ return result;
+ }
+
+ /**
+ * Removes a listener from the list.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener a listener
+ */
+ public synchronized void remove(Object listener) {
+ if (listener == null) {
+ throw new IllegalArgumentException();
+ }
+
+ for (int i= 0; i < fSize; ++i) {
+ if (fListeners[i] == listener) {
+ if (--fSize == 0) {
+ fListeners= new Object[1];
+ } else {
+ if (i < fSize) {
+ fListeners[i]= fListeners[fSize];
+ }
+ fListeners[fSize]= null;
+ }
+ return;
+ }
+ }
+ }
+
+ /**
+ * Removes all the listeners from the list.
+ */
+ public void removeAll() {
+ fListeners= new Object[0];
+ fSize= 0;
+ }
+
+ /**
+ * Returns the number of registered listeners
+ *
+ * @return the number of registered listeners
+ */
+ public int size() {
+ return fSize;
+ }
+}
+
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyApplicationLaunchConfigurationDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyApplicationLaunchConfigurationDelegate.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyApplicationLaunchConfigurationDelegate.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -7,6 +7,7 @@
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyApplicationLaunchConfigurationDelegate implements ILaunchConfigurationDelegate {
protected static final InterpreterRunner interpreterRunner = new InterpreterRunner();
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -8,6 +8,7 @@
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.launching.IInterpreter;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyContainerInitializer extends LoadpathContainerInitializer {
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -1,659 +0,0 @@
-package org.rubypeople.rdt.internal.launching;
-
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.rubypeople.rdt.launching.IInterpreter;
-import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
-import org.rubypeople.rdt.launching.IInterpreterInstallType;
-import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
-import org.rubypeople.rdt.launching.PropertyChangeEvent;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-
-public class RubyRuntime {
- private static final String TAG_INTERPRETER = "interpreter";
- private static final String ATTR_PATH = "path";
- private static final String ATTR_NAME = "name";
- private static final String ATTR_SELECTED = "selected";
-
- /**
- * Loadpath container used for a project's Ruby
- * (value <code>"org.rubypeople.rdt.launching.RUBY_CONTAINER"</code>). A
- * container is resolved in the context of a specific Ruby project, to one
- * or more system libraries contained in the Ruby std library. The container can have zero
- * or two path segments following the container name. When no segments
- * follow the container name, the workspace default Ruby is used to build a
- * project. Otherwise the segments identify a specific Ruby used to build a
- * project:
- * <ol>
- * <li>VM Install Type Identifier - identifies the type of Ruby VM used to build the
- * project. For example, the standard VM.</li>
- * <li>VM Install Name - a user defined name that identifies that a specific VM
- * of the above kind. For example, <code>JRuby 1.8.4</code>. This information is
- * shared in a projects loadpath file, so teams must agree on Ruby VM naming
- * conventions.</li>
- * </ol>
- * @since 0.9.0
- */
- public static final String RUBY_CONTAINER = RdtLaunchingPlugin.getUniqueIdentifier() + "RUBY_CONTAINER"; //$NON-NLS-1$
-
- /**
- * Preference key for the String of XML that defines all installed VMs.
- *
- * @since 0.9.0
- */
- public static final String PREF_VM_XML = RdtLaunchingPlugin.getUniqueIdentifier() + ".PREF_VM_XML"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"vmInstalls"</code>) for the
- * VM installs extension point.
- *
- * @since 0.9.0
- */
- public static final String EXTENSION_POINT_VM_INSTALLS = "vmInstalls"; //$NON-NLS-1$
-
- private static IInterpreterInstallType[] fgInterpreterTypes= null;
-
- protected static RubyRuntime runtime;
- private static Object fgVMLock = new Object();
- private static boolean fgInitializingVMs;
- private static String fgDefaultVMId;
- private static String fgDefaultVMConnectorId;
-
- /**
- * Set of IDs of VMs contributed via vmInstalls extension point.
- */
- private static Set<String> fgContributedVMs = new HashSet<String>();
-
- protected List<IInterpreter> installedInterpreters;
- protected IInterpreter selectedInterpreter;
- private List<Listener> listeners = new ArrayList<Listener>();
-
- public static interface Listener {
- void selectedInterpreterChanged();
- }
-
- protected RubyRuntime() {
- super();
- }
-
- public static RubyRuntime getDefault() {
- if (runtime == null) {
- runtime = new RubyRuntime();
- }
- return runtime;
- }
-
- public void addListener(Listener listener) {
- listeners.add(listener);
- }
-
- public void removeListener(Listener listener) {
- listeners.remove(listener);
- }
-
- public IInterpreter getSelectedInterpreter() {
- if (selectedInterpreter == null) {
- loadRuntimeConfiguration();
- }
- return selectedInterpreter;
- }
-
- public IInterpreter getInterpreter(String name) {
- Iterator interpreters = getInstalledInterpreters().iterator();
- while(interpreters.hasNext()) {
- IInterpreter each = (IInterpreter) interpreters.next();
- if (each.getName().equals(name))
- return each;
- }
-
- return getSelectedInterpreter();
- }
-
- public void setSelectedInterpreter(IInterpreter anInterpreter) {
- if (selectedInterpreter == anInterpreter) return;
- selectedInterpreter = anInterpreter;
- saveRuntimeConfiguration();
- for (Iterator<Listener> iter = listeners.iterator(); iter.hasNext();) {
- Listener listener = iter.next();
- listener.selectedInterpreterChanged();
- }
- }
-
- public void addInstalledInterpreter(IInterpreter anInterpreter) {
- getInstalledInterpreters().add(anInterpreter);
- if (getInstalledInterpreters().size() == 1)
- setSelectedInterpreter(getInstalledInterpreters().get(0));
- else
- saveRuntimeConfiguration();
- }
-
- public List<IInterpreter> getInstalledInterpreters() {
- if (installedInterpreters == null)
- loadRuntimeConfiguration();
- return installedInterpreters;
- }
-
- public void setInstalledInterpreters(List<IInterpreter> newInstalledInterpreters) {
- installedInterpreters = newInstalledInterpreters;
- if (installedInterpreters.size() > 0)
- setSelectedInterpreter(installedInterpreters.get(0));
- else
- setSelectedInterpreter(null);
- saveRuntimeConfiguration();
- }
-
- protected void saveRuntimeConfiguration() {
- writeXML(getRuntimeConfigurationWriter());
- }
-
- protected Writer getRuntimeConfigurationWriter() {
- try {
- OutputStream stream = new BufferedOutputStream(new FileOutputStream(getRuntimeConfigurationFile()));
- return new OutputStreamWriter(stream);
- } catch (FileNotFoundException e) {}
-
- return null;
- }
-
- protected void loadRuntimeConfiguration() {
- installedInterpreters = new ArrayList<IInterpreter>();
- try {
- XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
- reader.setContentHandler(getRuntimeConfigurationContentHandler());
- Reader fileReader = this.getRuntimeConfigurationReader() ;
- if (fileReader == null) {
- // FIXME If we get a better algorithm for auto detection we should use it, but apparently this didn't make people happy
-// autoDetectRubyInterpreter();
- return ;
- }
- reader.parse(new InputSource(fileReader)) ;
- } catch(Exception e) {
- RdtLaunchingPlugin.log(e);
- }
- }
-
- private void autoDetectRubyInterpreter() {
- File path = null;
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- path = new File("/ruby/bin/ruby.exe");
- } else {
- //FIXME Why not use `which ruby` or something?
- path = new File("/usr/local/bin/ruby");
- }
- IInterpreter interpreter = new RubyInterpreter("Default Ruby Interpreter", path);
- installedInterpreters.add(interpreter);
- selectedInterpreter = interpreter;
- }
-
- protected Reader getRuntimeConfigurationReader() {
- try {
- return new FileReader(getRuntimeConfigurationFile());
- } catch(FileNotFoundException e) {
- return null ;
- }
- }
-
- protected void writeXML(Writer writer) {
- try {
- writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig>");
- Iterator<IInterpreter> interpretersIterator = installedInterpreters.iterator();
- while (interpretersIterator.hasNext()) {
- writer.write("<");
- writer.write(TAG_INTERPRETER);
- writer.write(" ");
- writer.write(ATTR_NAME);
- writer.write("=\"");
-
- IInterpreter entry = interpretersIterator.next();
- writer.write(entry.getName());
- writer.write("\" ");
- writer.write(ATTR_PATH);
- writer.write("=\"");
- writer.write(entry.getInstallLocation().getPath());
- writer.write("\"");
- if (entry.equals(selectedInterpreter)) {
- writer.write(" ");
- writer.write(ATTR_SELECTED);
- writer.write("=\"true\"");
- }
-
- writer.write("/>");
- }
- writer.write("</runtimeconfig>");
- writer.flush();
- } catch(IOException e) {
- RdtLaunchingPlugin.log(e);
- }
- }
-
- protected ContentHandler getRuntimeConfigurationContentHandler() {
- return new ContentHandler() {
- public void setDocumentLocator(Locator locator) {}
- public void startDocument() throws SAXException {}
- public void endDocument() throws SAXException {}
- public void startPrefixMapping(String prefix, String uri) throws SAXException {}
- public void endPrefixMapping(String prefix) throws SAXException {}
- public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
- if (TAG_INTERPRETER.equals(qName)) {
- String interpreterName = atts.getValue(ATTR_NAME);
- File installLocation = new File(atts.getValue(ATTR_PATH));
- IInterpreter interpreter = new RubyInterpreter(interpreterName, installLocation);
- installedInterpreters.add(interpreter);
- if (atts.getValue(ATTR_SELECTED) != null)
- selectedInterpreter = interpreter;
- }
- }
- public void endElement(String namespaceURI, String localName, String qName) throws SAXException {}
- public void characters(char[] ch, int start, int length) throws SAXException {}
- public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {}
- public void processingInstruction(String target, String data) throws SAXException {}
- public void skippedEntity(String name) throws SAXException {}
- };
- }
-
- protected File getRuntimeConfigurationFile() {
- IPath stateLocation = RdtLaunchingPlugin.getDefault().getStateLocation();
- IPath fileLocation = stateLocation.append("runtimeConfiguration.xml");
- return new File(fileLocation.toOSString());
- }
-
- public static void addInterpreterInstallChangedListener(IInterpreterInstallChangedListener listener) {
- // TODO Implement and add to listeners, and replace the addListener(Listener) stuff
-
- }
- /**
- * Returns the VM install type with the given unique id.
- * @param id the VM install type unique id
- * @return The VM install type for the given id, or <code>null</code> if no
- * VM install type with the given id is registered.
- */
- public static IInterpreterInstallType getInterpreterInstallType(String id) {
- IInterpreterInstallType[] vmTypes= getInterpreterInstallTypes();
- for (int i= 0; i < vmTypes.length; i++) {
- if (vmTypes[i].getId().equals(id)) {
- return vmTypes[i];
- }
- }
- return null;
- }
-
- /**
- * Returns the list of registered VM types. VM types are registered via
- * <code>"org.rubypeople.rdt.launching.vmTypes"</code> extension point.
- * Returns an empty list if there are no registered VM types.
- *
- * @return the list of registered VM types
- */
- public static IInterpreterInstallType[] getInterpreterInstallTypes() {
- initializeInterpreters();
- return fgInterpreterTypes;
- }
-
- public static IInterpreter getDefaultInterpreterInstall() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Perform VM type and VM install initialization. Does not hold locks
- * while performing change notification.
- *
- * @since 3.2
- */
- private static void initializeInterpreters() {
- VMDefinitionsContainer vmDefs = null;
- boolean setPref = false;
- synchronized (fgVMLock) {
- if (fgInterpreterTypes == null) {
- try {
- fgInitializingVMs = true;
- // 1. load VM type extensions
- initializeVMTypeExtensions();
- try {
- vmDefs = new VMDefinitionsContainer();
- // 2. add persisted VMs
- setPref = addPersistedVMs(vmDefs);
-
- // 3. load contributed VM installs
- addVMExtensions(vmDefs);
- // 4. verify default VM is valid
- String defId = vmDefs.getDefaultVMInstallCompositeID();
- boolean validDef = false;
- if (defId != null) {
- Iterator iterator = vmDefs.getValidVMList().iterator();
- while (iterator.hasNext()) {
- IInterpreter vm = (IInterpreter) iterator.next();
- if (getCompositeIdFromVM(vm).equals(defId)) {
- validDef = true;
- break;
- }
- }
- }
- if (!validDef) {
- // use the first as the default
- setPref = true;
- List list = vmDefs.getValidVMList();
- if (!list.isEmpty()) {
- IInterpreter vm = (IInterpreter) list.get(0);
- vmDefs.setDefaultVMInstallCompositeID(getCompositeIdFromVM(vm));
- }
- }
- fgDefaultVMId = vmDefs.getDefaultVMInstallCompositeID();
- fgDefaultVMConnectorId = vmDefs.getDefaultVMInstallConnectorTypeID();
-
- // Create the underlying VMs for each valid VM
- List vmList = vmDefs.getValidVMList();
- Iterator vmListIterator = vmList.iterator();
- while (vmListIterator.hasNext()) {
- VMStandin vmStandin = (VMStandin) vmListIterator.next();
- vmStandin.convertToRealVM();
- }
-
-
- } catch (IOException e) {
- RdtLaunchingPlugin.log(e);
- }
- } finally {
- fgInitializingVMs = false;
- }
- }
- }
- if (vmDefs != null) {
- // notify of initial VMs for backwards compatibility
- IInterpreterInstallType[] installTypes = getInterpreterInstallTypes();
- for (int i = 0; i < installTypes.length; i++) {
- IInterpreterInstallType type = installTypes[i];
- IInterpreter[] installs = type.getInterpreterInstalls();
- for (int j = 0; j < installs.length; j++) {
- fireInterpreterAdded(installs[j]);
- }
- }
-
- // save settings if required
- if (setPref) {
- try {
- String xml = vmDefs.getAsXML();
- RdtLaunchingPlugin.getDefault().getPluginPreferences().setValue(PREF_VM_XML, xml);
- } catch (ParserConfigurationException e) {
- RdtLaunchingPlugin.log(e);
- } catch (IOException e) {
- RdtLaunchingPlugin.log(e);
- } catch (TransformerException e) {
- RdtLaunchingPlugin.log(e);
- }
-
- }
- }
- }
-
- /**
- * Initializes vm type extensions.
- */
- private static void initializeVMTypeExtensions() {
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(RdtLaunchingPlugin.PLUGIN_ID, "vmInstallTypes"); //$NON-NLS-1$
- IConfigurationElement[] configs= extensionPoint.getConfigurationElements();
- MultiStatus status= new MultiStatus(RdtLaunchingPlugin.getUniqueIdentifier(), IStatus.OK, RdtLaunchingMessages.RubyRuntime_exceptionOccurred, null);
- fgInterpreterTypes= new IInterpreterInstallType[configs.length];
-
- for (int i= 0; i < configs.length; i++) {
- try {
- IInterpreterInstallType vmType= (IInterpreterInstallType)configs[i].createExecutableExtension("class"); //$NON-NLS-1$
- fgInterpreterTypes[i]= vmType;
- } catch (CoreException e) {
- status.add(e.getStatus());
- }
- }
- if (!status.isOK()) {
- //only happens on a CoreException
- RdtLaunchingPlugin.log(status);
- //cleanup null entries in fgVMTypes
- List<IInterpreterInstallType> temp= new ArrayList<IInterpreterInstallType>(fgInterpreterTypes.length);
- for (int i = 0; i < fgInterpreterTypes.length; i++) {
- if(fgInterpreterTypes[i] != null) {
- temp.add(fgInterpreterTypes[i]);
- }
- fgInterpreterTypes= new IInterpreterInstallType[temp.size()];
- fgInterpreterTypes= temp.toArray(fgInterpreterTypes);
- }
- }
- }
-
- /**
- * This method loads installed JREs based an existing user preference
- * or old vm configurations file. The VMs found in the preference
- * or vm configurations file are added to the given VM definitions container.
- *
- * Returns whether the user preferences should be set - i.e. if it was
- * not already set when initialized.
- */
- private static boolean addPersistedVMs(VMDefinitionsContainer vmDefs) throws IOException {
- // Try retrieving the VM preferences from the preference store
- String vmXMLString = getPreferences().getString(PREF_VM_XML);
-
- // If the preference was found, load VMs from it into memory
- if (vmXMLString.length() > 0) {
- try {
- ByteArrayInputStream inputStream = new ByteArrayInputStream(vmXMLString.getBytes());
- VMDefinitionsContainer.parseXMLIntoContainer(inputStream, vmDefs);
- return false;
- } catch (IOException ioe) {
- RdtLaunchingPlugin.log(ioe);
- }
- } else {
- // Otherwise, look for the old file that previously held the VM definitions
- IPath stateLocation= RdtLaunchingPlugin.getDefault().getStateLocation();
- IPath stateFile= stateLocation.append("vmConfiguration.xml"); //$NON-NLS-1$
- File file = new File(stateFile.toOSString());
-
- if (file.exists()) {
- // If file exists, load VM definitions from it into memory and write the definitions to
- // the preference store WITHOUT triggering any processing of the new value
- FileInputStream fileInputStream = new FileInputStream(file);
- VMDefinitionsContainer.parseXMLIntoContainer(fileInputStream, vmDefs);
- }
- }
- return true;
- }
-
- /**
- * Returns the preference store for the launching plug-in.
- *
- * @return the preference store for the launching plug-in
- * @since 0.9.0
- */
- public static Preferences getPreferences() {
- return RdtLaunchingPlugin.getDefault().getPluginPreferences();
- }
-
- /**
- * Returns a String that uniquely identifies the specified VM across all VM types.
- *
- * @param vm the instance of IVMInstallType to be identified
- *
- * @since 2.1
- */
- public static String getCompositeIdFromVM(IInterpreter vm) {
- if (vm == null) {
- return null;
- }
- IInterpreterInstallType vmType= vm.getInterpreterInstallType();
- String typeID= vmType.getId();
- CompositeId id= new CompositeId(new String[] { typeID, vm.getId() });
- return id.toString();
- }
-
- /**
- * Loads contributed VM installs
- * @since 3.2
- */
- private static void addVMExtensions(VMDefinitionsContainer vmDefs) {
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(RdtLaunchingPlugin.PLUGIN_ID, RubyRuntime.EXTENSION_POINT_VM_INSTALLS);
- IConfigurationElement[] configs= extensionPoint.getConfigurationElements();
- for (int i = 0; i < configs.length; i++) {
- IConfigurationElement element = configs[i];
- try {
- if ("vmInstall".equals(element.getName())) { //$NON-NLS-1$
- String vmType = element.getAttribute("vmInstallType"); //$NON-NLS-1$
- if (vmType == null) {
- abort(MessageFormat.format("Missing required vmInstallType attribute for vmInstall contributed by {0}", //$NON-NLS-1$
- (Object[]) new String[]{element.getContributor().getName()}), null);
- }
- String id = element.getAttribute("id"); //$NON-NLS-1$
- if (id == null) {
- abort(MessageFormat.format("Missing required id attribute for vmInstall contributed by {0}", //$NON-NLS-1$
- (Object[]) new String[]{element.getContributor().getName()}), null);
- }
- IInterpreterInstallType installType = getInterpreterInstallType(vmType);
- if (installType == null) {
- abort(MessageFormat.format("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
- (Object[]) new String[]{id, element.getContributor().getName(), vmType}), null);
- }
- IInterpreter install = installType.findInterpreterInstall(id);
- if (install == null) {
- // only load/create if first time we've seen this VM install
- String name = element.getAttribute("name"); //$NON-NLS-1$
- if (name == null) {
- abort(MessageFormat.format("vmInstall {0} contributed by {1} missing required attribute name", //$NON-NLS-1$
- (Object[]) new String[]{id, element.getContributor().getName()}), null);
- }
- String home = element.getAttribute("home"); //$NON-NLS-1$
- if (home == null) {
- abort(MessageFormat.format("vmInstall {0} contributed by {1} missing required attribute home", //$NON-NLS-1$
- (Object[]) new String[]{id, element.getContributor().getName()}), null);
- }
- String vmArgs = element.getAttribute("vmArgs"); //$NON-NLS-1$
- VMStandin standin = new VMStandin(installType, id);
- standin.setName(name);
- home = substitute(home);
- File homeDir = new File(home);
- if (homeDir.exists()) {
- try {
- // adjust for relative path names
- home = homeDir.getCanonicalPath();
- homeDir = new File(home);
- } catch (IOException e) {
- }
- }
- IStatus status = installType.validateInstallLocation(homeDir);
- if (!status.isOK()) {
- abort(MessageFormat.format("Illegal install location {0} for vmInstall {1} contributed by {2}: {3}", //$NON-NLS-1$
- (Object[]) new String[]{home, id, element.getContributor().getName(), status.getMessage()}), null);
- }
- standin.setInstallLocation(homeDir);
- if (vmArgs != null) {
- standin.setVMArgs(vmArgs);
- }
- IConfigurationElement[] libraries = element.getChildren("library"); //$NON-NLS-1$
- IPath[] locations = null;
- if (libraries.length > 0) {
- locations = new IPath[libraries.length];
- for (int j = 0; j < libraries.length; j++) {
- IConfigurationElement library = libraries[j];
- String libPathStr = library.getAttribute("path"); //$NON-NLS-1$
- if (libPathStr == null) {
- abort(MessageFormat.format("library for vmInstall {0} contributed by {1} missing required attribute libPath", //$NON-NLS-1$
- (Object[]) new String[]{id, element.getContributor().getName()}), null);
- }
-
- IPath homePath = new Path(home);
- IPath libPath = homePath.append(substitute(libPathStr));
- locations[j] = libPath;
- }
- }
- standin.setLibraryLocations(locations);
- vmDefs.addVM(standin);
- }
- fgContributedVMs.add(id);
- } else {
- abort(MessageFormat.format("Illegal element {0} in vmInstalls extension contributed by {1}", //$NON-NLS-1$
- (Object[]) new String[]{element.getName(), element.getContributor().getName()}), null);
- }
- } catch (CoreException e) {
- RdtLaunchingPlugin.log(e);
- }
- }
- }
-
- /**
- * Performs string substitution on the given expression.
- *
- * @param expression
- * @return expression after string substitution
- * @throws CoreException
- * @since 0.9.0
- */
- private static String substitute(String expression) throws CoreException {
- return VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(expression);
- }
-
- /**
- * Throws a core exception with an internal error status.
- *
- * @param message the status message
- * @param exception lower level exception associated with the
- * error, or <code>null</code> if none
- */
- private static void abort(String message, Throwable exception) throws CoreException {
- abort(message, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR, exception);
- }
-
- /**
- * Throws a core exception with an internal error status.
- *
- * @param message the status message
- * @param code status code
- * @param exception lower level exception associated with the
- *
- * error, or <code>null</code> if none
- */
- private static void abort(String message, int code, Throwable exception) throws CoreException {
- throw new CoreException(new Status(IStatus.ERROR, RdtLaunchingPlugin.getUniqueIdentifier(), code, message, exception));
- }
-
- private static void fireInterpreterAdded(IInterpreter interpreter) {
- // TODO Actually notify IInterpreterInstallChangedListeners
-
- }
-
- public static void fireInterpreterChanged(PropertyChangeEvent event) {
- // TODO Actually notify IInterpreterInstallChangedListeners
-
- }
-}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -12,6 +12,7 @@
import org.rubypeople.rdt.launching.IInterpreter;
import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
import org.rubypeople.rdt.launching.PropertyChangeEvent;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class RubyVMContainer implements ILoadpathContainer {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -32,6 +32,7 @@
import org.rubypeople.rdt.launching.IInterpreter;
import org.rubypeople.rdt.launching.IInterpreter2;
import org.rubypeople.rdt.launching.IInterpreterInstallType;
+import org.rubypeople.rdt.launching.RubyRuntime;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractInterpreter.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -19,7 +19,6 @@
import org.eclipse.core.runtime.Status;
import org.rubypeople.rdt.internal.launching.RdtLaunchingMessages;
import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
/**
* Abstract implementation of a Interpreter install.
* <p>
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -31,6 +31,7 @@
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class TC_RubyRuntime extends TestCase {
protected StringWriter runtimeConfigurationWriter = new StringWriter();
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -23,6 +23,7 @@
import org.eclipse.debug.core.Launch;
import org.rubypeople.eclipse.shams.debug.core.ShamLaunchConfigurationType;
import org.rubypeople.eclipse.testutils.ResourceTools;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class TC_RunnerLaunching extends TestCase {
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -32,10 +32,10 @@
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.debug.ui.launcher.RubyApplicationShortcut;
import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.testunit.ui.TestUnitMessages;
import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class TestUnitLaunchShortcut extends RubyApplicationShortcut {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -40,12 +40,12 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.ViewPart;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.RubyPluginImages;
import org.rubypeople.rdt.internal.ui.rdocexport.RDocUtility;
import org.rubypeople.rdt.internal.ui.rdocexport.RdocListener;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
public class RIView extends ViewPart implements RdocListener {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -17,11 +17,11 @@
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.rubypeople.rdt.internal.launching.RdtLaunchingMessages;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.RubyUIMessages;
import org.rubypeople.rdt.internal.ui.dialogs.StatusInfo;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
/**
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -13,9 +13,9 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.ui.IEditorInput;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
import org.rubypeople.rdt.ui.extensions.ITextHoverProvider;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-01-18 14:14:47 UTC (rev 1787)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-01-18 14:26:08 UTC (rev 1788)
@@ -5,10 +5,10 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.graphics.RGB;
-import org.rubypeople.rdt.internal.launching.RubyRuntime;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.preferences.formatter.ProfileManager;
import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class PreferenceConstants {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 14:14:53
|
Revision: 1787
http://svn.sourceforge.net/rubyeclipse/?rev=1787&view=rev
Author: cawilliams
Date: 2007-01-18 06:14:47 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/plugin.xml
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
Modified: trunk/org.rubypeople.rdt.launching/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.launching/plugin.xml 2007-01-18 14:11:30 UTC (rev 1786)
+++ trunk/org.rubypeople.rdt.launching/plugin.xml 2007-01-18 14:14:47 UTC (rev 1787)
@@ -33,17 +33,17 @@
</extension>
<extension
point="org.rubypeople.rdt.core.loadpathVariableInitializer">
- <classpathVariableInitializer
+ <loadpathVariableInitializer
variable="RUBY_LIB"
- class="org.rubypeople.jdt.internal.launching.RubyLoadpathVariablesInitializer">
- </classpathVariableInitializer>
+ class="org.rubypeople.rdt.internal.launching.RubyLoadpathVariablesInitializer">
+ </loadpathVariableInitializer>
</extension>
<extension
point="org.rubypeople.rdt.core.loadpathContainerInitializer">
- <classpathContainerInitializer
+ <loadpathContainerInitializer
class="org.rubypeople.rdt.internal.launching.RubyContainerInitializer"
id="org.rubypeople.rdt.launching.RUBY_CONTAINER">
- </classpathContainerInitializer>
+ </loadpathContainerInitializer>
</extension>
</plugin>
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMContainer.java 2007-01-18 14:14:47 UTC (rev 1787)
@@ -0,0 +1,100 @@
+package org.rubypeople.rdt.internal.launching;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IPath;
+import org.rubypeople.rdt.core.ILoadpathContainer;
+import org.rubypeople.rdt.core.ILoadpathEntry;
+import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.launching.IInterpreter;
+import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
+import org.rubypeople.rdt.launching.PropertyChangeEvent;
+
+public class RubyVMContainer implements ILoadpathContainer {
+
+ private static Map fgLoadpathEntries;
+ private IInterpreter fInterpreter;
+ private IPath fPath;
+
+ public RubyVMContainer(IInterpreter interpreter, IPath path) {
+ fInterpreter = interpreter;
+ fPath = path;
+ }
+
+ public String getDescription() {
+ return "Ruby System Library";
+ }
+
+ public ILoadpathEntry[] getLoadpathEntries() {
+ return getLoadpathEntries(fInterpreter);
+ }
+
+ /**
+ * Returns the loadpath entries associated with the given VM.
+ *
+ * @param vm
+ * @return loadpath entries
+ */
+ private static ILoadpathEntry[] getLoadpathEntries(IInterpreter vm) {
+ if (fgLoadpathEntries == null) {
+ fgLoadpathEntries = new HashMap(10);
+ // add a listener to clear cached value when a VM changes or is removed
+ IInterpreterInstallChangedListener listener = new IInterpreterInstallChangedListener() {
+ public void defaultInterpreterInstallChanged(IInterpreter previous, IInterpreter current) {
+ }
+
+ public void interpreterChanged(PropertyChangeEvent event) {
+ if (event.getSource() != null) {
+ fgLoadpathEntries.remove(event.getSource());
+ }
+ }
+
+ public void interpreterAdded(IInterpreter newVm) {
+ }
+
+ public void interpreterRemoved(IInterpreter removedVm) {
+ fgLoadpathEntries.remove(removedVm);
+ }
+ };
+ RubyRuntime.addInterpreterInstallChangedListener(listener);
+ }
+ ILoadpathEntry[] entries = (ILoadpathEntry[])fgLoadpathEntries.get(vm);
+ if (entries == null) {
+ entries = computeLoadpathEntries(vm);
+ fgLoadpathEntries.put(vm, entries);
+ }
+ return entries;
+ }
+
+ /**
+ * Computes the loadpath entries associated with a VM - one entry per library.
+ *
+ * @param vm
+ * @return loadpath entries
+ */
+ private static ILoadpathEntry[] computeLoadpathEntries(IInterpreter vm) {
+ IPath[] libs = vm.getLibraryLocations();
+ List entries = new ArrayList(libs.length);
+ for (int i = 0; i < libs.length; i++) {
+ entries.add(RubyCore.newLibraryEntry(libs[i], false));
+ }
+ return (ILoadpathEntry[])entries.toArray(new ILoadpathEntry[entries.size()]);
+ }
+
+ /**
+ * @see ILoadpathContainer#getKind()
+ */
+ public int getKind() {
+ return ILoadpathContainer.K_DEFAULT_SYSTEM;
+ }
+
+ /**
+ * @see ILoadpathContainer#getPath()
+ */
+ public IPath getPath() {
+ return fPath;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 14:11:31
|
Revision: 1786
http://svn.sourceforge.net/rubyeclipse/?rev=1786&view=rev
Author: cawilliams
Date: 2007-01-18 06:11:30 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 14:10:59 UTC (rev 1785)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainerInitializer.java 2007-01-18 14:11:30 UTC (rev 1786)
@@ -18,9 +18,9 @@
if (size > 0) {
if (containerPath.segment(0).equals(RubyRuntime.RUBY_CONTAINER)) {
IInterpreter vm = resolveInterpreter(containerPath);
- RubyContainer container = null;
+ RubyVMContainer container = null;
if (vm != null) {
- container = new RubyContainer(vm, containerPath);
+ container = new RubyVMContainer(vm, containerPath);
}
RubyCore.setLoadpathContainer(containerPath,
new IRubyProject[] { project },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 14:11:03
|
Revision: 1785
http://svn.sourceforge.net/rubyeclipse/?rev=1785&view=rev
Author: cawilliams
Date: 2007-01-18 06:10:59 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainer.java
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainer.java 2007-01-18 13:59:41 UTC (rev 1784)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyContainer.java 2007-01-18 14:10:59 UTC (rev 1785)
@@ -1,85 +0,0 @@
-package org.rubypeople.rdt.internal.launching;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IPath;
-import org.rubypeople.rdt.core.ILoadpathContainer;
-import org.rubypeople.rdt.core.ILoadpathEntry;
-import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.launching.IInterpreter;
-import org.rubypeople.rdt.launching.IInterpreterInstallChangedListener;
-import org.rubypeople.rdt.launching.PropertyChangeEvent;
-
-public class RubyContainer implements ILoadpathContainer {
-
- private static Map fgLoadpathEntries;
- private IInterpreter fInterpreter;
-
- public RubyContainer(IInterpreter interpreter, IPath containerPath) {
- fInterpreter = interpreter;
- }
-
- public String getDescription() {
- return "Ruby System Library";
- }
-
- public ILoadpathEntry[] getLoadpathEntries() {
- return getLoadpathEntries(fInterpreter);
- }
-
- /**
- * Returns the loadpath entries associated with the given VM.
- *
- * @param vm
- * @return loadpath entries
- */
- private static ILoadpathEntry[] getLoadpathEntries(IInterpreter vm) {
- if (fgLoadpathEntries == null) {
- fgLoadpathEntries = new HashMap(10);
- // add a listener to clear cached value when a VM changes or is removed
- IInterpreterInstallChangedListener listener = new IInterpreterInstallChangedListener() {
- public void defaultInterpreterInstallChanged(IInterpreter previous, IInterpreter current) {
- }
-
- public void interpreterChanged(PropertyChangeEvent event) {
- if (event.getSource() != null) {
- fgLoadpathEntries.remove(event.getSource());
- }
- }
-
- public void interpreterAdded(IInterpreter newVm) {
- }
-
- public void interpreterRemoved(IInterpreter removedVm) {
- fgLoadpathEntries.remove(removedVm);
- }
- };
- RubyRuntime.addInterpreterInstallChangedListener(listener);
- }
- ILoadpathEntry[] entries = (ILoadpathEntry[])fgLoadpathEntries.get(vm);
- if (entries == null) {
- entries = computeLoadpathEntries(vm);
- fgLoadpathEntries.put(vm, entries);
- }
- return entries;
- }
-
- /**
- * Computes the loadpath entries associated with a VM - one entry per library.
- *
- * @param vm
- * @return loadpath entries
- */
- private static ILoadpathEntry[] computeLoadpathEntries(IInterpreter vm) {
- IPath[] libs = vm.getLibraryLocations();
- List entries = new ArrayList(libs.length);
- for (int i = 0; i < libs.length; i++) {
- entries.add(RubyCore.newLibraryEntry(libs[i], false));
- }
- return (ILoadpathEntry[])entries.toArray(new ILoadpathEntry[entries.size()]);
- }
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 13:59:48
|
Revision: 1784
http://svn.sourceforge.net/rubyeclipse/?rev=1784&view=rev
Author: cawilliams
Date: 2007-01-18 05:59:41 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/icons/full/obj16/library_obj.gif
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
Added: trunk/org.rubypeople.rdt.ui/icons/full/obj16/library_obj.gif
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.ui/icons/full/obj16/library_obj.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-01-18 13:59:22 UTC (rev 1783)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-01-18 13:59:41 UTC (rev 1784)
@@ -56,6 +56,8 @@
private static final String IMG_OBJS_RUBY_RESOURCE= NAME_PREFIX + "rscript_resource_obj.gif"; //$NON-NLS-1$
private static final String IMG_OBJS_UNKNOWN= NAME_PREFIX + "unknown_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_LIBRARY= NAME_PREFIX + "library_obj.gif"; //$NON-NLS-1$
+
private static final String IMG_CTOOLS_RUBY_IMPORT_CONTAINER = NAME_PREFIX + "imp_c.gif";
private static final String IMG_CTOOLS_RUBY_IMPORT = NAME_PREFIX + "imp_obj.gif";
public static final String IMG_OBJS_TEMPLATE = NAME_PREFIX + "template_obj.gif";
@@ -85,6 +87,8 @@
public static final ImageDescriptor DESC_OBJ_OVERRIDES= createUnManaged(T_OBJ, "over_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OBJ_IMPLEMENTS= createUnManaged(T_OBJ, "implm_co.gif"); //$NON-NLS-1$
+ public static final ImageDescriptor DESC_OBJS_LIBRARY= createManaged(T_OBJ, IMG_OBJS_LIBRARY);
+
public static final ImageDescriptor DESC_OVR_STATIC= createUnManaged(T_OVR, "static_co.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_FINAL= createUnManaged(T_OVR, "final_co.gif"); //$NON-NLS-1$
@@ -99,7 +103,7 @@
public static final ImageDescriptor DESC_OVR_SYNCH_AND_IMPLEMENTS= createUnManaged(T_OVR, "sync_impl.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_CONSTRUCTOR= createUnManaged(T_OVR, "constr_ovr.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_OVR_DEPRECATED= createUnManaged(T_OVR, "deprecated.gif");
-
+
public static final ImageDescriptor DESC_ELCL_FILTER= createUnManaged(T_ELCL, "filter_ps.gif"); //$NON-NLS-1$
public static final ImageDescriptor DESC_DLCL_FILTER= createUnManaged(T_DLCL, "filter_ps.gif"); //$NON-NLS-1$
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java 2007-01-18 13:59:41 UTC (rev 1784)
@@ -0,0 +1,11 @@
+package org.rubypeople.rdt.ui;
+
+import org.rubypeople.rdt.internal.ui.RubyPluginImages;
+
+public interface ISharedImages {
+ /**
+ * Key to access the shared image or image descriptor for a library (class path container).
+ * @since 0.9.0
+ */
+ public static final String IMG_OBJS_LIBRARY= RubyPluginImages.IMG_OBJS_LIBRARY;
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-01-18 13:59:22 UTC (rev 1783)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-01-18 13:59:41 UTC (rev 1784)
@@ -12,6 +12,8 @@
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.internal.SharedImages;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
@@ -34,7 +36,9 @@
private RubyUI() {
// prevent instantiation of RubyUI.
}
-
+
+ private static ISharedImages fgSharedImages= null;
+
/**
* The id of the Ruby plugin (value <code>"org.rubypeople.rdt.ui"</code>).
*/
@@ -98,6 +102,18 @@
}
/**
+ * Returns the shared images for the Java UI.
+ *
+ * @return the shared images manager
+ */
+ public static ISharedImages getSharedImages() {
+ if (fgSharedImages == null)
+ fgSharedImages= new SharedImages();
+
+ return fgSharedImages;
+ }
+
+ /**
* Returns the working copy manager for the Ruby UI plug-in.
*
* @return the working copy manager for the Ruby UI plug-in
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 13:59:23
|
Revision: 1783
http://svn.sourceforge.net/rubyeclipse/?rev=1783&view=rev
Author: cawilliams
Date: 2007-01-18 05:59:22 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathContainer.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathContainer.java 2007-01-18 13:59:09 UTC (rev 1782)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathContainer.java 2007-01-18 13:59:22 UTC (rev 1783)
@@ -1,9 +1,57 @@
package org.rubypeople.rdt.core;
+import org.eclipse.core.runtime.IPath;
+
public interface ILoadpathContainer {
+
+ /**
+ * Kind for a container mapping to an application library
+ */
+ int K_APPLICATION = 1;
+ /**
+ * Kind for a container mapping to a system library
+ */
+ int K_SYSTEM = 2;
+
+ /**
+ * Kind for a container mapping to a default system library, implicitly contributed by the runtime
+ */
+ int K_DEFAULT_SYSTEM = 3;
+
ILoadpathEntry[] getLoadpathEntries();
- String getDescription();
+ /**
+ * Answers a readable description of this container
+ *
+ * @return String - a string description of the container
+ */
+ String getDescription();
+ /**
+ * Answers the kind of this container. Can be either:
+ * <ul>
+ * <li><code>K_APPLICATION</code> if this container maps to an application library</li>
+ * <li><code>K_SYSTEM</code> if this container maps to a system library</li>
+ * <li><code>K_DEFAULT_SYSTEM</code> if this container maps to a default system library (library
+ * implicitly contributed by the runtime).</li>
+ * </ul>
+ * Typically, system containers should be placed first on a build path.
+ * @return the kind of this container
+ */
+ int getKind();
+
+ /**
+ * Answers the container path identifying this container.
+ * A container path is formed by a first ID segment followed with extra segments, which
+ * can be used as additional hints for resolving to this container.
+ * <p>
+ * The container ID is also used to identify a<code>ClasspathContainerInitializer</code>
+ * registered on the extension point "org.eclipse.jdt.core.classpathContainerInitializer", which can
+ * be invoked if needing to resolve the container before it is explicitly set.
+ * <p>
+ * @return IPath - the container path that is associated with this container
+ */
+ IPath getPath();
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-18 13:59:15
|
Revision: 1782
http://svn.sourceforge.net/rubyeclipse/?rev=1782&view=rev
Author: cawilliams
Date: 2007-01-18 05:59:09 -0800 (Thu, 18 Jan 2007)
Log Message:
-----------
oopsie, fix typos
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/schema/loadpathContainerInitializer.exsd
Modified: trunk/org.rubypeople.rdt.core/schema/loadpathContainerInitializer.exsd
===================================================================
--- trunk/org.rubypeople.rdt.core/schema/loadpathContainerInitializer.exsd 2007-01-16 18:43:46 UTC (rev 1781)
+++ trunk/org.rubypeople.rdt.core/schema/loadpathContainerInitializer.exsd 2007-01-18 13:59:09 UTC (rev 1782)
@@ -1,124 +1,121 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jdt.core">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jdt.core" id="loadpathContainerInitializer" name="loadpath Container Initializers"/>
- </appInfo>
- <documentation>
- This extension point allows clients to contribute custom loadpath container initializers,
- which are used to lazily bind loadpath containers to instances of org.rubypeople.rdt.core.ILoadpathContainer.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="loadpathContainerInitializer" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="loadpathContainerInitializer">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- a unique name identifying all containers for which this initializer will be activated.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- the load that implements this container initializer.
- This load must implement a public subload of <code>org.rubypeople.rdt.core.LoadpathContainerInitializer</code> with a public 0-argument constructor.
- </documentation>
- <appInfo>
- <meta.attribute kind="ruby" basedOn="org.rubypeople.rdt.core.LoadpathContainerInitializer"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 0.9.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- Example of a declaration of a <code>loadpathContainerInitializer</code> for a loadpath container named "JDK": <pre>
-<extension point="org.eclipse.jdt.core.loadpathContainerInitializer">
- <loadpathContainerInitializer
- id="JDK"
- class="com.example.MyInitializer"/>
-</extension>
-</pre>
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- Copyright (c) 2000, 2004 IBM Corporation and others.<br>
-All rights reserved. This program and the accompanying materials are made
-available under the terms of the Eclipse Public License v1.0 which accompanies
-this distribution, and is available at <a
-href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.rubypeople.jdt.core">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.rubypeople.jdt.core" id="loadpathContainerInitializer" name="loadpath Container Initializers"/>
+ </appInfo>
+ <documentation>
+ This extension point allows clients to contribute custom loadpath container initializers,
+ which are used to lazily bind loadpath containers to instances of org.rubypeople.rdt.core.ILoadpathContainer.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence>
+ <element ref="loadpathContainerInitializer" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+ a fully qualified identifier of the target extension point
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ an optional identifier of the extension instance
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ an optional name of the extension instance
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="loadpathContainerInitializer">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ a unique name identifying all containers for which this initializer will be activated.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ the load that implements this container initializer.
+ This load must implement a public subload of <code>org.rubypeople.rdt.core.LoadpathContainerInitializer</code> with a public 0-argument constructor.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.9.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ Example of a declaration of a <code>loadpathContainerInitializer</code> for a loadpath container named "JDK": <pre>
+<extension point="org.eclipse.jdt.core.loadpathContainerInitializer">
+ <loadpathContainerInitializer
+ id="JDK"
+ class="com.example.MyInitializer"/>
+</extension>
+</pre>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ Copyright (c) 2000, 2004 IBM Corporation and others.<br>
+All rights reserved. This program and the accompanying materials are made
+available under the terms of the Eclipse Public License v1.0 which accompanies
+this distribution, and is available at <a
+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
+ </documentation>
+ </annotation>
+
+</schema>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-16 18:43:48
|
Revision: 1781
http://svn.sourceforge.net/rubyeclipse/?rev=1781&view=rev
Author: cawilliams
Date: 2007-01-16 10:43:46 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
try to get it to insert the correct version number into the manifest generated
Modified Paths:
--------------
trunk/org.rubypeople.rdt.doc.user/buildDocbook.xml
trunk/org.rubypeople.rdt.doc.user/docbook/modified_eclipse.xsl
Modified: trunk/org.rubypeople.rdt.doc.user/buildDocbook.xml
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/buildDocbook.xml 2007-01-16 17:46:39 UTC (rev 1780)
+++ trunk/org.rubypeople.rdt.doc.user/buildDocbook.xml 2007-01-16 18:43:46 UTC (rev 1781)
@@ -60,6 +60,7 @@
<param name="eclipse.plugin.id" expression="org.rubypeople.rdt.doc.user"/>
<param name="eclipse.plugin.name" expression="%Plugin.name"/>
<param name="eclipse.plugin.provider" expression="%providerName"/>
+ <param name="eclipse.plugin.version" expression="${featureVersion}"/>
<xmlcatalog id="docbook.catalog">
<dtd publicId="-//OASIS//DTD DocBook V3.1//EN" location="${docbook.dtd.dir}/docbookx.dtd"/>
</xmlcatalog>
Modified: trunk/org.rubypeople.rdt.doc.user/docbook/modified_eclipse.xsl
===================================================================
--- trunk/org.rubypeople.rdt.doc.user/docbook/modified_eclipse.xsl 2007-01-16 17:46:39 UTC (rev 1780)
+++ trunk/org.rubypeople.rdt.doc.user/docbook/modified_eclipse.xsl 2007-01-16 18:43:46 UTC (rev 1781)
@@ -180,7 +180,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: <xsl:value-of select="$eclipse.plugin.name"/>
Bundle-SymbolicName: <xsl:value-of select="$eclipse.plugin.id"/>;singleton:=true
-Bundle-Version: 0.0.0
+Bundle-Version: <xsl:value-of select="$eclipse.plugin.version"/>
Bundle-Vendor: <xsl:value-of select="$eclipse.plugin.provider"/>
Bundle-Localization: plugin
Eclipse-LazyStart: true
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-16 17:46:40
|
Revision: 1780
http://svn.sourceforge.net/rubyeclipse/?rev=1780&view=rev
Author: cawilliams
Date: 2007-01-16 09:46:39 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
make some access rule changes to expose stuff that the refactoring guys need
Modified Paths:
--------------
trunk/org.jruby/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
Modified: trunk/org.jruby/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.jruby/META-INF/MANIFEST.MF 2007-01-16 16:37:33 UTC (rev 1779)
+++ trunk/org.jruby/META-INF/MANIFEST.MF 2007-01-16 17:46:39 UTC (rev 1780)
@@ -14,6 +14,8 @@
org.jruby.ast.types,
org.jruby.ast.util,
org.jruby.ast.visitor,
+ org.jruby.ast.visitor.rewriter,
+ org.jruby.ast.visitor.rewriter.utils,
org.jruby.common,
org.jruby.environment,
org.jruby.evaluator,
Modified: trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-01-16 16:37:33 UTC (rev 1779)
+++ trunk/org.rubypeople.rdt.ui/META-INF/MANIFEST.MF 2007-01-16 17:46:39 UTC (rev 1780)
@@ -11,9 +11,11 @@
org.rubypeople.rdt.internal.corext.util,
org.rubypeople.rdt.internal.ui,
org.rubypeople.rdt.internal.ui.actions,
+ org.rubypeople.rdt.internal.ui.compare,
org.rubypeople.rdt.internal.ui.dialogs,
org.rubypeople.rdt.internal.ui.infoviews,
org.rubypeople.rdt.internal.ui.preferences,
+ org.rubypeople.rdt.internal.ui.preferences.formatter,
org.rubypeople.rdt.internal.ui.rdocexport,
org.rubypeople.rdt.internal.ui.resourcesview,
org.rubypeople.rdt.internal.ui.rubyeditor,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-01-16 16:37:43
|
Revision: 1779
http://svn.sourceforge.net/rubyeclipse/?rev=1779&view=rev
Author: mirkostocker
Date: 2007-01-16 08:37:33 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
fixed the last test that failed on my machine -> greenbar!, and also fixed some warnings
Modified Paths:
--------------
trunk/org.kxml2/src/org/xmlpull/v1/XmlPullParserException.java
trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/runtime/ShamException.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchAlgorithm.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchCollector.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/Scope.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyCodeAnalyzer.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/ShamNode.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
Modified: trunk/org.kxml2/src/org/xmlpull/v1/XmlPullParserException.java
===================================================================
--- trunk/org.kxml2/src/org/xmlpull/v1/XmlPullParserException.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.kxml2/src/org/xmlpull/v1/XmlPullParserException.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -9,7 +9,8 @@
* @author <a href="http://www.extreme.indiana.edu/~aslom/">Aleksander Slominski</a>
*/
public class XmlPullParserException extends Exception {
- protected Throwable detail;
+ private static final long serialVersionUID = 3614579343866398020L;
+ protected Throwable detail;
protected int row = -1;
protected int column = -1;
Modified: trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/runtime/ShamException.java
===================================================================
--- trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/runtime/ShamException.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/runtime/ShamException.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -1,4 +1,5 @@
package org.rubypeople.eclipse.shams.runtime;
public class ShamException extends RuntimeException {
+ private static final long serialVersionUID = 7478278783815573476L;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -697,7 +697,7 @@
* @return the single instance of the Ruby core plug-in runtime class
*/
public static RubyCore getRubyCore() {
- return (RubyCore) getPlugin();
+ return getPlugin();
}
public static boolean isRubyLikeFileName(String name) {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -68,7 +68,7 @@
StringBuffer prefix = new StringBuffer();
boolean isMethod = false;
for (int i = offset; i >= 0; i--) {
- char curChar = (char) source.charAt(i);
+ char curChar = source.charAt(i);
if (curChar == '.') {
isMethod = true;
if (offset == i) { // if it's the first character we looked at,
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -950,7 +950,7 @@
// Merge newly found module name(s)
if ( importedModuleNames != null ) {
- mergedModuleNames.addAll( (List<String>)(Arrays.asList( importedModuleNames )));
+ mergedModuleNames.addAll( (Arrays.asList( importedModuleNames )));
}
mergedModuleNames.addAll( mixins );
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -32,7 +32,7 @@
private final IndexUpdater indexUpdater;
public RubyCodeAnalyzer(IMarkerManager markerManager) {
- this(markerManager, new RubyParser(new ImmediateWarnings(markerManager)), new IndexUpdater(((RubyCore) RubyCore.getPlugin()).getSymbolIndex()));
+ this(markerManager, new RubyParser(new ImmediateWarnings(markerManager)), new IndexUpdater((RubyCore.getPlugin()).getSymbolIndex()));
}
public RubyCodeAnalyzer(IMarkerManager markerManager, RubyParser parser, IndexUpdater indexUpdater) {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchAlgorithm.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchAlgorithm.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchAlgorithm.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -72,9 +72,9 @@
matches = matchCollector.getMatches();
matchCollector = null;
for (Iterator<Match> i = matches.iterator(); i.hasNext();) {
- Match match = (Match) i.next();
+ Match match = i.next();
for (Iterator<TokenEntry> occurrences = match.iterator(); occurrences.hasNext();) {
- TokenEntry mark = (TokenEntry) occurrences.next();
+ TokenEntry mark = occurrences.next();
match.setLineCount(tokens.getLineCount(mark, match));
if (!occurrences.hasNext()) {
int start = mark.getBeginLine();
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchCollector.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchCollector.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/pmd/MatchCollector.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -56,12 +56,12 @@
Set<Match.MatchCode> matchSet = new HashSet<Match.MatchCode>();
Match.MatchCode matchCode = new Match.MatchCode();
for (int i = matchList.size(); i > 1; i--) {
- Match match1 = (Match) matchList.get(i - 1);
- TokenEntry mark1 = (TokenEntry) match1.getMarkSet().iterator().next();
+ Match match1 = matchList.get(i - 1);
+ TokenEntry mark1 = match1.getMarkSet().iterator().next();
matchSet.clear();
matchSet.add(match1.getMatchCode());
for (int j = i - 1; j > 0; j--) {
- Match match2 = (Match) matchList.get(j - 1);
+ Match match2 = matchList.get(j - 1);
if (match1.getTokenCount() != match2.getTokenCount()) {
break;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -53,7 +53,7 @@
arguments.add(restName);
}
if (hasBlock)
- arguments.add("&" + (String) bodyNode.getVariables()[args.getBlockArgNode().getCount()]);
+ arguments.add("&" + bodyNode.getVariables()[args.getBlockArgNode().getCount()]);
return stringListToArray(arguments);
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/Scope.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/Scope.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/Scope.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -20,6 +20,7 @@
*/
public class Scope extends LinkedList<Scope> {
+ private static final long serialVersionUID = -575610283102921342L;
private List<Variable> variables;
private List<Scope> childScopes;
private Scope parentScope;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -156,22 +156,6 @@
}
/**
- * Returns the closest Class scope. Used to insert ClassVarDeclNode
- * references.
- *
- * @return closest encompassing ClassScope, or null if there is not one.
- */
- private Scope getNearestClassScope()
- {
- Scope recursiveScope = currentScope;
- while ( !(recursiveScope.getNode() instanceof ClassNode ) )
- {
- recursiveScope = recursiveScope.getParentScope();
- }
- return null;
- }
-
- /**
* Local assignment may provide a concrete type from the rvalue
*/
public Instruction visitLocalAsgnNode(LocalAsgnNode iVisited) {
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -667,7 +667,7 @@
}
protected IRubyScript getRubyScript(String path) {
- return (IRubyScript)RubyCore.create(getFile(path));
+ return RubyCore.create(getFile(path));
}
public static void waitUntilIndexesReady() {
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyCodeAnalyzer.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyCodeAnalyzer.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_RubyCodeAnalyzer.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -37,7 +37,9 @@
file.setContents(FILE_CONTENTS);
rootNode = new Node(null, 0) {
- public Instruction accept(NodeVisitor visitor) {
+ private static final long serialVersionUID = 9089679642764992140L;
+
+ public Instruction accept(NodeVisitor visitor) {
return null;
}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/ShamNode.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/ShamNode.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/ShamNode.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -18,7 +18,9 @@
public class ShamNode extends Node {
- public ShamNode() {
+ private static final long serialVersionUID = 9194640230446025694L;
+
+ public ShamNode() {
super(null, 0);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -159,7 +159,7 @@
public void addInstalledInterpreter(IInterpreter anInterpreter) {
getInstalledInterpreters().add(anInterpreter);
if (getInstalledInterpreters().size() == 1)
- setSelectedInterpreter((RubyInterpreter) getInstalledInterpreters().get(0));
+ setSelectedInterpreter(getInstalledInterpreters().get(0));
else
saveRuntimeConfiguration();
}
@@ -533,17 +533,17 @@
String vmType = element.getAttribute("vmInstallType"); //$NON-NLS-1$
if (vmType == null) {
abort(MessageFormat.format("Missing required vmInstallType attribute for vmInstall contributed by {0}", //$NON-NLS-1$
- new String[]{element.getContributor().getName()}), null);
+ (Object[]) new String[]{element.getContributor().getName()}), null);
}
String id = element.getAttribute("id"); //$NON-NLS-1$
if (id == null) {
abort(MessageFormat.format("Missing required id attribute for vmInstall contributed by {0}", //$NON-NLS-1$
- new String[]{element.getContributor().getName()}), null);
+ (Object[]) new String[]{element.getContributor().getName()}), null);
}
IInterpreterInstallType installType = getInterpreterInstallType(vmType);
if (installType == null) {
abort(MessageFormat.format("vmInstall {0} contributed by {1} references undefined VM install type {2}", //$NON-NLS-1$
- new String[]{id, element.getContributor().getName(), vmType}), null);
+ (Object[]) new String[]{id, element.getContributor().getName(), vmType}), null);
}
IInterpreter install = installType.findInterpreterInstall(id);
if (install == null) {
@@ -551,12 +551,12 @@
String name = element.getAttribute("name"); //$NON-NLS-1$
if (name == null) {
abort(MessageFormat.format("vmInstall {0} contributed by {1} missing required attribute name", //$NON-NLS-1$
- new String[]{id, element.getContributor().getName()}), null);
+ (Object[]) new String[]{id, element.getContributor().getName()}), null);
}
String home = element.getAttribute("home"); //$NON-NLS-1$
if (home == null) {
abort(MessageFormat.format("vmInstall {0} contributed by {1} missing required attribute home", //$NON-NLS-1$
- new String[]{id, element.getContributor().getName()}), null);
+ (Object[]) new String[]{id, element.getContributor().getName()}), null);
}
String vmArgs = element.getAttribute("vmArgs"); //$NON-NLS-1$
VMStandin standin = new VMStandin(installType, id);
@@ -574,7 +574,7 @@
IStatus status = installType.validateInstallLocation(homeDir);
if (!status.isOK()) {
abort(MessageFormat.format("Illegal install location {0} for vmInstall {1} contributed by {2}: {3}", //$NON-NLS-1$
- new String[]{home, id, element.getContributor().getName(), status.getMessage()}), null);
+ (Object[]) new String[]{home, id, element.getContributor().getName(), status.getMessage()}), null);
}
standin.setInstallLocation(homeDir);
if (vmArgs != null) {
@@ -589,7 +589,7 @@
String libPathStr = library.getAttribute("path"); //$NON-NLS-1$
if (libPathStr == null) {
abort(MessageFormat.format("library for vmInstall {0} contributed by {1} missing required attribute libPath", //$NON-NLS-1$
- new String[]{id, element.getContributor().getName()}), null);
+ (Object[]) new String[]{id, element.getContributor().getName()}), null);
}
IPath homePath = new Path(home);
@@ -603,7 +603,7 @@
fgContributedVMs.add(id);
} else {
abort(MessageFormat.format("Illegal element {0} in vmInstalls extension contributed by {1}", //$NON-NLS-1$
- new String[]{element.getName(), element.getContributor().getName()}), null);
+ (Object[]) new String[]{element.getName(), element.getContributor().getName()}), null);
}
} catch (CoreException e) {
RdtLaunchingPlugin.log(e);
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-16 15:30:53 UTC (rev 1778)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-16 16:37:33 UTC (rev 1779)
@@ -51,11 +51,11 @@
ShamRubyRuntime runtime = new ShamRubyRuntime();
- IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:/RubyInstallRootOne"));
+ IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:\\RubyInstallRootOne"));
runtime.setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne }));
assertEquals("XML should indicate only one interpreter with it being the selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\" selected=\"true\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
- RubyInterpreter interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("C:/RubyInstallRootTwo"));
+ RubyInterpreter interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("C:\\RubyInstallRootTwo"));
runtime.setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne, interpreterTwo }));
assertEquals("XML should indicate both interpreters with the first one being selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\" selected=\"true\"/><interpreter name=\"InterpreterTwo\" path=\"C:\\RubyInstallRootTwo\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-01-16 15:31:03
|
Revision: 1778
http://svn.sourceforge.net/rubyeclipse/?rev=1778&view=rev
Author: mirkostocker
Date: 2007-01-16 07:30:53 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
change jruby version identifier
Modified Paths:
--------------
trunk/org.rubypeople.rdt-feature/feature.xml
Modified: trunk/org.rubypeople.rdt-feature/feature.xml
===================================================================
--- trunk/org.rubypeople.rdt-feature/feature.xml 2007-01-16 15:10:48 UTC (rev 1777)
+++ trunk/org.rubypeople.rdt-feature/feature.xml 2007-01-16 15:30:53 UTC (rev 1778)
@@ -332,7 +332,7 @@
id="org.jruby"
download-size="0"
install-size="0"
- version="1.0.0"
+ version="0.9.2.2742"
unpack="false"/>
</feature>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-01-16 15:10:56
|
Revision: 1777
http://svn.sourceforge.net/rubyeclipse/?rev=1777&view=rev
Author: mirkostocker
Date: 2007-01-16 07:10:48 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
lots of changes:
- updated to jruby from svn and added some of our patches. They'll be removed and replaced by a new JRuby from head as soon as they are accepted by JRuby.
- modified the code to use the new AST features
- added the TI tests to the suite, since they are all green now
Modified Paths:
--------------
trunk/org.jruby/.classpath
trunk/org.jruby/META-INF/MANIFEST.MF
trunk/org.jruby/lib/jruby.jar
trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamFile.java
trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamProject.java
trunk/org.rubypeople.eclipse.shams/src/org/rubypeople/eclipse/shams/resources/ShamResource.java
trunk/org.rubypeople.rdt.astviewer/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.astviewer/plugin.xml
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/preferences/AstViewerPreferencePage.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/preferences/PreferenceConstants.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/preferences/PreferenceInitializer.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/AstUtility.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/AstView.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/TreeObject.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/TreeParent.java
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/ViewContentProvider.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyConventions.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/CreateMethodOperation.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyBuilder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/InOrderVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/MarkerUtility.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyLintVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/ASTUtil.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/DOMFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DataFlowTypeInferrer.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultOccurrencesFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultReferenceFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/ScopingVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceHelper.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/Variable.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/MethodDefinitionLocator.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/MethodInvocationLocator.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/NodeLocator.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/TS_Core.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/TS_InternalCore.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_IndexUpdater.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TS_InternalCoreBuilder.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/TC_RubyParser.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/parser/TS_InternalCoreParser.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/symbols/TS_CoreSymbols.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/util/TS_Util.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TS_InternalFormatter.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/BreakpointAddedReader.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/TestXmlStreamReader.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/WasteReader.java
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/EvaluateRubyProcessOutput.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyCodeTextHover.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewElementWizard.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/extensions/ITextHoverProvider.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/symbols/TC_BlockingSymbolFinder.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyWordFinder.java
Added Paths:
-----------
trunk/org.jruby/patches/
trunk/org.jruby/patches/README
trunk/org.jruby/patches/globalvarnode_name.patch
trunk/org.jruby/patches/position_and_ast.patch
trunk/org.jruby/patches/rewriter.patch
trunk/org.jruby/patches/rootnode_position.patch
trunk/org.jruby/src.zip
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/ti/TS_TypeInference.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.astviewer/bin/
Modified: trunk/org.jruby/.classpath
===================================================================
--- trunk/org.jruby/.classpath 2007-01-16 14:59:14 UTC (rev 1776)
+++ trunk/org.jruby/.classpath 2007-01-16 15:10:48 UTC (rev 1777)
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/jruby.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/jruby.jar" sourcepath="src.zip"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/org.jruby/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.jruby/META-INF/MANIFEST.MF 2007-01-16 14:59:14 UTC (rev 1776)
+++ trunk/org.jruby/META-INF/MANIFEST.MF 2007-01-16 15:10:48 UTC (rev 1777)
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: Jruby Plug-in
Bundle-SymbolicName: org.jruby
-Bundle-Version: 1.0.0
+Bundle-Version: 0.9.2.2742
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime
Eclipse-LazyStart: false
Modified: trunk/org.jruby/lib/jruby.jar
===================================================================
(Binary files differ)
Added: trunk/org.jruby/patches/README
===================================================================
--- trunk/org.jruby/patches/README (rev 0)
+++ trunk/org.jruby/patches/README 2007-01-16 15:10:48 UTC (rev 1777)
@@ -0,0 +1 @@
+Patches applied to JRuby (revision 2742), can be removed as soon as they are accepted and included into official JRuby -- Mirko Stocker
Added: trunk/org.jruby/patches/globalvarnode_name.patch
===================================================================
--- trunk/org.jruby/patches/globalvarnode_name.patch (rev 0)
+++ trunk/org.jruby/patches/globalvarnode_name.patch 2007-01-16 15:10:48 UTC (rev 1777)
@@ -0,0 +1,21 @@
+Index: src/org/jruby/ast/GlobalVarNode.java
+===================================================================
+--- src/org/jruby/ast/GlobalVarNode.java (revision 1122)
++++ src/org/jruby/ast/GlobalVarNode.java (working copy)
+@@ -33,6 +33,7 @@
+ import java.io.IOException;
+ import java.util.List;
+
++import org.jruby.ast.types.INameNode;
+ import org.jruby.ast.visitor.NodeVisitor;
+ import org.jruby.evaluator.Instruction;
+ import org.jruby.lexer.yacc.ISourcePosition;
+@@ -41,7 +42,7 @@
+ * access to a global variable.
+ * @author jpetersen
+ */
+-public class GlobalVarNode extends Node {
++public class GlobalVarNode extends Node implements INameNode {
+ static final long serialVersionUID = -8913633094119740033L;
+
+ private String name;
Added: trunk/org.jruby/patches/position_and_ast.patch
===================================================================
--- trunk/org.jruby/patches/position_and_ast.patch (rev 0)
+++ trunk/org.jruby/patches/position_and_ast.patch 2007-01-16 15:10:48 UTC (rev 1777)
@@ -0,0 +1,3783 @@
+Index: test/testPositions.rb
+===================================================================
+--- test/testPositions.rb (revision 2701)
++++ test/testPositions.rb (working copy)
+@@ -778,7 +778,7 @@
+ nil,
+ nil, #['NewlineNode',0,3,0,22],
+ ['DStrNode',0,2,0,21],
+- ['StrNode',1,1,5,10], # ENEBO: What should this really be?
++ ['StrNode',0,1,0,10], # ENEBO: What should this really be? # MIRKO: This would be much easier for the rewriter
+ ['EvStrNode',1,1,10,17],
+ nil, #['NewlineNode',1,1,12,18],
+ ['VCallNode',1,1,12,16],
+@@ -1037,7 +1037,7 @@
+ list = [
+ nil,
+ nil, #['NewlineNode',0,1,0,9]
+- ['LocalAsgnNode',0,0,0,1],
++ ['LocalAsgnNode',0,0,0,22],
+ ['RescueNode',0,0,10,22],
+ ['RescueBodyNode',0,0,10,22],
+ ['FCallNode',0,0,17,22],
+@@ -1142,3 +1142,372 @@
+ end
+ EOF
+
++#test calls:
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 10],
++nil
++]
++test_tree(list, <<END)
++String.new
++END
++
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 12],
++nil
++]
++test_tree(list, <<END)
++String.new()
++END
++
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 17],
++nil
++]
++test_tree(list, <<END)
++String.new("aaa")
++END
++
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 24],
++nil
++]
++test_tree(list, <<END)
++String.new "aaa" + "bbb"
++END
++
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 17],
++nil
++]
++test_tree(list, <<END)
++String.new 5.to_s
++END
++
++#test arrays
++
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 30],
++['ConstNode', 0, 0, 0, 5],
++['ArrayNode', 0, 0, 10, 30]
++]
++test_tree(list, <<END)
++Array.new "aa", 11000, 20, 340
++END
++
++list = [
++nil,
++nil,
++['CallNode', 0, 0, 0, 26],
++]
++test_tree(list, <<END)
++Array.new String.new(1234)
++END
++
++list = [
++nil,
++nil,
++['ArrayNode', 0, 0, 0, 12],
++]
++test_tree(list, <<END)
++[55, "test"]
++END
++
++list = [
++nil,
++nil,
++nil,
++['ConstNode', 0, 0, 0, 5],
++['ArrayNode', 0, 0, 9, 14],
++]
++test_tree(list, <<END)
++Array.new("a")
++END
++
++list = [
++nil,
++nil,
++nil,
++['DAsgnNode', 0, 0, 12, 19],
++nil,
++nil,
++]
++test_tree(list, <<END, "dasgn node")
++[].each do |element|
++end
++END
++
++list = [
++nil,
++nil,
++nil,
++nil,
++nil,
++['DAsgnNode', 0, 0, 12, 20],
++['DAsgnNode', 0, 0, 22, 30],
++nil,
++nil,
++]
++test_tree(list, <<END, "multiple dasgn nodes")
++[].each do |element1, element2|
++end
++END
++
++list = [
++nil,
++nil,
++['MultipleAsgnNode', 0, 0, 0, 13],
++['ArrayNode', 0, 0, 0, 4],
++['LocalAsgnNode', 0, 0, 0, 1],
++['LocalAsgnNode', 0, 0, 3, 4],
++['ArrayNode', 0, 0, 7, 13],
++['ZArrayNode', 0, 0, 7, 9],
++['HashNode', 0, 0, 11, 13],
++]
++test_tree(list, <<END, "multipleasgn node")
++a, b = [], {}
++END
++
++list = [
++nil,
++nil,
++['IterNode', 0, 2, 15, 34],
++['DAsgnNode', 0, 0, 19, 20],
++nil,
++['FCallNode', 1, 1, 24, 30],
++['ArrayNode', 1, 1, 29, 30],
++['DVarNode', 1, 1, 29, 30],
++['CallNode', 0, 2, 0, 34],
++['ArrayNode', 0, 0, 0, 9],
++['FixnumNode', 0, 0, 1, 2],
++['FixnumNode', 0, 0, 4, 5],
++['FixnumNode', 0, 0, 7, 8]
++]
++test_tree(list, <<END, "iter node")
++[1, 2, 3].each do |i|
++ puts i
++end
++END
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 1, 0, 7],
++['LocalAsgnNode', 0, 0, 0, 6],
++['CallNode', 0, 0, 0, 6],
++['LocalVarNode', 0, 0, 0, 1],
++['ArrayNode', 0, 0, 5, 6],
++['FixnumNode', 0, 0, 5, 6]
++]
++test_tree(list, <<END, "+= assignment")
++a += 5
++END
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 6, 0, 70],
++['ClassNode', 0, 6, 0, 70],
++['Colon2Node', 0, 0, 6, 10],
++nil, #['NewlineNode', 1, 6, 13, 67],
++['DefnNode', 1, 5, 13, 66],
++['ArgumentNode', 1, 1, 17, 21],
++['ArgsNode', 2, 2, 22, 22],
++nil, #['NewlineNode', 2, 5, 26, 61],
++['WhileNode', 2, 4, 26, 60],
++['TrueNode', 2, 2, 32, 36],
++nil, #['NewlineNode', 3, 4, 43, 53],
++['FCallNode', 3, 3, 43, 52],
++['ArrayNode', 3, 3, 48, 52],
++['TrueNode', 3, 3, 48, 52]
++]
++test_tree(list, <<END)
++class Test
++ def test
++ while true
++ puts true
++ end
++ end
++end
++END
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 4, 0, 78],
++['ClassNode', 0, 4, 0, 78],
++['Colon2Node', 0, 0, 6, 14],
++nil, #['NewlineNode', 1, 4, 17, 75],
++['DefnNode', 1, 3, 17, 73],
++['ArgumentNode', 1, 1, 21, 27],
++['ArgsNode', 1, 1, 28, 32],
++['ListNode', 1, 1, 28, 32],
++['ArgumentNode', 1, 1, 28, 29],
++['ArgumentNode', 1, 1, 31, 32],
++nil, #['NewlineNode', 2, 3, 38, 68],
++['LocalAsgnNode', 2, 2, 38, 66],
++['CallNode', 2, 2, 42, 66],
++['ConstNode', 2, 2, 42, 50],
++['ArrayNode', 2, 2, 62, 66],
++['LocalVarNode', 2, 2, 62, 63],
++['LocalVarNode', 2, 2, 65, 66]
++]
++test_tree(list, <<END)
++class Triangle
++ def printC a, b
++ c = Triangle.hypotenuse a, b
++ end
++end
++END
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 7, 0, 91],
++['ClassNode', 0, 7, 0, 90],
++['Colon2Node', 0, 0, 6, 10],
++['BlockNode', 1, 7, 13, 87],
++nil, #['NewlineNode', 1, 4, 13, 49],
++['DefsNode', 1, 3, 13, 48],
++['ConstNode', 1, 1, 17, 21],
++['ArgumentNode', 1, 1, 22, 26],
++['ArgsNode', 1, 1, 27, 31],
++['ListNode', 1, 1, 27, 31],
++['ArgumentNode', 1, 1, 27, 31],
++nil, #['NewlineNode', 2, 3, 36, 43],
++['ReturnNode', 2, 2, 36, 42],
++nil, #['NewlineNode', 1, 7, 13, 87],
++['DefsNode', 4, 6, 51, 86],
++['SelfNode', 4, 4, 55, 59],
++['ArgumentNode', 4, 4, 60, 64],
++['ArgsNode', 4, 4, 65, 69],
++['ListNode', 4, 4, 65, 69],
++['ArgumentNode', 4, 4, 65, 69],
++nil, #['NewlineNode', 5, 6, 74, 81],
++['ReturnNode', 5, 5, 74, 80]
++]
++test_tree(list, <<END, "class methods")
++class Test
++ def Test.test huhu
++ return
++ end
++ def self.test huhu
++ return
++ end
++end
++END
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 4, 0, 67],
++['DefnNode', 0, 4, 0, 67],
++['ArgumentNode', 0, 0, 4, 20],
++['ArgsNode', 1, 1, 21, 21],
++['RescueNode', 1, 4, 23, 67],
++['RescueBodyNode', 2, 4, 33, 67],
++nil, #['NewlineNode', 3, 4, 42, 64],
++['FCallNode', 3, 3, 42, 63],
++['ArrayNode', 3, 3, 47, 63],
++['StrNode', 3, 3, 47, 63],
++nil, #['NewlineNode', 1, 2, 23, 33],
++['LocalAsgnNode', 1, 1, 23, 32],
++['FixnumNode', 1, 1, 31, 32]
++]
++test_tree(list, <<END)
++def value_assertions
++ value = 5
++rescue
++ puts "to the rescue!"
++end
++END
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 6, 0, 63],
++['ClassNode', 0, 6, 0, 63],
++['Colon2Node', 0, 0, 6, 7],
++nil, #['NewlineNode', 1, 6, 11, 60],
++['DefnNode', 1, 5, 11, 58],
++['ArgumentNode', 1, 1, 15, 16],
++['ArgsNode', 2, 2, 18, 18],
++['BlockNode', 2, 5, 22, 53],
++nil, #['NewlineNode', 2, 3, 22, 31],
++['YieldNode', 2, 2, 22, 30],
++['FixnumNode', 2, 2, 28, 29],
++nil, #['NewlineNode', 2, 4, 22, 43],
++['YieldNode', 3, 3, 35, 42],
++nil, #['NewlineNode', 2, 5, 22, 53],
++['YieldNode', 4, 4, 47, 52]
++]
++test_tree(list, <<END, "yield")
++class X
++ def x
++ yield(5)
++ yield()
++ yield
++ end
++end
++END
++
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 1, 0, 25],
++['IterNode', 0, 0, 8, 24],
++nil, #['NewlineNode', 0, 0, 10, 24],
++['FCallNode', 0, 0, 10, 22],
++['ArrayNode', 0, 0, 15, 22],
++['StrNode', 0, 0, 15, 22],
++['CallNode', 0, 0, 0, 24],
++['FixnumNode', 0, 0, 0, 1]
++]
++test_tree(list, <<END)
++5.times { puts "hello" }
++END
++
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 4, 0, 44],
++['ClassNode', 0, 4, 0, 44],
++['Colon2Node', 0, 0, 6, 7],
++nil, #['NewlineNode', 1, 4, 10, 41],
++['DefnNode', 1, 3, 10, 40],
++['ArgumentNode', 1, 1, 14, 24],
++['ArgsNode', 2, 2, 25, 25],
++nil, #['NewlineNode', 2, 3, 29, 35],
++['ZSuperNode', 2, 2, 29, 34]
++]
++test_tree(list, <<END, "zsuper")
++class X
++ def initialize
++ super
++ end
++end
++END
++
++
++list = [
++nil,
++nil, #['NewlineNode', 0, 2, 0, 35],
++['DefnNode', 0, 1, 0, 34],
++['ArgumentNode', 0, 0, 4, 8],
++['ArgsNode', 0, 0, 9, 30],
++['ListNode', 0, 0, 9, 16],
++['ArgumentNode', 0, 0, 9, 10],
++['ArgumentNode', 0, 0, 12, 13],
++['ArgumentNode', 0, 0, 15, 16],
++['BlockArgNode', 0, 0, 24, 30],
++nil, #['ScopeNode', 1, 1, 33, 34]
++]
++test_tree(list, <<END, "method with opt and block arg")
++def test a, b, c, *opt, &block
++end
++END
+Index: src/org/jruby/lexer/yacc/RubyYaccLexer.java
+===================================================================
+--- src/org/jruby/lexer/yacc/RubyYaccLexer.java (revision 2701)
++++ src/org/jruby/lexer/yacc/RubyYaccLexer.java (working copy)
+@@ -160,7 +160,7 @@
+ return src.getPosition(startPosition, inclusive);
+ }
+
+- protected ISourcePosition getPosition() {
++ public ISourcePosition getPosition() {
+ return src.getPosition(null, false);
+ }
+
+Index: src/org/jruby/lexer/yacc/SourcePosition.java
+===================================================================
+--- src/org/jruby/lexer/yacc/SourcePosition.java (revision 2701)
++++ src/org/jruby/lexer/yacc/SourcePosition.java (working copy)
+@@ -157,6 +157,7 @@
+ */
+ public void adjustStartOffset(int relativeValue) {
+ startOffset += relativeValue;
++ if(startOffset < 0) startOffset = 0;
+ }
+
+ /**
+Index: src/org/jruby/parser/DefaultRubyParser.java
+===================================================================
+--- src/org/jruby/parser/DefaultRubyParser.java (revision 2701)
++++ src/org/jruby/parser/DefaultRubyParser.java (working copy)
+@@ -1,4 +1,4 @@
+-// created by jay 1.0.2 (c) 2002-2004 at...@cs...
++// created by jay 1.0 (c) 2002 at...@cs...
+ // skeleton Java 1.0 (c) 2002 at...@cs...
+
+ // line 2 "DefaultRubyParser.y"
+@@ -270,7 +270,7 @@
+
+ /** number of final state.
+ */
+- protected static final int yyFinal = 1;
++ protected static final int yyFinal = 1;
+
+ /** parser tables.
+ Order is mandated by <i>jay</i>.
+@@ -995,7 +995,7 @@
+ case 10:
+ // line 307 "DefaultRubyParser.y"
+ {
+- yyVal = new AliasNode(getPosition(((Token)yyVals[-3+yyTop])), (String) ((Token)yyVals[-2+yyTop]).getValue(), (String) ((Token)yyVals[0+yyTop]).getValue());
++ yyVal = new AliasNode(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])), (String) ((Token)yyVals[-2+yyTop]).getValue(), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 11:
+@@ -1178,89 +1178,90 @@
+ {
+ ((AssignableNode)yyVals[-2+yyTop]).setValueNode(((Node)yyVals[0+yyTop]));
+ yyVal = ((MultipleAsgnNode)yyVals[-2+yyTop]);
++ ((MultipleAsgnNode)yyVals[-2+yyTop]).setPosition(support.union(((MultipleAsgnNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 36:
+- // line 425 "DefaultRubyParser.y"
++ // line 426 "DefaultRubyParser.y"
+ {
+ yyVal = support.newAndNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 37:
+- // line 428 "DefaultRubyParser.y"
++ // line 429 "DefaultRubyParser.y"
+ {
+ yyVal = support.newOrNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 38:
+- // line 431 "DefaultRubyParser.y"
++ // line 432 "DefaultRubyParser.y"
+ {
+ yyVal = new NotNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 39:
+- // line 434 "DefaultRubyParser.y"
++ // line 435 "DefaultRubyParser.y"
+ {
+ yyVal = new NotNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 41:
+- // line 439 "DefaultRubyParser.y"
++ // line 440 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 44:
+- // line 445 "DefaultRubyParser.y"
++ // line 446 "DefaultRubyParser.y"
+ {
+ yyVal = new ReturnNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.ret_args(((Node)yyVals[0+yyTop]), getPosition(((Token)yyVals[-1+yyTop]))));
+ }
+ break;
+ case 45:
+- // line 448 "DefaultRubyParser.y"
++ // line 449 "DefaultRubyParser.y"
+ {
+ yyVal = new BreakNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.ret_args(((Node)yyVals[0+yyTop]), getPosition(((Token)yyVals[-1+yyTop]))));
+ }
+ break;
+ case 46:
+- // line 451 "DefaultRubyParser.y"
++ // line 452 "DefaultRubyParser.y"
+ {
+ yyVal = new NextNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.ret_args(((Node)yyVals[0+yyTop]), getPosition(((Token)yyVals[-1+yyTop]))));
+ }
+ break;
+ case 48:
+- // line 456 "DefaultRubyParser.y"
++ // line 457 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 49:
+- // line 459 "DefaultRubyParser.y"
++ // line 460 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 50:
+- // line 463 "DefaultRubyParser.y"
++ // line 464 "DefaultRubyParser.y"
+ {
+ support.pushBlockScope();
+ }
+ break;
+ case 51:
+- // line 465 "DefaultRubyParser.y"
++ // line 466 "DefaultRubyParser.y"
+ {
+ yyVal = new IterNode(getPosition(((Token)yyVals[-4+yyTop])), ((Node)yyVals[-2+yyTop]), support.getCurrentScope(), ((Node)yyVals[-1+yyTop]), null);
+ support.popCurrentScope();
+ }
+ break;
+ case 52:
+- // line 470 "DefaultRubyParser.y"
++ // line 471 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_fcall(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 53:
+- // line 473 "DefaultRubyParser.y"
++ // line 474 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_fcall(((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]));
+ if (((IterNode)yyVals[0+yyTop]) != null) {
+@@ -1273,13 +1274,13 @@
+ }
+ break;
+ case 54:
+- // line 483 "DefaultRubyParser.y"
++ // line 484 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])); /*.setPosFrom($1);*/
+ }
+ break;
+ case 55:
+- // line 486 "DefaultRubyParser.y"
++ // line 487 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_call(((Node)yyVals[-4+yyTop]), ((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]));
+ if (((IterNode)yyVals[0+yyTop]) != null) {
+@@ -1292,13 +1293,13 @@
+ }
+ break;
+ case 56:
+- // line 496 "DefaultRubyParser.y"
++ // line 497 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_call(((Node)yyVals[-3+yyTop]), ((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 57:
+- // line 499 "DefaultRubyParser.y"
++ // line 500 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_call(((Node)yyVals[-4+yyTop]), ((Token)yyVals[-2+yyTop]), ((Node)yyVals[-1+yyTop]));
+ if (((IterNode)yyVals[0+yyTop]) != null) {
+@@ -1311,115 +1312,117 @@
+ }
+ break;
+ case 58:
+- // line 509 "DefaultRubyParser.y"
++ // line 510 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_super(((Node)yyVals[0+yyTop]), ((Token)yyVals[-1+yyTop])); /* .setPosFrom($2);*/
+ }
+ break;
+ case 59:
+- // line 512 "DefaultRubyParser.y"
++ // line 513 "DefaultRubyParser.y"
+ {
+ yyVal = support.new_yield(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 61:
+- // line 517 "DefaultRubyParser.y"
++ // line 518 "DefaultRubyParser.y"
+ {
+ yyVal = ((MultipleAsgnNode)yyVals[-1+yyTop]);
+ }
+ break;
+ case 63:
+- // line 522 "DefaultRubyParser.y"
++ // line 523 "DefaultRubyParser.y"
+ {
+ yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[-2+yyTop])), new ArrayNode(getPosition(((Token)yyVals[-2+yyTop])), ((MultipleAsgnNode)yyVals[-1+yyTop])), null);
+ }
+ break;
+ case 64:
+- // line 526 "DefaultRubyParser.y"
++ // line 527 "DefaultRubyParser.y"
+ {
+ yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[0+yyTop])), ((ListNode)yyVals[0+yyTop]), null);
+ }
+ break;
+ case 65:
+- // line 529 "DefaultRubyParser.y"
++ // line 530 "DefaultRubyParser.y"
+ {
+- yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-1+yyTop])), ((ListNode)yyVals[-1+yyTop]).add(((Node)yyVals[0+yyTop])), null);
++/*mirko: check*/
++ yyVal = new MultipleAsgnNode(support.union(((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), ((ListNode)yyVals[-1+yyTop]).add(((Node)yyVals[0+yyTop])), null);
++ ((Node)yyVals[-1+yyTop]).setPosition(support.union(((Node)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 66:
+- // line 532 "DefaultRubyParser.y"
++ // line 535 "DefaultRubyParser.y"
+ {
+ yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-2+yyTop])), ((ListNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 67:
+- // line 535 "DefaultRubyParser.y"
++ // line 538 "DefaultRubyParser.y"
+ {
+ yyVal = new MultipleAsgnNode(getPosition(((ListNode)yyVals[-1+yyTop])), ((ListNode)yyVals[-1+yyTop]), new StarNode(getPosition(null)));
+ }
+ break;
+ case 68:
+- // line 538 "DefaultRubyParser.y"
++ // line 541 "DefaultRubyParser.y"
+ {
+ yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[-1+yyTop])), null, ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 69:
+- // line 541 "DefaultRubyParser.y"
++ // line 544 "DefaultRubyParser.y"
+ {
+ yyVal = new MultipleAsgnNode(getPosition(((Token)yyVals[0+yyTop])), null, new StarNode(getPosition(null)));
+ }
+ break;
+ case 71:
+- // line 546 "DefaultRubyParser.y"
++ // line 549 "DefaultRubyParser.y"
+ {
+ yyVal = ((MultipleAsgnNode)yyVals[-1+yyTop]);
+ }
+ break;
+ case 72:
+- // line 550 "DefaultRubyParser.y"
++ // line 553 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(((Node)yyVals[-1+yyTop]).getPosition(), ((Node)yyVals[-1+yyTop]));
+ }
+ break;
+ case 73:
+- // line 553 "DefaultRubyParser.y"
++ // line 556 "DefaultRubyParser.y"
+ {
+ yyVal = ((ListNode)yyVals[-2+yyTop]).add(((Node)yyVals[-1+yyTop]));
+ }
+ break;
+ case 74:
+- // line 557 "DefaultRubyParser.y"
++ // line 560 "DefaultRubyParser.y"
+ {
+ yyVal = support.assignable(((Token)yyVals[0+yyTop]), null);
+ }
+ break;
+ case 75:
+- // line 560 "DefaultRubyParser.y"
++ // line 563 "DefaultRubyParser.y"
+ {
+ yyVal = support.aryset(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
+ }
+ break;
+ case 76:
+- // line 563 "DefaultRubyParser.y"
++ // line 566 "DefaultRubyParser.y"
+ {
+ yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 77:
+- // line 566 "DefaultRubyParser.y"
++ // line 569 "DefaultRubyParser.y"
+ {
+ yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 78:
+- // line 569 "DefaultRubyParser.y"
++ // line 572 "DefaultRubyParser.y"
+ {
+ yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 79:
+- // line 572 "DefaultRubyParser.y"
++ // line 575 "DefaultRubyParser.y"
+ {
+ if (support.isInDef() || support.isInSingle()) {
+ yyerror("dynamic constant assignment");
+@@ -1429,7 +1432,7 @@
+ }
+ break;
+ case 80:
+- // line 579 "DefaultRubyParser.y"
++ // line 582 "DefaultRubyParser.y"
+ {
+ if (support.isInDef() || support.isInSingle()) {
+ yyerror("dynamic constant assignment");
+@@ -1441,43 +1444,43 @@
+ }
+ break;
+ case 81:
+- // line 588 "DefaultRubyParser.y"
++ // line 591 "DefaultRubyParser.y"
+ {
+ support.backrefAssignError(((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 82:
+- // line 592 "DefaultRubyParser.y"
++ // line 595 "DefaultRubyParser.y"
+ {
+ yyVal = support.assignable(((Token)yyVals[0+yyTop]), null);
+ }
+ break;
+ case 83:
+- // line 595 "DefaultRubyParser.y"
++ // line 598 "DefaultRubyParser.y"
+ {
+ yyVal = support.aryset(((Node)yyVals[-3+yyTop]), ((Node)yyVals[-1+yyTop]));
+ }
+ break;
+ case 84:
+- // line 598 "DefaultRubyParser.y"
++ // line 601 "DefaultRubyParser.y"
+ {
+ yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 85:
+- // line 601 "DefaultRubyParser.y"
++ // line 604 "DefaultRubyParser.y"
+ {
+ yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 86:
+- // line 604 "DefaultRubyParser.y"
++ // line 607 "DefaultRubyParser.y"
+ {
+ yyVal = support.attrset(((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 87:
+- // line 607 "DefaultRubyParser.y"
++ // line 610 "DefaultRubyParser.y"
+ {
+ if (support.isInDef() || support.isInSingle()) {
+ yyerror("dynamic constant assignment");
+@@ -1487,7 +1490,7 @@
+ }
+ break;
+ case 88:
+- // line 614 "DefaultRubyParser.y"
++ // line 617 "DefaultRubyParser.y"
+ {
+ if (support.isInDef() || support.isInSingle()) {
+ yyerror("dynamic constant assignment");
+@@ -1499,69 +1502,69 @@
+ }
+ break;
+ case 89:
+- // line 623 "DefaultRubyParser.y"
++ // line 626 "DefaultRubyParser.y"
+ {
+ support.backrefAssignError(((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 90:
+- // line 627 "DefaultRubyParser.y"
++ // line 630 "DefaultRubyParser.y"
+ {
+ yyerror("class/module name must be CONSTANT");
+ }
+ break;
+ case 92:
+- // line 632 "DefaultRubyParser.y"
++ // line 635 "DefaultRubyParser.y"
+ {
+ yyVal = new Colon3Node(support.union(((Token)yyVals[-1+yyTop]), ((Token)yyVals[0+yyTop])), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 93:
+- // line 635 "DefaultRubyParser.y"
++ // line 638 "DefaultRubyParser.y"
+ {
+ yyVal = new Colon2Node(((Token)yyVals[0+yyTop]).getPosition(), null, (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 94:
+- // line 638 "DefaultRubyParser.y"
++ // line 641 "DefaultRubyParser.y"
+ {
+ yyVal = new Colon2Node(support.union(((Node)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 98:
+- // line 644 "DefaultRubyParser.y"
++ // line 647 "DefaultRubyParser.y"
+ {
+ lexer.setState(LexState.EXPR_END);
+ yyVal = ((Token)yyVals[0+yyTop]);
+ }
+ break;
+ case 99:
+- // line 649 "DefaultRubyParser.y"
++ // line 652 "DefaultRubyParser.y"
+ {
+ lexer.setState(LexState.EXPR_END);
+ yyVal = yyVals[0+yyTop];
+ }
+ break;
+ case 102:
+- // line 656 "DefaultRubyParser.y"
++ // line 659 "DefaultRubyParser.y"
+ {
+ yyVal = new UndefNode(getPosition(((Token)yyVals[0+yyTop])), (String) ((Token)yyVals[0+yyTop]).getValue());
+ }
+ break;
+ case 103:
+- // line 659 "DefaultRubyParser.y"
++ // line 662 "DefaultRubyParser.y"
+ {
+ lexer.setState(LexState.EXPR_FNAME);
+ }
+ break;
+ case 104:
+- // line 661 "DefaultRubyParser.y"
++ // line 664 "DefaultRubyParser.y"
+ {
+ yyVal = support.appendToBlock(((Node)yyVals[-3+yyTop]), new UndefNode(getPosition(((Node)yyVals[-3+yyTop])), (String) ((Token)yyVals[0+yyTop]).getValue()));
+ }
+ break;
+ case 172:
+- // line 680 "DefaultRubyParser.y"
++ // line 683 "DefaultRubyParser.y"
+ {
+ yyVal = support.node_assign(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ /* FIXME: Consider fixing node_assign itself rather than single case*/
+@@ -1569,14 +1572,14 @@
+ }
+ break;
+ case 173:
+- // line 685 "DefaultRubyParser.y"
++ // line 688 "DefaultRubyParser.y"
+ {
+ ISourcePosition position = support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop]));
+ yyVal = support.node_assign(((Node)yyVals[-4+yyTop]), new RescueNode(position, ((Node)yyVals[-2+yyTop]), new RescueBodyNode(position, null, ((Node)yyVals[0+yyTop]), null), null));
+ }
+ break;
+ case 174:
+- // line 689 "DefaultRubyParser.y"
++ // line 692 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[0+yyTop]));
+ String name = ((INameNode)yyVals[-2+yyTop]).getName();
+@@ -1590,118 +1593,119 @@
+ yyVal = new OpAsgnAndNode(getPosition(((AssignableNode)yyVals[-2+yyTop])), support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), ((AssignableNode)yyVals[-2+yyTop]));
+ } else {
+ ((AssignableNode)yyVals[-2+yyTop]).setValueNode(support.getOperatorCallNode(support.gettable2(name, ((AssignableNode)yyVals[-2+yyTop]).getPosition()), asgnOp, ((Node)yyVals[0+yyTop])));
++ ((AssignableNode)yyVals[-2+yyTop]).setPosition(support.union(((AssignableNode)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
+ yyVal = ((AssignableNode)yyVals[-2+yyTop]);
+ }
+ }
+ break;
+ case 175:
+- // line 705 "DefaultRubyParser.y"
++ // line 709 "DefaultRubyParser.y"
+ {
+ yyVal = new OpElementAsgnNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop]), (String) ((Token)yyVals[-1+yyTop]).getValue(), ((Node)yyVals[-3+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 176:
+- // line 708 "DefaultRubyParser.y"
++ // line 712 "DefaultRubyParser.y"
+ {
+ yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String) ((Token)yyVals[-2+yyTop]).getValue(), (String) ((Token)yyVals[-1+yyTop]).getValue());
+ }
+ break;
+ case 177:
+- // line 711 "DefaultRubyParser.y"
++ // line 715 "DefaultRubyParser.y"
+ {
+ yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String) ((Token)yyVals[-2+yyTop]).getValue(), (String) ((Token)yyVals[-1+yyTop]).getValue());
+ }
+ break;
+ case 178:
+- // line 714 "DefaultRubyParser.y"
++ // line 718 "DefaultRubyParser.y"
+ {
+ yyVal = new OpAsgnNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop]), ((Node)yyVals[0+yyTop]), (String) ((Token)yyVals[-2+yyTop]).getValue(), (String) ((Token)yyVals[-1+yyTop]).getValue());
+ }
+ break;
+ case 179:
+- // line 717 "DefaultRubyParser.y"
++ // line 721 "DefaultRubyParser.y"
+ {
+ yyerror("constant re-assignment");
+ }
+ break;
+ case 180:
+- // line 720 "DefaultRubyParser.y"
++ // line 724 "DefaultRubyParser.y"
+ {
+ yyerror("constant re-assignment");
+ }
+ break;
+ case 181:
+- // line 723 "DefaultRubyParser.y"
++ // line 727 "DefaultRubyParser.y"
+ {
+ support.backrefAssignError(((Node)yyVals[-2+yyTop]));
+ }
+ break;
+ case 182:
+- // line 726 "DefaultRubyParser.y"
++ // line 730 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[-2+yyTop]));
+ support.checkExpression(((Node)yyVals[0+yyTop]));
+- yyVal = new DotNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]), false);
++ yyVal = new DotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]), false);
+ }
+ break;
+ case 183:
+- // line 731 "DefaultRubyParser.y"
++ // line 735 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[-2+yyTop]));
+ support.checkExpression(((Node)yyVals[0+yyTop]));
+- yyVal = new DotNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]), true);
++ yyVal = new DotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]), true);
+ }
+ break;
+ case 184:
+- // line 736 "DefaultRubyParser.y"
++ // line 740 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "+", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 185:
+- // line 739 "DefaultRubyParser.y"
++ // line 743 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "-", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 186:
+- // line 742 "DefaultRubyParser.y"
++ // line 746 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "*", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 187:
+- // line 745 "DefaultRubyParser.y"
++ // line 749 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "/", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 188:
+- // line 748 "DefaultRubyParser.y"
++ // line 752 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "%", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 189:
+- // line 751 "DefaultRubyParser.y"
++ // line 755 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 190:
+- // line 754 "DefaultRubyParser.y"
++ // line 758 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])), "-@");
+ }
+ break;
+ case 191:
+- // line 757 "DefaultRubyParser.y"
++ // line 761 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "**", ((Node)yyVals[0+yyTop])), "-@");
+ }
+ break;
+ case 192:
+- // line 760 "DefaultRubyParser.y"
++ // line 764 "DefaultRubyParser.y"
+ {
+ if (((Node)yyVals[0+yyTop]) != null && ((Node)yyVals[0+yyTop]) instanceof ILiteralNode) {
+ yyVal = ((Node)yyVals[0+yyTop]);
+@@ -1711,253 +1715,253 @@
+ }
+ break;
+ case 193:
+- // line 767 "DefaultRubyParser.y"
++ // line 771 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "-@");
+ }
+ break;
+ case 194:
+- // line 770 "DefaultRubyParser.y"
++ // line 774 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "|", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 195:
+- // line 773 "DefaultRubyParser.y"
++ // line 777 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "^", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 196:
+- // line 776 "DefaultRubyParser.y"
++ // line 780 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "&", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 197:
+- // line 779 "DefaultRubyParser.y"
++ // line 783 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<=>", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 198:
+- // line 782 "DefaultRubyParser.y"
++ // line 786 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 199:
+- // line 785 "DefaultRubyParser.y"
++ // line 789 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">=", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 200:
+- // line 788 "DefaultRubyParser.y"
++ // line 792 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 201:
+- // line 791 "DefaultRubyParser.y"
++ // line 795 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<=", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 202:
+- // line 794 "DefaultRubyParser.y"
++ // line 798 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "==", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 203:
+- // line 797 "DefaultRubyParser.y"
++ // line 801 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "===", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 204:
+- // line 800 "DefaultRubyParser.y"
++ // line 804 "DefaultRubyParser.y"
+ {
+ yyVal = new NotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "==", ((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 205:
+- // line 803 "DefaultRubyParser.y"
++ // line 807 "DefaultRubyParser.y"
+ {
+ yyVal = support.getMatchNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 206:
+- // line 806 "DefaultRubyParser.y"
++ // line 810 "DefaultRubyParser.y"
+ {
+ yyVal = new NotNode(support.union(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])), support.getMatchNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 207:
+- // line 809 "DefaultRubyParser.y"
++ // line 813 "DefaultRubyParser.y"
+ {
+ yyVal = new NotNode(support.union(((Token)yyVals[-1+yyTop]), ((Node)yyVals[0+yyTop])), support.getConditionNode(((Node)yyVals[0+yyTop])));
+ }
+ break;
+ case 208:
+- // line 812 "DefaultRubyParser.y"
++ // line 816 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[0+yyTop]), "~");
+ }
+ break;
+ case 209:
+- // line 815 "DefaultRubyParser.y"
++ // line 819 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "<<", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 210:
+- // line 818 "DefaultRubyParser.y"
++ // line 822 "DefaultRubyParser.y"
+ {
+ yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), ">>", ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 211:
+- // line 821 "DefaultRubyParser.y"
++ // line 825 "DefaultRubyParser.y"
+ {
+ yyVal = support.newAndNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 212:
+- // line 824 "DefaultRubyParser.y"
++ // line 828 "DefaultRubyParser.y"
+ {
+ yyVal = support.newOrNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 213:
+- // line 827 "DefaultRubyParser.y"
++ // line 831 "DefaultRubyParser.y"
+ {
+ yyVal = new DefinedNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 214:
+- // line 830 "DefaultRubyParser.y"
++ // line 834 "DefaultRubyParser.y"
+ {
+ yyVal = new IfNode(getPosition(((Node)yyVals[-4+yyTop])), support.getConditionNode(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 215:
+- // line 833 "DefaultRubyParser.y"
++ // line 837 "DefaultRubyParser.y"
+ {
+ yyVal = ((Node)yyVals[0+yyTop]);
+ }
+ break;
+ case 216:
+- // line 837 "DefaultRubyParser.y"
++ // line 841 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[0+yyTop]));
+ yyVal = ((Node)yyVals[0+yyTop]);
+ }
+ break;
+ case 218:
+- // line 843 "DefaultRubyParser.y"
++ // line 847 "DefaultRubyParser.y"
+ {
+ warnings.warn(getPosition(((Node)yyVals[-1+yyTop])), "parenthesize argument(s) for future version");
+ yyVal = new ArrayNode(getPosition(((Node)yyVals[-1+yyTop])), ((Node)yyVals[-1+yyTop]));
+ }
+ break;
+ case 219:
+- // line 847 "DefaultRubyParser.y"
++ // line 851 "DefaultRubyParser.y"
+ {
+ yyVal = ((ListNode)yyVals[-1+yyTop]);
+ }
+ break;
+ case 220:
+- // line 850 "DefaultRubyParser.y"
++ // line 854 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), ((ListNode)yyVals[-4+yyTop]), ((Node)yyVals[-1+yyTop]));
+ }
+ break;
+ case 221:
+- // line 854 "DefaultRubyParser.y"
++ // line 858 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
+ }
+ break;
+ case 222:
+- // line 857 "DefaultRubyParser.y"
++ // line 861 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[-1+yyTop]));
+ yyVal = new NewlineNode(getPosition(((Token)yyVals[-2+yyTop])), new SplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])));
+ }
+ break;
+ case 223:
+- // line 862 "DefaultRubyParser.y"
++ // line 866 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(support.union(((Token)yyVals[-2+yyTop]), ((Token)yyVals[0+yyTop])));
+ }
+ break;
+ case 224:
+- // line 865 "DefaultRubyParser.y"
++ // line 869 "DefaultRubyParser.y"
+ {
+ yyVal = ((Node)yyVals[-2+yyTop]);
+ ((Node)yyVal).setPosition(support.union(((Token)yyVals[-3+yyTop]), ((Token)yyVals[0+yyTop])));
+ }
+ break;
+ case 225:
+- // line 869 "DefaultRubyParser.y"
++ // line 873 "DefaultRubyParser.y"
+ {
+ warnings.warn(getPosition(((Token)yyVals[-3+yyTop])), "parenthesize argument(s) for future version");
+ yyVal = new ArrayNode(getPosition(((Token)yyVals[-3+yyTop])), ((Node)yyVals[-2+yyTop]));
+ }
+ break;
+ case 226:
+- // line 873 "DefaultRubyParser.y"
++ // line 877 "DefaultRubyParser.y"
+ {
+ warnings.warn(getPosition(((Token)yyVals[-5+yyTop])), "parenthesize argument(s) for future version");
+ yyVal = ((ListNode)yyVals[-4+yyTop]).add(((Node)yyVals[-2+yyTop]));
+ }
+ break;
+ case 229:
+- // line 881 "DefaultRubyParser.y"
++ // line 885 "DefaultRubyParser.y"
+ {
+ warnings.warn(getPosition(((Node)yyVals[0+yyTop])), "parenthesize argument(s) for future version");
+ yyVal = new ArrayNode(getPosition(((Node)yyVals[0+yyTop])), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 230:
+- // line 885 "DefaultRubyParser.y"
++ // line 889 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_blk_pass(((ListNode)yyVals[-1+yyTop]), ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 231:
+- // line 888 "DefaultRubyParser.y"
++ // line 892 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), ((ListNode)yyVals[-4+yyTop]), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass(((Node)yyVal), ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 232:
+- // line 892 "DefaultRubyParser.y"
++ // line 896 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 233:
+- // line 896 "DefaultRubyParser.y"
++ // line 900 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), new ArrayNode(getPosition(((ListNode)yyVals[-4+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 234:
+- // line 900 "DefaultRubyParser.y"
++ // line 904 "DefaultRubyParser.y"
+ {
+ yyVal = ((ListNode)yyVals[-3+yyTop]).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 235:
+- // line 904 "DefaultRubyParser.y"
++ // line 908 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-6+yyTop])), ((ListNode)yyVals[-6+yyTop]).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
+@@ -1965,226 +1969,226 @@
+ }
+ break;
+ case 236:
+- // line 909 "DefaultRubyParser.y"
++ // line 913 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_blk_pass(new SplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 237:
+- // line 912 "DefaultRubyParser.y"
++ // line 916 "DefaultRubyParser.y"
+ {}
+ break;
+ case 238:
+- // line 914 "DefaultRubyParser.y"
++ // line 918 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_blk_pass(new ArrayNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop])).addAll(((ListNode)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 239:
+- // line 917 "DefaultRubyParser.y"
++ // line 921 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_blk_pass(new ArrayNode(getPosition(((Node)yyVals[-2+yyTop])), ((Node)yyVals[-2+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 240:
+- // line 920 "DefaultRubyParser.y"
++ // line 924 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((Node)yyVals[-4+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-4+yyTop])), ((Node)yyVals[-4+yyTop])), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 241:
+- // line 924 "DefaultRubyParser.y"
++ // line 928 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((Node)yyVals[-6+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-6+yyTop])), ((Node)yyVals[-6+yyTop])).addAll(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 242:
+- // line 928 "DefaultRubyParser.y"
++ // line 932 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(getPosition(((ListNode)yyVals[-1+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 243:
+- // line 932 "DefaultRubyParser.y"
++ // line 936 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((ListNode)yyVals[-4+yyTop])), new ArrayNode(getPosition(((ListNode)yyVals[-4+yyTop])), new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 244:
+- // line 936 "DefaultRubyParser.y"
++ // line 940 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(getPosition(((Node)yyVals[-3+yyTop])), ((Node)yyVals[-3+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 245:
+- // line 940 "DefaultRubyParser.y"
++ // line 944 "DefaultRubyParser.y"
+ {
+ yyVal = new ArrayNode(getPosition(((Node)yyVals[-5+yyTop])), ((Node)yyVals[-5+yyTop])).addAll(((ListNode)yyVals[-3+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-1+yyTop])));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 246:
+- // line 944 "DefaultRubyParser.y"
++ // line 948 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((Node)yyVals[-6+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-6+yyTop])), ((Node)yyVals[-6+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 247:
+- // line 948 "DefaultRubyParser.y"
++ // line 952 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_concat(getPosition(((Node)yyVals[-8+yyTop])), new ArrayNode(getPosition(((Node)yyVals[-8+yyTop])), ((Node)yyVals[-8+yyTop])).addAll(((ListNode)yyVals[-6+yyTop])).add(new HashNode(getPosition(null), ((ListNode)yyVals[-4+yyTop]))), ((Node)yyVals[-1+yyTop]));
+ yyVal = support.arg_blk_pass((Node)yyVal, ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 248:
+- // line 952 "DefaultRubyParser.y"
++ // line 956 "DefaultRubyParser.y"
+ {
+ yyVal = support.arg_blk_pass(new SplatNode(getPosition(((Token)yyVals[-2+yyTop])), ((Node)yyVals[-1+yyTop])), ((BlockPassNode)yyVals[0+yyTop]));
+ }
+ break;
+ case 249:
+- // line 955 "DefaultRubyParser.y"
++ // line 959 "DefaultRubyParser.y"
+ {}
+ break;
+ case 250:
+- // line 957 "DefaultRubyParser.y"
++ // line 961 "DefaultRubyParser.y"
+ {
+ yyVal = new Long(lexer.getCmdArgumentState().begin());
+ }
+ break;
+ case 251:
+- // line 959 "DefaultRubyParser.y"
++ // line 963 "DefaultRubyParser.y"
+ {
+ lexer.getCmdArgumentState().reset(((Long)yyVals[-1+yyTop]).longValue());
+ yyVal = ((Node)yyVals[0+yyTop]);
+ }
+ break;
+ case 253:
+- // line 965 "DefaultRubyParser.y"
++ // line 969 "DefaultRubyParser.y"
+ {
+ lexer.setState(LexState.EXPR_ENDARG);
+ }
+ break;
+ case 254:
+- // line 967 "DefaultRubyParser.y"
++ // line 971 "DefaultRubyParser.y"
+ {
+ warnings.warn(getPosition(((Token)yyVals[-2+yyTop])), "don't put space before argument parentheses");
+ yyVal = null;
+ }
+ break;
+ case 255:
+- // line 971 "DefaultRubyParser.y"
++ // line 975 "DefaultRubyParser.y"
+ {
+ lexer.setState(LexState.EXPR_ENDARG);
+ }
+ break;
+ case 256:
+- // line 973 "DefaultRubyParser.y"
++ // line 977 "DefaultRubyParser.y"
+ {
+ warnings.warn(getPosition(((Token)yyVals[-3+yyTop])), "don't put space before argument parentheses");
+ yyVal = ((Node)yyVals[-2+yyTop]);
+ }
+ break;
+ case 257:
+- // line 978 "DefaultRubyParser.y"
++ // line 982 "DefaultRubyParser.y"
+ {
+ support.checkExpression(((Node)yyVals[0+yyTop]));
+ yyVal = new BlockPassNode(getPosition(((Token)yyVals[-1+yyTop])), ((Node)yyVals[0+yyTop]));
+ }
+ break;
+ case 258:
+- // line 983 "DefaultRubyParser.y"
++ // line 987 "DefaultRubyParser.y"
+ ...
[truncated message content] |
|
From: <caw...@us...> - 2007-01-16 14:59:16
|
Revision: 1776
http://svn.sourceforge.net/rubyeclipse/?rev=1776&view=rev
Author: cawilliams
Date: 2007-01-16 06:59:14 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
fix test (matter of back vs forward slashes in file paths). Hopefully this works cross-platform.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-16 14:53:33 UTC (rev 1775)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyRuntime.java 2007-01-16 14:59:14 UTC (rev 1776)
@@ -53,14 +53,14 @@
IInterpreter interpreterOne = new RubyInterpreter("InterpreterOne", new File("C:/RubyInstallRootOne"));
runtime.setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne }));
- assertEquals("XML should indicate only one interpreter with it being the selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:/RubyInstallRootOne\" selected=\"true\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
+ assertEquals("XML should indicate only one interpreter with it being the selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\" selected=\"true\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
RubyInterpreter interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("C:/RubyInstallRootTwo"));
runtime.setInstalledInterpreters(Arrays.asList(new IInterpreter[] { interpreterOne, interpreterTwo }));
- assertEquals("XML should indicate both interpreters with the first one being selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:/RubyInstallRootOne\" selected=\"true\"/><interpreter name=\"InterpreterTwo\" path=\"C:/RubyInstallRootTwo\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
+ assertEquals("XML should indicate both interpreters with the first one being selected.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\" selected=\"true\"/><interpreter name=\"InterpreterTwo\" path=\"C:\\RubyInstallRootTwo\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
runtime.setSelectedInterpreter(interpreterTwo);
- assertEquals("XML should indicate selected interpreter change.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:/RubyInstallRootOne\"/><interpreter name=\"InterpreterTwo\" path=\"C:/RubyInstallRootTwo\" selected=\"true\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
+ assertEquals("XML should indicate selected interpreter change.", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><runtimeconfig><interpreter name=\"InterpreterOne\" path=\"C:\\RubyInstallRootOne\"/><interpreter name=\"InterpreterTwo\" path=\"C:\\RubyInstallRootTwo\" selected=\"true\"/></runtimeconfig>", runtimeConfigurationWriter.toString());
}
protected class ShamRubyRuntime extends RubyRuntime {
protected ShamRubyRuntime() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 1775
http://svn.sourceforge.net/rubyeclipse/?rev=1775&view=rev
Author: cawilliams
Date: 2007-01-16 06:53:33 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
fix the test - make the ShamApplicationShortcut keep track of actual launches by overriding doLaunch (note that this code is pretty dependant on the superclass).
Also fix one of the tests to change its expectations - creating the same configuration multiple times should only create one actual config, and should still launch it properly.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
Modified: trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-16 14:52:22 UTC (rev 1774)
+++ trunk/org.rubypeople.rdt.debug.ui.tests/src/org/rubypeople/rdt/internal/debug/ui/launcher/TC_RubyApplicationShortcut.java 2007-01-16 14:53:33 UTC (rev 1775)
@@ -18,6 +18,7 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
+import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.tests.ModifyingResourceTest;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
import org.rubypeople.rdt.internal.debug.ui.RubySourceLocator;
@@ -102,7 +103,7 @@
shortcut.launch(selection, ILaunchManager.RUN_MODE);
assertEquals("A configuration has been created", 1, this.getLaunchConfigurations().length);
- assertEquals("A launch took place.", 1, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("A launch took place.", 1, shortcut.launchCount());
assertTrue("The shortcut should not log a message when asked to launch the correct file type.", !shortcut.didLog());
}
@@ -112,22 +113,19 @@
shortcut.launch(selection, ILaunchManager.RUN_MODE);
assertEquals("There is no configuration.", 0, this.getLaunchConfigurations().length);
- assertEquals("There was no launch.", 0, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("There was no launch.", 0, shortcut.launchCount());
assertTrue("The shortcut should log a message when asked to launch the wrong file type.", shortcut.didLog());
}
public void testLaunchWithSelectionMultipleConfigurationsExist() throws Exception {
- shortcut.expectException();
this.createConfiguration(rubyFile);
this.createConfiguration(rubyFile);
ISelection selection = new StructuredSelection(rubyFile);
shortcut.launch(selection, ILaunchManager.RUN_MODE);
- assertEquals("A new configuration for myFile.rb should not be created when one ore more configurations already exist.", 2, this.getLaunchConfigurations().length);
- assertEquals("The configuration for myFile.rb should not be launched when multiple configurations exist.", 0, ShamApplicationLaunchConfigurationDelegate.getLaunches());
- assertTrue("The shortcut should log a message when asked to launch a file that has multiple configurations.", shortcut.didLog());
-
+ assertEquals("A new configuration for myFile.rb should not be created when one ore more configurations already exist.", 1, this.getLaunchConfigurations().length);
+ assertEquals("The configuration for myFile.rb should have be launched.", 1, shortcut.launchCount());
}
public void testLaunchWithSelectionMultipleSelections() throws Exception {
@@ -135,7 +133,7 @@
shortcut.launch(selection, ILaunchManager.RUN_MODE);
ILaunchConfiguration[] configurations = this.getLaunchConfigurations();
assertEquals("A configuration has been created", 1, configurations.length);
- assertEquals("A launch took place.", 1, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("A launch took place.", 1, shortcut.launchCount());
assertTrue("The shortcut should not log a message when asked to launch the correct file type.", !shortcut.didLog());
String launchedFileName = configurations[0].getAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, "");
@@ -147,7 +145,7 @@
shortcut.launch(selection, ILaunchManager.RUN_MODE);
shortcut.launch(selection, ILaunchManager.RUN_MODE);
assertEquals("Only one configuration has been created", 1, this.getLaunchConfigurations().length);
- assertEquals("Two launches took place.", 2, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("Two launches took place.", 2, shortcut.launchCount());
assertTrue("The shortcut should not log a message when asked to launch the correct file type.", !shortcut.didLog());
}
@@ -159,7 +157,7 @@
ILaunchConfiguration[] configurations = this.getLaunchConfigurations();
assertEquals("A configuration has been created", 1, configurations.length);
- assertEquals("A launch took place.", 1, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("A launch took place.", 1, shortcut.launchCount());
assertTrue("The shortcut should not log a message when asked to launch the correct file type.", !shortcut.didLog());
String launchedFileName = configurations[0].getAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, "");
@@ -177,7 +175,7 @@
shortcut.launch(rubyEditor, ILaunchManager.RUN_MODE);
assertEquals("A configuration has been created", 1, this.getLaunchConfigurations().length);
- assertEquals("A launch took place.", 1, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("A launch took place.", 1, shortcut.launchCount());
assertTrue("The shortcut should not log a message when asked to launch the correct file type.", !shortcut.didLog());
}
@@ -189,7 +187,7 @@
shortcut.launch(txtEditor, ILaunchManager.RUN_MODE);
assertEquals("No configuration has been created", 0, this.getLaunchConfigurations().length);
- assertEquals("No launch took place.", 0, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("No launch took place.", 0, shortcut.launchCount());
assertTrue("The shortcut should must have logged a message.", shortcut.didLog());
}
@@ -204,7 +202,7 @@
shortcut.launch(rubyExternalEditor, ILaunchManager.RUN_MODE);
assertEquals("No configuration has been created", 0, this.getLaunchConfigurations().length);
- assertEquals("No launch took place.", 0, ShamApplicationLaunchConfigurationDelegate.getLaunches());
+ assertEquals("No launch took place.", 0, shortcut.launchCount());
assertTrue("The shortcut should must have logged a message.", shortcut.didLog());
}
@@ -213,6 +211,7 @@
protected boolean didLog;
protected boolean didShowDialog=false;
private boolean expectingException;
+ private int launches = 0;
protected void log(String message) {
didLog = true;
@@ -232,6 +231,17 @@
return didLog;
}
+ protected void doLaunch(IRubyElement rubyElement, String mode) throws CoreException {
+ ILaunchConfiguration config = findOrCreateLaunchConfiguration(rubyElement, mode);
+ if (config != null) {
+ launches++;
+ }
+ }
+
+ public int launchCount() {
+ return launches;
+ }
+
protected ILaunchConfigurationType getRubyLaunchConfigType() {
return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(SHAM_LAUNCH_CONFIG_TYPE);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-16 14:53:13
|
Revision: 1774
http://svn.sourceforge.net/rubyeclipse/?rev=1774&view=rev
Author: cawilliams
Date: 2007-01-16 06:52:22 -0800 (Tue, 16 Jan 2007)
Log Message:
-----------
make test use a VERBOSE flag to determine whether to spit out debug stuff to command line (and set flag to false by default).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-01-16 00:51:23 UTC (rev 1773)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-01-16 14:52:22 UTC (rev 1774)
@@ -20,9 +20,9 @@
public class TestData {
public TestData(String formattedText, String unformattedText, String assertionMessage) {
- this.formattedText = formattedText ;
- this.unformattedText = unformattedText ;
- this.assertionMessage = assertionMessage ;
+ this.formattedText = formattedText;
+ this.unformattedText = unformattedText;
+ this.assertionMessage = assertionMessage;
}
public String formattedText;
@@ -30,6 +30,8 @@
public String assertionMessage;
}
+ private static final boolean VERBOSE = false; // set to true if you want output to command line
+
private Hashtable testMap;
public TC_CodeFormatter(String name) throws SAXException, IOException, ParserConfigurationException, FactoryConfigurationError {
super(name);
@@ -84,14 +86,20 @@
for (int i = 0; i < partList.size(); i++) {
TestData data = (TestData) partList.get(i);
String formatted = new OldCodeFormatter().formatString(data.unformattedText);
- System.out.println("---------- " + data.assertionMessage + " --------") ;
- System.out.println(data.unformattedText) ;
- System.out.println("------------") ;
- System.out.println(formatted) ;
+ log("---------- " + data.assertionMessage + " --------") ;
+ log(data.unformattedText) ;
+ log("------------") ;
+ log(formatted) ;
Assert.assertEquals(data.assertionMessage, data.formattedText, formatted);
}
}
+ private void log(String formatted) {
+ if (VERBOSE)
+ System.out.println(formatted);
+
+ }
+
public void testSimple() {
this.doTest("Keywords");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-16 00:51:25
|
Revision: 1773
http://svn.sourceforge.net/rubyeclipse/?rev=1773&view=rev
Author: cawilliams
Date: 2007-01-15 16:51:23 -0800 (Mon, 15 Jan 2007)
Log Message:
-----------
apply Martin Krauskopf's patch for ticket #225 - fixes some more debugging issues and adds test cases.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java 2007-01-15 15:36:59 UTC (rev 1772)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java 2007-01-16 00:51:23 UTC (rev 1773)
@@ -20,7 +20,6 @@
import org.rubypeople.rdt.internal.debug.core.model.RubyVariable;
import org.rubypeople.rdt.internal.debug.core.model.ThreadInfo;
import org.rubypeople.rdt.internal.debug.core.parsing.BreakpointAddedReader;
-import org.rubypeople.rdt.internal.debug.core.parsing.ErrorReader;
import org.rubypeople.rdt.internal.debug.core.parsing.EvalReader;
import org.rubypeople.rdt.internal.debug.core.parsing.FramesReader;
import org.rubypeople.rdt.internal.debug.core.parsing.LoadResultReader;
@@ -33,6 +32,7 @@
public abstract class FTC_AbstractDebuggerCommunicationTest extends TestCase {
+ private static final boolean VERBOSE = false;
private static String tmpDir;
protected static String getTmpDir() {
@@ -147,22 +147,22 @@
public void run() {
try {
while (true) {
- System.out.println("Starting timeout watchdog.");
+ log("Starting timeout watchdog.");
Thread.sleep(TIMEOUT_MS);
- System.out.println("Timeout reached.");
+ log("Timeout reached.");
mainThread.interrupt();
}
} catch (InterruptedException e) {
- System.out.println("Watchdog deactivated.");
+ log("Watchdog deactivated.");
}
}
};
timeoutThread.start();
- System.out.println("Setup finished.") ;
+ log("Setup finished.") ;
}
public void tearDown() {
- System.out.println("TearDown") ;
+ log("TearDown") ;
timeoutThread.interrupt();
if (process == null || socket == null) {
// here we go if there was an error in the creation of the process
@@ -179,17 +179,17 @@
try {
socket.close();
} catch (IOException e) {
- System.out.println("Exception while closing socket.") ;
+ log("Exception while closing socket.") ;
e.printStackTrace();
}
try {
if (process.exitValue() != 0) {
- System.out.println("Ruby finished with exit value: "
+ log("Ruby finished with exit value: "
+ process.exitValue());
}
} catch (IllegalThreadStateException ex) {
process.destroy();
- System.out.println("Ruby process had to be destroyed.");
+ log("Ruby process had to be destroyed.");
// wait so that the debugger port will be availabel for the next
// test
// There seems to be a delay after the destroying of a process and
@@ -197,32 +197,32 @@
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
- System.out.println("Exception while sleeping after destroying the ruby process") ;
+ log("Exception while sleeping after destroying the ruby process") ;
// TODO: find out what causes interruption!
try {
Thread.sleep(5000);
} catch (InterruptedException e1) {
- System.out.println("Exception again while sleeping after destroying the ruby process") ;
+ log("Exception again while sleeping after destroying the ruby process") ;
}
}
}
- System.out.println("Waiting for stdout redirector thread..");
+ log("Waiting for stdout redirector thread..");
try {
rubyStdoutRedirectorThread.join();
} catch (InterruptedException e) {
- System.out.println("Exception while waiting for stdout redirector") ;
+ log("Exception while waiting for stdout redirector") ;
e.printStackTrace();
}
- System.out.println("..done");
- System.out.println("Waiting for stderr redirector thread..");
+ log("..done");
+ log("Waiting for stderr redirector thread..");
try {
rubyStderrRedirectorThread.join();
} catch (InterruptedException e) {
- System.out.println("Exception while waiting for stderr redirector") ;
+ log("Exception while waiting for stderr redirector") ;
e.printStackTrace();
}
- System.out.println("..done");
+ log("..done");
}
protected void writeFile(String name, String[] content) throws Exception {
@@ -247,18 +247,18 @@
}
multiReaderStrategy = new MultiReaderStrategy(getXpp(socket));
- Runnable runnable = new Runnable() {
- public void run() {
- try {
- while (true) {
- new WasteReader(multiReaderStrategy).read();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- };
- };
- new Thread(runnable).start();
+// Runnable runnable = new Runnable() {
+// public void run() {
+// try {
+// while (true) {
+// new WasteReader(multiReaderStrategy).read();
+// }
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// };
+// };
+// new Thread(runnable).start();
Thread.sleep(500);
out = new PrintWriter(socket.getOutputStream(), true);
readSuspensionInFirstLine() ;
@@ -277,7 +277,7 @@
} catch (IllegalThreadStateException ex) {
// not yet finished, normal behaviour
// why does process does not have a function like isRunning() ?
- System.out.println("Sending: " + debuggerCommand);
+ log("Sending: " + debuggerCommand);
out.println(debuggerCommand);
}
}
@@ -296,7 +296,7 @@
createSocket(new String[] { "puts 'a'" });
sendRuby("b test.rb:1");
sendRuby("cont");
- System.out.println("Waiting for breakpoint..");
+ log("Waiting for breakpoint..");
SuspensionPoint hit = getSuspensionReader().readSuspension();
assertNotNull(hit);
assertTrue(hit.isBreakpoint());
@@ -304,28 +304,73 @@
}
public void testBreakpointAddAndRemove() throws Exception {
- // Breakpoint in line 1 does not work yet.
- createSocket(new String[] { "puts 'a'", "puts 'a'", "puts 'a'" });
+ createSocket(new String[] { "1.upto(3) {", "puts 'a'", "puts 'b'", "puts 'c'", "}" });
sendRuby("b test.rb:2");
assertEquals(1, getBreakpointAddedReader().readBreakpointNo()) ;
- sendRuby("b test.rb:3");
+ sendRuby("b test.rb:4");
assertEquals(2, getBreakpointAddedReader().readBreakpointNo()) ;
- sendRuby("cont");
- System.out.println("Waiting for breakpoint..");
+ sendRuby("cont"); // -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 4
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 4);
+ sendRuby("cont"); // 4 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("delete -1"); // should be ignored
+ sendRuby("delete 100"); // should be ignored
+ sendRuby("delete 2");
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> finish
SuspensionPoint hit = getSuspensionReader().readSuspension();
- assertNotNull(hit);
+ assertNull("null expected, but was: " + hit, hit);
+ }
+
+ public void testSimpleCycleSteppingWorks() throws Exception {
+ createSocket(new String[] { "1.upto(2) {", "puts 'a'", "}", "puts 'b'" });
+ sendRuby("b test.rb:2");
+ assertEquals(1, getBreakpointAddedReader().readBreakpointNo());
+ sendRuby("b test.rb:4");
+ assertEquals(2, getBreakpointAddedReader().readBreakpointNo());
+ sendRuby("cont"); // -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 4);
+ sendRuby("cont"); // 4 -> finish
+ SuspensionPoint hit = getSuspensionReader().readSuspension();
+ assertNull("null expected, but was: " + hit, hit);
+ }
+
+ public void testStoppingOnOneLineTwice() throws Exception {
+ createSocket(new String[] {
+ "1.upto(2) {", "if true", "puts 'a'", "end", "}", "puts 'b'" });
+ sendRuby("b test.rb:2");
+ assertEquals(1, getBreakpointAddedReader().readBreakpointNo());
+ sendRuby("b test.rb:6");
+ assertEquals(2, getBreakpointAddedReader().readBreakpointNo());
+ sendRuby("cont"); // -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 2);
+ sendRuby("cont"); // 2 -> 2
+ assertBreakpoint(getSuspensionReader().readSuspension(), "test.rb", 6);
+ sendRuby("cont"); // 6 -> finish
+ SuspensionPoint hit = getSuspensionReader().readSuspension();
+ assertNull("null expected, but was: " + hit, hit);
+ }
+
+ public void assertBreakpoint(SuspensionPoint hit, String file, int line) {
+ assertNotNull(hit);
assertTrue(hit.isBreakpoint());
- assertEquals(2, hit.getLine());
- assertEquals("test.rb", hit.getFile());
- sendRuby("delete -1");
- sendRuby("delete 100");
- sendRuby("delete 1");
- sendRuby("delete 2");
- sendRuby("cont");
- hit = getSuspensionReader().readSuspension();
- assertNull(hit);
+ assertEquals(line, hit.getLine());
+ assertEquals(file, hit.getFile());
}
-
+
public void testException() throws Exception {
// per default catch is set to StandardError, i.e. every raise of a
// subclass of StandardError
@@ -334,7 +379,7 @@
"raise 'message \\dir\\file: <xml/>\n<8>'", "puts 'c'" });
sendRuby("catch StandardError");
sendRuby("cont");
- System.out.println("Waiting for exception");
+ log("Waiting for exception");
SuspensionPoint hit = getSuspensionReader().readSuspension();
assertNotNull(hit);
assertEquals(3, hit.getLine());
@@ -390,11 +435,16 @@
sendRuby("b test.rb:10");
getBreakpointAddedReader().readBreakpointNo();
sendRuby("cont");
- System.out.println("Waiting for breakpoint..");
+ log("Waiting for breakpoint..");
SuspensionPoint hit = getSuspensionReader().readSuspension();
assertNull(hit);
}
+ private void log(String string) {
+ if (VERBOSE)
+ System.out.println(string);
+ }
+
public void testStepOver() throws Exception {
createSocket(new String[] { "puts 'a'", "puts 'b'", "puts 'c'" });
sendRuby("b test.rb:2");
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java 2007-01-15 15:36:59 UTC (rev 1772)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java 2007-01-16 00:51:23 UTC (rev 1773)
@@ -16,6 +16,8 @@
junit.framework.TestSuite suite = new junit.framework.TestSuite();
//suite.addTest(new FTC_DebuggerCommunicationTest("testBreakpointOnFirstLine"));
suite.addTest(new FTC_ClassicDebuggerCommunicationTest("testBreakpointAddAndRemove"));
+ suite.addTest(new FTC_ClassicDebuggerCommunicationTest("testSimpleCycleSteppingWorks"));
+ suite.addTest(new FTC_ClassicDebuggerCommunicationTest("testStoppingonOneLineTwice"));
// suite.addTest(new FTC_ClassicDebuggerCommunicationTest("testVariableLocal"));
// suite.addTest(new FTC_ClassicDebuggerCommunicationTest("testVariableArray"));
// suite.addTest(new FTC_ClassicDebuggerCommunicationTest("testVariableArrayEmpty"));
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-01-15 15:36:59 UTC (rev 1772)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-01-16 00:51:23 UTC (rev 1773)
@@ -2,7 +2,6 @@
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.internal.debug.core.SuspensionPoint;
-import org.rubypeople.rdt.internal.debug.core.parsing.EvalReader;
import org.rubypeople.rdt.internal.launching.DebuggerRunner;
import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin;
Modified: trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb
===================================================================
--- trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb 2007-01-15 15:36:59 UTC (rev 1772)
+++ trunk/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb 2007-01-16 00:51:23 UTC (rev 1773)
@@ -208,7 +208,6 @@
@socket = DEBUGGER__.socket
@stop_next = 0
@last_file = nil
- @last = [nil, nil]
@file = nil
@line = nil
@no_step = nil
@@ -792,11 +791,11 @@
n = 1
for b in break_points
@printer.debug("file=%s, pos=%s; breakpoint: %s, %s, %s, %s.\n ", file, pos, b[0], b[1], b[2], b[3])
- if b[0]
- if b[1] == 0 and b[2] == file and b[3] == pos
+ if b[0] # valid
+ if b[1] == 0 and b[2] == file and b[3] == pos # breakpoint
@printer.printBreakpoint(n, debug_funcname(id), file, pos)
return true
- elsif b[1] == 1
+ elsif b[1] == 1 # watchpoint
if debug_silent_eval(b[2], binding)
stdout.printf "Watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
return true
@@ -845,19 +844,17 @@
end
if !@no_step or @frames.size == @no_step
@stop_next -= 1
+ @stop_next = -1 if @stop_next < 0
elsif @frames.size < @no_step
@stop_next = 0 # break here before leaving...
+ else
+ # nothing to do. skipped
end
if @stop_next == 0 or check_break_points(file, line, binding, id)
- if [file, line] == @last
- @stop_next = 1
- else
@no_step = nil
debug_command(file, line, id, binding)
stopCurrentThread
- @last = [file, line]
- end
end
when 'call'
@@ -904,6 +901,8 @@
@last_thread = Thread::main
@max_thread = 1
@thread_list = {Thread::main => 1}
+ # break_points' one entry: [valid, type, file, pos]
+ # type: 0 - breakpoint, 1 - watchpoint
@break_points = []
@display = []
@waiting = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|