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-22 20:56:48
|
Revision: 1847
http://svn.sourceforge.net/rubyeclipse/?rev=1847&view=rev
Author: cawilliams
Date: 2007-01-22 12:56:38 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to move us towards using only subclasses of NLS for translations - so we get accurate information on what strings are missing and what are unused.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java 2007-01-22 20:54:14 UTC (rev 1846)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java 2007-01-22 20:56:38 UTC (rev 1847)
@@ -112,7 +112,7 @@
return null;
String keySequence= sequences[0].format();
- return RubyHoverMessages.getFormattedString("RubyTextHover.makeStickyHint", keySequence); //$NON-NLS-1$
+ return RubyHoverMessages.getFormattedString(RubyHoverMessages.RubyTextHover_makeStickyHint, keySequence);
}
/**
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java 2007-01-22 20:54:14 UTC (rev 1846)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java 2007-01-22 20:56:38 UTC (rev 1847)
@@ -11,75 +11,29 @@
package org.rubypeople.rdt.internal.ui.text.ruby.hover;
import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-class RubyHoverMessages {
+import org.eclipse.osgi.util.NLS;
- private static final String RESOURCE_BUNDLE= RubyHoverMessages.class.getName();
+class RubyHoverMessages extends NLS {
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
+ private static final String BUNDLE_NAME= RubyHoverMessages.class.getName();
private RubyHoverMessages() {
}
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
+ public static String RubyTextHover_makeStickyHint;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, RubyHoverMessages.class);
}
+
/**
* Gets a string from the resource bundle and formats it with the argument
*
* @param key the string used to get the bundle value, must not be null
- * @since 3.0
+ * @since 0.8.0
*/
public static String getFormattedString(String key, Object arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg == null)
- arg= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg });
+ return MessageFormat.format(key, new Object[] { arg });
}
- /**
- * Gets a string from the resource bundle and formats it with the arguments
- *
- * @param key the string used to get the bundle value, must not be null
- * @since 3.0
- */
- public static String getFormattedString(String key, Object arg1, Object arg2) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg1 == null)
- arg1= ""; //$NON-NLS-1$
- if (arg2 == null)
- arg2= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg1, arg2 });
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- * @since 3.0
- */
- public static String getFormattedString(String key, boolean arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- return MessageFormat.format(format, new Object[] { new Boolean(arg) });
- }
+
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties 2007-01-22 20:54:14 UTC (rev 1846)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties 2007-01-22 20:56:38 UTC (rev 1847)
@@ -9,10 +9,5 @@
# IBM Corporation - initial API and implementation
###############################################################################
-RubyTextHover.createTextHover= Could not create ruby text hover
+RubyTextHover_makeStickyHint= Press ''{0}'' for focus.
-RubyTextHover.makeStickyHint= Press ''{0}'' for focus.
-
-NoBreakpointAnnotation.addBreakpoint= Add a breakpoint
-
-NLSStringHover.NLSStringHover.missingKeyWarning= <b>Warning:</b> The key is missing!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 20:54:15
|
Revision: 1846
http://svn.sourceforge.net/rubyeclipse/?rev=1846&view=rev
Author: cawilliams
Date: 2007-01-22 12:54:14 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to move us towards using only subclasses of NLS for translations - so we get accurate information on what strings are missing and what are unused.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.properties
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.properties 2007-01-22 20:53:51 UTC (rev 1845)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.properties 2007-01-22 20:54:14 UTC (rev 1846)
@@ -1,3 +1,3 @@
-SurroundWithBeginRescueAction.label=Surround with begin...rescue
-SurroundWithBeginRescueAction.error=Error occurred while surrounding code with begin..rescue block
-SurroundWithBeginRescueAction.dialog.title=Surround with begin...rescue
\ No newline at end of file
+SurroundWithBeginRescueAction_label=Surround with begin...rescue
+SurroundWithBeginRescueAction_error=Error occurred while surrounding code with begin..rescue block
+SurroundWithBeginRescueAction_dialog_title=Surround with begin...rescue
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 20:53:56
|
Revision: 1845
http://svn.sourceforge.net/rubyeclipse/?rev=1845&view=rev
Author: cawilliams
Date: 2007-01-22 12:53:51 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to move us towards using only subclasses of NLS for translations - so we get accurate information on what strings are missing and what are unused.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java 2007-01-22 20:17:22 UTC (rev 1844)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java 2007-01-22 20:53:51 UTC (rev 1845)
@@ -1,22 +1,17 @@
package org.rubypeople.rdt.ui.actions;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
public class ActionMessages {
- private static final String BUNDLE_NAME = "org.rubypeople.rdt.ui.actions.ActionMessages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.rubypeople.rdt.ui.actions.ActionMessages"; //$NON-NLS-1$
+
+ private ActionMessages() {}
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private ActionMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
+ public static String SurroundWithBeginRescueAction_label;
+ public static String SurroundWithBeginRescueAction_error;
+ public static String SurroundWithBeginRescueAction_dialog_title;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
+ }
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java 2007-01-22 20:17:22 UTC (rev 1844)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java 2007-01-22 20:53:51 UTC (rev 1845)
@@ -41,7 +41,7 @@
public SurroundWithBeginRescueAction(RubyEditor editor) {
super(editor.getEditorSite());
- setText(ActionMessages.getString("SurroundWithBeginRescueAction.label")); //$NON-NLS-1$
+ setText(ActionMessages.SurroundWithBeginRescueAction_label);
fEditor = editor;
setEnabled((fEditor != null && SelectionConverter.getInputAsRubyScript(fEditor) != null));
PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
@@ -53,12 +53,12 @@
createChange(selection, new NullProgressMonitor());
} catch (CoreException e) {
ExceptionHandler.handle(e, getDialogTitle(),
- ActionMessages.getString("SurroundWithBeginRescueAction.error")); //$NON-NLS-1$
+ ActionMessages.SurroundWithBeginRescueAction_error);
}
}
private static String getDialogTitle() {
- return ActionMessages.getString("SurroundWithBeginRescueAction.dialog.title"); //$NON-NLS-1$
+ return ActionMessages.SurroundWithBeginRescueAction_dialog_title;
}
private IFile getFile() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 20:17:38
|
Revision: 1844
http://svn.sourceforge.net/rubyeclipse/?rev=1844&view=rev
Author: cawilliams
Date: 2007-01-22 12:17:22 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to move us towards using only subclasses of NLS for translations - so we get accurate information on what strings are missing and what are unused.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ToggleCommentAction.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.java 2007-01-22 20:11:26 UTC (rev 1843)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.java 2007-01-22 20:17:22 UTC (rev 1844)
@@ -11,7 +11,6 @@
package org.rubypeople.rdt.internal.ui.rubyeditor;
import java.text.MessageFormat;
-import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.osgi.util.NLS;
@@ -31,18 +30,19 @@
public static String GotoMatchingBracket_error_bracketOutsideSelectedElement;
public static String GotoMatchingBracket_error_invalidSelection;
public static String GotoMatchingBracket_error_noMatchingBracket;
+ public static String Editor_FoldingMenu_name;
+ public static String ToggleComment_error_title;
+ public static String ToggleComment_error_message;
private static ResourceBundle fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
private static final String BUNDLE_FOR_CONSTRUCTED_KEYS= "org.rubypeople.rdt.internal.ui.rubyeditor.ConstructedRubyEditorMessages";//$NON-NLS-1$
private static ResourceBundle fgBundleForConstructedKeys= ResourceBundle.getBundle(BUNDLE_FOR_CONSTRUCTED_KEYS);
- public static String Editor_FoldingMenu_name;
-
/**
* Returns the message bundle which contains constructed keys.
*
- * @since 3.1
+ * @since 0.8.0
* @return the message bundle
*/
public static ResourceBundle getBundleForConstructedKeys() {
@@ -53,13 +53,6 @@
private RubyEditorMessages() {
}
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
public static ResourceBundle getResourceBundle() {
return fgResourceBundle;
@@ -69,14 +62,14 @@
* Gets a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object[] args) {
- return MessageFormat.format(getString(key), args);
+ return MessageFormat.format(key, args);
}
/**
* Gets a string from the resource bundle and formats it with arguments
*/
public static String getFormattedString(String key, Object arg) {
- return MessageFormat.format(getString(key), new Object[] { arg});
+ return MessageFormat.format(key, new Object[] { arg});
}
static {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.properties 2007-01-22 20:11:26 UTC (rev 1843)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorMessages.properties 2007-01-22 20:17:22 UTC (rev 1844)
@@ -1,217 +1,22 @@
###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
+# Copyright (c) 2007 Rubypeople, Inc.
+# Based on JDT's JavaEditorMessages.properties, copyright IBM Corp.
###############################################################################
-RubyScriptEditorActionContributor.ToggleInsertMode.label=Sma&rt Insert Mode
-RubyScriptEditorActionContributor.ToggleInsertMode.tooltip=Toggle Smart Insert Mode
-RubyScriptEditorActionContributor.ToggleInsertMode.image=
-RubyScriptEditorActionContributor.ToggleInsertMode.description= Toggles smart insert mode
-
-RubyScriptEditor.error.saving.message1=File has been deleted.
-RubyScriptEditor.error.saving.message2=Could not save file.
-RubyScriptEditor.error.saving.message3=Could not save file.
-RubyScriptEditor.error.saving.title1=Cannot Save
-RubyScriptEditor.error.saving.title2=Save Problems
-RubyScriptEditor.error.saving.title3=Save Problems
-RubyScriptEditor.warning.save.delete=The original file ''{0}'' has been deleted.
-
-DeleteISourceManipulations.description=Delete the selected element in the editor
-DeleteISourceManipulations.error.deleting.message1=Cannot delete element:
-DeleteISourceManipulations.error.deleting.title1=Problems while deleting element
-DeleteISourceManipulations.label=&Delete
-DeleteISourceManipulations.tooltip=Delete the Selected Element in the Editor
-
-RubyOutlinePage.ContextMenu.refactoring.label=&Refactor
-RubyOutlinePage.HideFields.description.checked=Shows Fields
-RubyOutlinePage.HideFields.description.unchecked=Hides Fields
-RubyOutlinePage.HideFields.label=Hide Fields
-RubyOutlinePage.HideFields.tooltip.checked=Show Fields
-RubyOutlinePage.HideFields.tooltip.unchecked=Hide Fields
-RubyOutlinePage.HideNonePublicMembers.description.checked=Shows non-public members
-RubyOutlinePage.HideNonePublicMembers.description.unchecked=Hides non-public members
-RubyOutlinePage.HideNonePublicMembers.label=Show Public Members Only
-RubyOutlinePage.HideNonePublicMembers.tooltip.checked=Show Non-Public Members
-RubyOutlinePage.HideNonePublicMembers.tooltip.unchecked=Hide Non-Public Members
-RubyOutlinePage.HideStaticMembers.description.checked=Shows static members
-RubyOutlinePage.HideStaticMembers.description.unchecked=Hides static members
-RubyOutlinePage.HideStaticMembers.label=Hide Static Members
-RubyOutlinePage.HideStaticMembers.tooltip.checked=Show Static Members
-RubyOutlinePage.HideStaticMembers.tooltip.unchecked=Hide Static Members
RubyOutlinePage_Sort_label=Sort
RubyOutlinePage_Sort_tooltip=Sort
RubyOutlinePage_Sort_description=Enable Sorting
RubyOutlinePage_GoIntoTopLevelType_label=Go Into Top Level Type
RubyOutlinePage_GoIntoTopLevelType_tooltip=Go Into Top Level Type
RubyOutlinePage_GoIntoTopLevelType_description=Show children of top level type only
-RubyOutlinePage.error.ChildrenProvider.getChildren.message1=RubyOutlinePage.ChildrenProvider.getChildren
-RubyOutlinePage.error.ChildrenProvider.hasChildren.message1=RubyOutlinePage.ChildrenProvider.hasChildren
RubyOutlinePage_error_NoTopLevelType=Top level type not defined
-Editor_FoldingMenu_name=F&olding
-
-OpenOnSelection.description=Open an editor on the selected element
-OpenOnSelection.dialog.message=&Select or enter the element to open:
-OpenOnSelection.dialog.title=Open On Selection
-OpenOnSelection.label=&Open on Selection
-OpenOnSelection.tooltip=Open an Editor on the Selected Element
-
-TogglePresentation.label=Show Source of Selected Element Only
-TogglePresentation.tooltip=Show Source of Selected Element Only
-
-ToggleMarkOccurrencesAction.label= Toggle Mark Occurrences
-ToggleMarkOccurrencesAction.tooltip= Toggle Mark Occurrences
-
-ToggleTextHover.label=Show Text Hover
-ToggleTextHover.tooltip=Show Text Hover
-
-NextAnnotation.label= Ne&xt Annotation
-NextAnnotation.tooltip= Next Annotation
-NextAnnotation.description= Next Annotation
-
-PreviousAnnotation.label= Pre&vious Annotation
-PreviousAnnotation.tooltip= Previous Annotation
-PreviousAnnotation.description= Previous Annotation
-
-ContentAssistProposal.label=Co&ntent Assist
-ContentAssistProposal.tooltip=Content Assist
-ContentAssistProposal.description=Content Assist
-
-ContentAssistContextInformation.label=Parameter &Hints
-ContentAssistContextInformation.tooltip=Show Parameter Hints
-ContentAssistContextInformation.description=Show Method Parameter Hints
-
-CorrectionAssistProposal.label=&Quick Fix
-CorrectionAssistProposal.tooltip=Quick Fix
-CorrectionAssistProposal.description=Quick Fix
-
-ShowRubyDoc.label=Show T&ooltip Description
-ShowRubyDoc.tooltip=Shows Tooltip Description for Element at Cursor
-ShowRubyDoc.description=Shows the tooltip description for the element at the cursor
-
-ShowOutline.label= Quick Out&line
-ShowOutline.tooltip= Shows the Quick Outline of Editor Input
-ShowOutline.description= Shows the quick outline for the editor input
-
-OpenStructure.label= Open Stru&cture
-OpenStructure.tooltip= Opens Structure of Selected Element
-OpenStructure.description= Opens the structure of the selected element
-
-OpenExternalRubydoc.label=Open External Rubydoc
-OpenExternalRubydoc.tooltip=Opens Rubydoc in an External Browser for the Element at the Cursor Position
-OpenExternalRubydoc.description=Opens Rubydoc in an external browser for the element at the cursor position
-
-Comment.label=Co&mment
-Comment.tooltip=Comment the Selected Lines
-Comment.description=Turn the selected lines into Ruby comments
-
-Uncomment.label=&Uncomment
-Uncomment.tooltip=Uncomment the Selected Ruby Comment Lines
-Uncomment.description=Uncomment the selected Ruby comment lines
-
-AddBlockComment.label=Add &Block Comment
-AddBlockComment.tooltip=Enclose the Selection in a Block Comment
-AddBlockComment.description=Encloses the selection with block comment markers
-
-RemoveBlockComment.label=Remove Bloc&k Comment
-RemoveBlockComment.tooltip=Remove Block Comment Markers Enclosing the Caret
-RemoveBlockComment.description=Removes any block comment markers enclosing the caret
-
-Format.label=F&ormat
-Format.tooltip=Format the Selected Text
-Format.description=Format the selected text
-
-ShiftRight.label=Sh&ift Right
-ShiftRight.tooltip=Shift Right
-ShiftRight.description=Shift the selected text to the right
-
-ShiftLeft.label=S&hift Left
-ShiftLeft.tooltip=Shift Left
-ShiftLeft.description=Shift the selected text to the left
-
-AddTask.label=&Task...
-AddTask.tooltip=Add Task
-AddTask.image=
-AddTask.description=Add Task
-AddTask.dialog.title=Add Task
-AddTask.dialog.message=Enter Task description
-AddTask.error.dialog.title=Add Task
-AddTask.error.dialog.message=Problems adding new task
-
-Editor.Cut.label=Cu&t
-Editor.Cut.tooltip=Cut
-Editor.Cut.image=
-Editor.Cut.description=Cut
-
-Editor.Copy.label=&Copy
-Editor.Copy.tooltip=Copy
-Editor.Copy.image=
-Editor.Copy.description=Copy
-Editor.FoldingMenu.name=Folding
-
-Editor.Paste.label=&Paste
-Editor.Paste.tooltip=Paste
-Editor.Paste.image=
-Editor.Paste.description=Paste
-
-RubyScriptDocumentProvider.error.createElementInfo=RubyScriptDocumentProvider.createElementInfo
-RubyScriptDocumentProvider.error.resetDocument=RubyScriptDocumentProvider.resetDocument
-RubyScriptDocumentProvider.out_of_sync.message=Compilation unit buffer and document are out of sync
-
-StructureSelect.error.title= Expand Selection To
-StructureSelect.error.message= No source code attached to class file. To perform this operation you will need to attach source.
-
-StructureSelectNext.label=&Next Element
-StructureSelectNext.tooltip=Expand Selection to Include Next Sibling
-StructureSelectNext.description=Expand selection to include next sibling
-
-StructureSelectPrevious.label=&Previous Element
-StructureSelectPrevious.tooltip=Expand Selection to Include Previous Sibling
-StructureSelectPrevious.description=Expand selection to include previous sibling
-
-StructureSelectEnclosing.label=&Enclosing Element
-StructureSelectEnclosing.tooltip=Expand Selection to Include Enclosing Element
-StructureSelectEnclosing.description=Expand selection to include enclosing element
-
-StructureSelectHistory.label=&Restore Last Selection
-StructureSelectHistory.tooltip=Restore Last Selection
-StructureSelectHistory.description=Restore last selection
-ExpandSelectionMenu.label=E&xpand Selection To
-
GotoMatchingBracket_label= Matching &Bracket
-GotoMatchingBracket_tooltip=Go to Matching Bracket
-GotoMatchingBracket_description=Go to Matching Bracket
GotoMatchingBracket_error_invalidSelection=No bracket selected
GotoMatchingBracket_error_noMatchingBracket=No matching bracket found
GotoMatchingBracket_error_bracketOutsideSelectedElement=Matching bracket is outside the selected element
-RubySelectAnnotationRulerAction.QuickFix.label= &Quick Fix
-RubySelectAnnotationRulerAction.QuickFix.tooltip= Quick Fix
-RubySelectAnnotationRulerAction.QuickFix.description= Runs Quick Fix on the annotation's line
-RubySelectAnnotationRulerAction.QuickFix.image=
+Editor_FoldingMenu_name=F&olding
-RubySelectAnnotationRulerAction.QuickAssist.label= Quick &Assist
-RubySelectAnnotationRulerAction.QuickAssist.tooltip= Quick Assist
-RubySelectAnnotationRulerAction.QuickAssist.description= Runs Quick Assist on the annotation's line
-RubySelectAnnotationRulerAction.QuickAssist.image=
-
-RubySelectAnnotationRulerAction.GotoAnnotation.label= &Go to Annotation
-RubySelectAnnotationRulerAction.GotoAnnotation.tooltip= Go to Annotation
-RubySelectAnnotationRulerAction.GotoAnnotation.description= Selects the annotation in the editor
-RubySelectAnnotationRulerAction.GotoAnnotation.image=
-
-RubySelectAnnotationRulerAction.OpenSuperImplementation.label= &Open Super Implementation
-RubySelectAnnotationRulerAction.OpenSuperImplementation.tooltip= Open Super Implementation
-RubySelectAnnotationRulerAction.OpenSuperImplementation.description= Opens the super implementation
-RubySelectAnnotationRulerAction.OpenSuperImplementation.image=
-
-EditorUtility.concatModifierStrings= {0} + {1}
-
-Indent.label=Correct &Indentation
-Indent.tooltip=&Indent Current Line to Correct Indentation
+ToggleComment_error_title=Toggle Comment
+ToggleComment_error_message=An error occurred while toggling comments.
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ToggleCommentAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ToggleCommentAction.java 2007-01-22 20:11:26 UTC (rev 1843)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/ToggleCommentAction.java 2007-01-22 20:17:22 UTC (rev 1844)
@@ -88,7 +88,7 @@
Shell shell= editor.getSite().getShell();
if (!fOperationTarget.canDoOperation(operationCode)) {
if (shell != null)
- MessageDialog.openError(shell, RubyEditorMessages.getString("ToggleComment.error.title"), RubyEditorMessages.getString("ToggleComment.error.message")); //$NON-NLS-1$ //$NON-NLS-2$
+ MessageDialog.openError(shell, RubyEditorMessages.ToggleComment_error_title, RubyEditorMessages.ToggleComment_error_message);
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 20:11:41
|
Revision: 1843
http://svn.sourceforge.net/rubyeclipse/?rev=1843&view=rev
Author: cawilliams
Date: 2007-01-22 12:11:26 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to move us towards using only subclasses of NLS for translations - so we get accurate information on what strings are missing and what are unused.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectLibraryPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectPropertyPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/OptionalMessageDialog.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingConfigurationBlock.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyBasePreferencePage.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/resourcesview/RubyFilesOnlyFilterAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchQuery.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTML2TextReader.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTMLTextPresenter.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyAnnotationHover.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/ExceptionHandler.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewProjectCreationWizard.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -257,7 +257,7 @@
}
public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, RubyUIMessages.getString("RdtUiPlugin.internalErrorOccurred"), e)); //$NON-NLS-1$
+ log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, RubyUIMessages.RdtUiPlugin_internalErrorOccurred, e));
}
public static void log(int severity, String message, Throwable e) {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectLibraryPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectLibraryPage.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectLibraryPage.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -49,7 +49,7 @@
TableColumn tableColumn = new TableColumn(projectsTable, SWT.NONE);
tableColumn.setWidth(200);
- tableColumn.setText(RubyUIMessages.getString("RubyProjectLibraryPage.project")); //$NON-NLS-1$
+ tableColumn.setText(RubyUIMessages.RubyProjectLibraryPage_project);
CheckboxTableViewer projectsTableViewer = new CheckboxTableViewer(projectsTable);
projectsTableViewer.addCheckStateListener(new ICheckStateListener() {
@@ -110,7 +110,7 @@
if (element instanceof IProject)
return ((IProject) element).getName();
- return RubyUIMessages.getString("RubyProjectLibraryPage.elementNotIProject"); //$NON-NLS-1$
+ return RubyUIMessages.RubyProjectLibraryPage_elementNotIProject;
}
public void addListener(ILabelProviderListener listener) {}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectPropertyPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectPropertyPage.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyProjectPropertyPage.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -62,7 +62,7 @@
protected Control createClosedProjectPageContents(Composite parent) {
Label label = new Label(parent, SWT.NONE);
- label.setText(RubyUIMessages.getString("RubyProjectPropertyPage.rubyProjectClosed")); //$NON-NLS-1$
+ label.setText(RubyUIMessages.RubyProjectPropertyPage_rubyProjectClosed);
return label;
}
@@ -79,7 +79,7 @@
projectsPage = new RubyProjectLibraryPage(workingProject);
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
- tabItem.setText(RubyUIMessages.getString("RubyProjectLibraryPage.tabName")); //$NON-NLS-1$
+ tabItem.setText(RubyUIMessages.RubyProjectLibraryPage_tabName);
// tabItem.setData(projectsPage);
tabItem.setControl(projectsPage.getControl(tabFolder));
@@ -89,7 +89,7 @@
try {
projectsPage.getWorkingProject().save(null, true);
} catch (CoreException e) {
- ExceptionHandler.handle(e, RubyUIMessages.getString("RubyProjectPropertyPage.performOkException"), RubyUIMessages.getString("RubyProjectPropertyPage.performOkExceptionDialogMessage")); //$NON-NLS-1$ //$NON-NLS-2$
+ ExceptionHandler.handle(e, RubyUIMessages.RubyProjectPropertyPage_performOkException, RubyUIMessages.RubyProjectPropertyPage_performOkExceptionDialogMessage);
}
return super.performOk();
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -1,7 +1,6 @@
package org.rubypeople.rdt.internal.ui;
import java.text.MessageFormat;
-import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.osgi.util.NLS;
@@ -20,7 +19,6 @@
public static String RubyElementLabels_concat_string;
public static String RubyElementLabels_comma_string;
public static String RubyElementLabels_declseparator_string;
-
public static String RubyImageLabelprovider_assert_wrongImage;
public static String CoreUtility_buildproject_taskname;
public static String CoreUtility_buildall_taskname;
@@ -31,23 +29,46 @@
public static String TypeSelectionDialog_dialogMessage;
public static String RubyElementLabels_default_package;
+
+ public static String RdtUiPlugin_internalErrorOccurred;
+ public static String RubyProjectLibraryPage_project;
+ public static String RubyProjectLibraryPage_elementNotIProject;
+ public static String RubyProjectPropertyPage_rubyProjectClosed;
+ public static String RubyProjectLibraryPage_tabName;
+ public static String RubyProjectPropertyPage_performOkException;
+ public static String RubyProjectPropertyPage_performOkExceptionDialogMessage;
+ public static String OptionalMessageDialog_dontShowAgain;
+ public static String FoldingConfigurationBlock_error_not_exist;
+ public static String FoldingConfigurationBlock_info_no_preferences;
+ public static String RubyBasePreferencePage_label;
+ public static String RDocPathErrorTitle;
+ public static String RDocPathError;
+ public static String ErrorRunningRdocTitle;
+ public static String ToggleMenuRubyFilesOnly_Tooltip;
+ public static String ToggleMenuRubyFilesOnly;
+ public static String RubySearchPage_SearchForGroupLabel;
+ public static String RubySearch_SearchForClassSymbol;
+ public static String RubySearch_SearchForMethodSymbol;
+ public static String RubySearch_ResultLabel;
+ public static String HTML2TextReader_listItemPrefix;
+ public static String HTMLTextPresenter_ellipsis;
+ public static String RubyAnnotationHover_multipleMarkersAtThisLine;
+ public static String ExceptionDialog_seeErrorLogMessage;
+ public static String NewProjectCreationWizard_windowTitle;
+ public static String NewProjectCreationWizard_projectCreationMessage;
+ public static String WizardNewProjectCreationPage_pageName;
+ public static String WizardNewProjectCreationPage_pageTitle;
+ public static String WizardNewProjectCreationPage_pageDescription;
+
private RubyUIMessages() {
}
- public static String getString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-
public static String getFormattedString(String key, String arg) {
return getFormattedString(key, new String[] { arg});
}
public static String getFormattedString(String key, String[] args) {
- return MessageFormat.format(getString(key), (Object[])args);
+ return MessageFormat.format(key, (Object[])args);
}
public static ResourceBundle getResourceBundle() {
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-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties 2007-01-22 20:11:26 UTC (rev 1843)
@@ -1,71 +1,70 @@
#########################################
-# (c) Copyright RubyPeople, Inc. 2002.
+# (c) Copyright RubyPeople, Inc. 2007.
# All Rights Reserved.
#########################################
#########################################
# RdtUiPlugin
#########################################
+RdtUiPlugin_internalErrorOccurred=Internal error occurred
-RdtUiPlugin.internalErrorOccurred=Internal error occurred
-
#########################################
# RubyProjectLibraryPage
#########################################
+RubyProjectLibraryPage_elementNotIProject=ERROR: Element not IProject
+RubyProjectLibraryPage_project=Project
+RubyProjectLibraryPage_tabName=Projects
-RubyProjectLibraryPage.elementNotIProject=ERROR: Element not IProject
-RubyProjectLibraryPage.project=Project
-RubyProjectLibraryPage.tabName=Projects
-
#########################################
# Property Pages
#########################################
-RubyBasePreferencePage.label=General Properties
+RubyBasePreferencePage_label=General Properties
-RubyProjectPropertyPage.rubyProjectClosed=The project selected is a Ruby project, but is closed.
-RubyProjectPropertyPage.performOkExceptionDialogTitle=Unable to save
-RubyProjectPropertyPage.performOkExceptionDialogMessage=ERROR: Unable to save project properties.
+RubyProjectPropertyPage_rubyProjectClosed=The project selected is a Ruby project, but is closed.
+RubyProjectPropertyPage_performOkExceptionDialogTitle=Unable to save
+RubyProjectPropertyPage_performOkExceptionDialogMessage=ERROR: Unable to save project properties.
-TextEditorPreferencePage.general=General Editor Properties
-TextEditorPreferencePage.printMarginColor=Print margin
-TextEditorPreferencePage.currentLineHighlighColor=Current line highlight
-TextEditorPreferencePage.lineNumberForegroundColor=Line number foreground
-TextEditorPreferencePage.displayedTabWidth=Displayed &tab width:
-TextEditorPreferencePage.printMarginColumn=&Print margin column:
-TextEditorPreferencePage.showOverviewRuler=Show overview ruler
-TextEditorPreferencePage.showLineNumbers=Show lin&e numbers
-TextEditorPreferencePage.highlightCurrentLine=Hi&ghlight current line
-
+FoldingConfigurationBlock_info_no_preferences= The selected folding provider did not provide a preference control
#########################################
# Various Dialogs
#########################################
+ExceptionDialog_seeErrorLogMessage=See error log message
+MultiTypeSelectionDialog_errorMessage=Could not uniquely map the type name to a type.
+MultiTypeSelectionDialog_errorTitle=Select Type
+TypeSelectionDialog_errorTitle=Select Type
+TypeSelectionDialog_dialogMessage=Could not uniquely map the type name to a type. Path is {0}
+
+StatusBarUpdater_num_elements_selected={0} items selected
+
#########################################
# Ruby Search Page
#########################################
-RubySearch.SearchForMethodSymbol=Method
-RubySearchPage.SearchForGroupLabel=Search for
-RubySearch.ResultLabel=Search for {0} with pattern {1}
+RubySearch_SearchForClassSymbol=Class
+RubySearch_SearchForMethodSymbol=Method
+RubySearchPage_SearchForGroupLabel=Search for
+RubySearch_ResultLabel=Search for {0} with pattern {1}
#########################################
# Wizards
#########################################
-NewProjectCreationWizard.windowTitle=New
-NewProjectCreationWizard.projectCreationMessage=Creating new Ruby Project
+NewProjectCreationWizard_windowTitle=New
+NewProjectCreationWizard_projectCreationMessage=Creating new Ruby Project
-WizardNewProjectCreationPage.pageName=Create Ruby Project
-WizardNewProjectCreationPage.pageTitle=Ruby Project
-WizardNewProjectCreationPage.pageDescription=Create a new Ruby Project
+WizardNewProjectCreationPage_pageName=Create Ruby Project
+WizardNewProjectCreationPage_pageTitle=Ruby Project
+WizardNewProjectCreationPage_pageDescription=Create a new Ruby Project
#########################################
# 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
@@ -83,14 +82,14 @@
#########
# misc
#########
+RubyAnnotationHover_multipleMarkersAtThisLine=Multiple markers at this line
-RubyAnnotationHover.multipleMarkersAtThisLine=Multiple markers at this line
+HTMLTextPresenter_ellipsis=...
+HTML2TextReader_listItemPrefix=\t-
-HTMLTextPresenter.ellipsis=...
-HTML2TextReader.listItemPrefix=\t-
-
RDocPathErrorTitle=RDoc path error
RDocPathError=The input path for RDoc is blank or incorrect. Use preferences to enter a valid RDoc path.
+ErrorRunningRdocTitle=Error running RDoc
CoreUtility_job_title=Rebuilding
CoreUtility_buildall_taskname=Build all...
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/OptionalMessageDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/OptionalMessageDialog.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/dialogs/OptionalMessageDialog.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -35,7 +35,7 @@
public class OptionalMessageDialog extends MessageDialog {
// String constants for widgets
- private static final String CHECKBOX_TEXT= RubyUIMessages.getString("OptionalMessageDialog.dontShowAgain"); //$NON-NLS-1$
+ private static final String CHECKBOX_TEXT= RubyUIMessages.OptionalMessageDialog_dontShowAgain;
// Dialog store id constants
private static final String STORE_ID= "OptionalMessageDialog.hide."; //$NON-NLS-1$
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingConfigurationBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingConfigurationBlock.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingConfigurationBlock.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -274,7 +274,7 @@
if (desc == null) {
// safety in case there is no such descriptor
- String message= RubyUIMessages.getString("FoldingConfigurationBlock.error.not_exist"); //$NON-NLS-1$
+ String message= RubyUIMessages.FoldingConfigurationBlock_error_not_exist;
RubyPlugin.log(new Status(IStatus.WARNING, RubyPlugin.getPluginId(), IStatus.OK, message, null));
prefs= new ErrorPreferences(message);
} else {
@@ -294,7 +294,7 @@
if (control == null) {
control= prefs.createControl(fGroup);
if (control == null) {
- String message= RubyUIMessages.getString("FoldingConfigurationBlock.info.no_preferences"); //$NON-NLS-1$
+ String message= RubyUIMessages.FoldingConfigurationBlock_info_no_preferences;
control= new ErrorPreferences(message).createControl(fGroup);
} else {
fProviderControls.put(id, control);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyBasePreferencePage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyBasePreferencePage.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyBasePreferencePage.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -15,7 +15,7 @@
public RubyBasePreferencePage() {
- setDescription(RubyUIMessages.getString("RubyBasePreferencePage.label")); //$NON-NLS-1$
+ setDescription(RubyUIMessages.RubyBasePreferencePage_label);
setPreferenceStore(RubyPlugin.getDefault().getPreferenceStore());
fOverlayStore = createOverlayStore();
}
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-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -91,7 +91,7 @@
// If we can't find it ourselves then display an error to the user
if (!file.exists() || !file.isFile()) {
- MessageDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("RDocPathErrorTitle"), RubyUIMessages.getString("RDocPathError")) ;
+ MessageDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.RDocPathErrorTitle, RubyUIMessages.RDocPathError);
return;
}
@@ -108,7 +108,7 @@
} catch (IOException e) {
RubyPlugin.log(e);
log(e.getMessage());
- ErrorDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("ErrorRunningRdocTitle"), e.getMessage(), new StatusInfo(StatusInfo.ERROR, e.getMessage()));
+ ErrorDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.ErrorRunningRdocTitle, e.getMessage(), new StatusInfo(StatusInfo.ERROR, e.getMessage()));
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/resourcesview/RubyFilesOnlyFilterAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/resourcesview/RubyFilesOnlyFilterAction.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/resourcesview/RubyFilesOnlyFilterAction.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -20,8 +20,8 @@
public RubyFilesOnlyFilterAction(IResourceNavigator navigator, boolean sortByType) {
- super(navigator, RubyUIMessages.getString("ToggleMenuRubyFilesOnly"));
- this.setToolTipText(RubyUIMessages.getString("ToggleMenuRubyFilesOnly.Tooltip"));
+ super(navigator, RubyUIMessages.ToggleMenuRubyFilesOnly);
+ this.setToolTipText(RubyUIMessages.ToggleMenuRubyFilesOnly_Tooltip);
this.setChecked(((RubyResourcesView) this.getNavigator()).isRubyFilesOnlyFilterActivated()) ;
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchPage.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -513,15 +513,13 @@
private Control createSearchFor(Composite parent) {
Group result = new Group(parent, SWT.NONE);
- result.setText(RubyUIMessages.getString("RubySearchPage.SearchForGroupLabel")); //$NON-NLS-1$
+ result.setText(RubyUIMessages.RubySearchPage_SearchForGroupLabel);
result.setLayout(new GridLayout(2, true));
fSearchFor = new Button[2];
- fSearchFor[0] = createButton(result, RubyUIMessages
- .getString("RubySearch.SearchForClassSymbol"), CLASS_SYMBOL); //$NON-NLS-1$
+ fSearchFor[0] = createButton(result, RubyUIMessages.RubySearch_SearchForClassSymbol, CLASS_SYMBOL);
fSearchFor[0].setSelection(true);
- fSearchFor[1] = createButton(result, RubyUIMessages
- .getString("RubySearch.SearchForMethodSymbol"), METHOD_SYMBOL); //$NON-NLS-1$
+ fSearchFor[1] = createButton(result, RubyUIMessages.RubySearch_SearchForMethodSymbol, METHOD_SYMBOL);
return result;
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchQuery.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchQuery.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/RubySearchQuery.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -86,19 +86,17 @@
String args[] = new String[2];
switch (fSymbolType) {
case METHOD_SYMBOL:
- args[0] = RubyUIMessages
- .getString("RubySearch.SearchForMethodSymbol"); //$NON-NLS-1$
+ args[0] = RubyUIMessages.RubySearch_SearchForMethodSymbol;
break;
case CLASS_SYMBOL:
- args[0] = RubyUIMessages
- .getString("RubySearch.SearchForClassSymbol"); //$NON-NLS-1$
+ args[0] = RubyUIMessages.RubySearch_SearchForClassSymbol;
break;
default:
break;
}
args[1] = fSearchString;
return RubyUIMessages
- .getFormattedString("RubySearch.ResultLabel", args); //$NON-NLS-1$
+ .getFormattedString(RubyUIMessages.RubySearch_ResultLabel, args);
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTML2TextReader.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTML2TextReader.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTML2TextReader.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -168,7 +168,7 @@
return "\t"; //$NON-NLS-1$
if ("li".equals(html)) //$NON-NLS-1$
- return LINE_DELIM + RubyUIMessages.getString("HTML2TextReader.listItemPrefix"); //$NON-NLS-1$ //$NON-NLS-2$
+ return LINE_DELIM + RubyUIMessages.HTML2TextReader_listItemPrefix;
if ("/b".equals(html)) { //$NON-NLS-1$
stopBold();
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTMLTextPresenter.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTMLTextPresenter.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/HTMLTextPresenter.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -147,7 +147,7 @@
if (line != null && buffer.length() > 0) {
append(buffer, LINE_DELIM, lineFormatted ? presentation : null);
- append(buffer, RubyUIMessages.getString("HTMLTextPresenter.ellipsis"), presentation); //$NON-NLS-1$
+ append(buffer, RubyUIMessages.HTMLTextPresenter_ellipsis, presentation);
}
return trim(buffer, presentation);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyAnnotationHover.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyAnnotationHover.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyAnnotationHover.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -203,7 +203,7 @@
private String formatMultipleMessages(List messages) {
StringBuffer buffer = new StringBuffer();
HTMLPrinter.addPageProlog(buffer);
- HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(RubyUIMessages.getString("RubyAnnotationHover.multipleMarkersAtThisLine"))); //$NON-NLS-1$
+ HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(RubyUIMessages.RubyAnnotationHover_multipleMarkersAtThisLine));
HTMLPrinter.startBulletList(buffer);
Iterator e = messages.iterator();
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/ExceptionHandler.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/ExceptionHandler.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/ExceptionHandler.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -68,7 +68,7 @@
msg.write("\n\n");
}
if (exceptionMessage == null || exceptionMessage.length() == 0)
- msg.write(RubyUIMessages.getString("ExceptionDialog.seeErrorLogMessage"));
+ msg.write(RubyUIMessages.ExceptionDialog_seeErrorLogMessage);
else
msg.write(exceptionMessage);
MessageDialog.openError(shell, title, msg.toString());
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewProjectCreationWizard.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewProjectCreationWizard.java 2007-01-22 19:42:09 UTC (rev 1842)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/wizards/NewProjectCreationWizard.java 2007-01-22 20:11:26 UTC (rev 1843)
@@ -31,7 +31,7 @@
public NewProjectCreationWizard() {
setDefaultPageImageDescriptor(RubyPluginImages.DESC_WIZBAN_NEWJPRJ);
- setWindowTitle(RubyUIMessages.getString("NewProjectCreationWizard.windowTitle"));
+ setWindowTitle(RubyUIMessages.NewProjectCreationWizard_windowTitle);
}
public boolean performFinish() {
@@ -54,7 +54,7 @@
return new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
int remainingWorkUnits = 10;
- monitor.beginTask(RubyUIMessages.getString("NewProjectCreationWizard.projectCreationMessage"), remainingWorkUnits);
+ monitor.beginTask(RubyUIMessages.NewProjectCreationWizard_projectCreationMessage, remainingWorkUnits);
IWorkspace workspace = RubyPlugin.getWorkspace();
newProject = projectPage.getProjectHandle();
@@ -89,9 +89,9 @@
public void addPages() {
super.addPages();
- projectPage = new WizardNewProjectCreationPage(RubyUIMessages.getString("WizardNewProjectCreationPage.pageName"));
- projectPage.setTitle(RubyUIMessages.getString("WizardNewProjectCreationPage.pageTitle"));
- projectPage.setDescription(RubyUIMessages.getString("WizardNewProjectCreationPage.pageDescription"));
+ projectPage = new WizardNewProjectCreationPage(RubyUIMessages.WizardNewProjectCreationPage_pageName);
+ projectPage.setTitle(RubyUIMessages.WizardNewProjectCreationPage_pageTitle);
+ projectPage.setDescription(RubyUIMessages.WizardNewProjectCreationPage_pageDescription);
projectPage.setInitialProjectName(this.getDefaultProjectName()) ;
projectPage.setImageDescriptor(RubyPluginImages.DESC_WIZBAN_NEWJPRJ);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 19:42:16
|
Revision: 1842
http://svn.sourceforge.net/rubyeclipse/?rev=1842&view=rev
Author: cawilliams
Date: 2007-01-22 11:42:09 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
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-22 19:13:24 UTC (rev 1841)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-22 19:42:09 UTC (rev 1842)
@@ -202,6 +202,7 @@
public void dispose() {
descriptionUpdater.requestStop();
RubyRuntime.removeVMInstallChangedListener(runtimeListener);
+ RDocUtility.removeRdocListener(this);
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-22 19:13:27
|
Revision: 1841
http://svn.sourceforge.net/rubyeclipse/?rev=1841&view=rev
Author: cawilliams
Date: 2007-01-22 11:13:24 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to eat duplicate syntax exceptions, make sure we pass charset to parser when we can
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-01-22 19:09:06 UTC (rev 1840)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-01-22 19:13:24 UTC (rev 1841)
@@ -55,7 +55,8 @@
RubyLintVisitor visitor = new RubyLintVisitor(contents, problemRequestor);
node.accept(visitor);
} catch (SyntaxException e) {
- problemRequestor.acceptProblem(new Error(e.getPosition(), e.getMessage()));
+ // Eat the exception
+// problemRequestor.acceptProblem(new Error(e.getPosition(), e.getMessage()));
} catch (RubyModelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Modified: 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/parser/RubyParser.java 2007-01-22 19:09:06 UTC (rev 1840)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/parser/RubyParser.java 2007-01-22 19:13:24 UTC (rev 1841)
@@ -15,6 +15,7 @@
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -26,6 +27,7 @@
import org.jruby.parser.RubyParserConfiguration;
import org.jruby.parser.RubyParserPool;
import org.jruby.parser.RubyParserResult;
+import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.internal.core.builder.IoUtils;
/**
@@ -90,8 +92,11 @@
InputStream contents = null;
try {
contents = file.getContents();
- return parse(file, new InputStreamReader(contents));
- } finally {
+ return parse(file, new InputStreamReader(contents, file.getCharset()));
+ } catch (UnsupportedEncodingException e) {
+ RubyCore.log(e);
+ return parse(file, new InputStreamReader(contents));
+ } finally {
IoUtils.closeQuietly(contents);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 19:09:17
|
Revision: 1840
http://svn.sourceforge.net/rubyeclipse/?rev=1840&view=rev
Author: cawilliams
Date: 2007-01-22 11:09:06 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
Close Ticket #89 - with new JRuby we seem to handle UTF8 fine, just need to make sure all calls to parser take charset into account
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java
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-22 19:08:10 UTC (rev 1839)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/builder/RubyCodeAnalyzer.java 2007-01-22 19:09:06 UTC (rev 1840)
@@ -15,7 +15,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
-import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -42,17 +42,24 @@
}
public void compileFile(IFile file) throws CoreException {
- Reader reader = new InputStreamReader(file.getContents());
+ Reader reader = null;
+ try {
+ reader = new InputStreamReader(file.getContents(), file.getCharset());
+ } catch (UnsupportedEncodingException e1) {
+ RubyCore.log(e1);
+ return;
+ }
String contents = readContents(reader);
markerManager.removeProblemsAndTasksFor(file);
try {
- Node rootNode = parser.parse(file, new StringReader(contents));
+ Node rootNode = parser.parse(file, reader);
if (rootNode == null) return;
RubyLintVisitor visitor = new RubyLintVisitor(contents, new ProblemRequestorMarkerManager(file, markerManager));
rootNode.accept(visitor);
indexUpdater.update(file, rootNode, true);
} catch (SyntaxException e) {
- markerManager.createSyntaxError(file, e);
+ // Should we really put a marker here? I think the normal parsing process will create syntax markers just fine
+ //markerManager.createSyntaxError(file, e);
} finally {
IoUtils.closeQuietly(reader);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 19:08:12
|
Revision: 1839
http://svn.sourceforge.net/rubyeclipse/?rev=1839&view=rev
Author: cawilliams
Date: 2007-01-22 11:08:10 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
do a check to see if ri exists and is a file before trying to execute it
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java
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-22 18:22:20 UTC (rev 1838)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-22 19:08:10 UTC (rev 1839)
@@ -1,6 +1,7 @@
package org.rubypeople.rdt.internal.ui.text.ruby.hover;
import java.io.BufferedReader;
+import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
@@ -20,6 +21,9 @@
public class RiDocHoverProvider implements ITextHoverProvider {
public String getHoverInfo(IEditorInput input, ITextViewer textViewer, IRegion hoverRegion){
IPath riPath = new Path( RubyPlugin.getDefault().getPreferenceStore().getString( PreferenceConstants.RI_PATH ) );
+ File ri = riPath.toFile();
+ if (!ri.exists() || !ri.isFile()) return "RI executable doesn't exist at given path";
+
List<String> args = new ArrayList<String>();
args.add(0, riPath.toString());
// these will get rid of some of the overhead formatting
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-22 18:23:09
|
Revision: 1838
http://svn.sourceforge.net/rubyeclipse/?rev=1838&view=rev
Author: cawilliams
Date: 2007-01-22 10:22:20 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
oopsie - another attempt to close Ticket #221 - synchronize releaseAllReaders method
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/MultiReaderStrategy.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/MultiReaderStrategy.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/MultiReaderStrategy.java 2007-01-21 20:19:41 UTC (rev 1837)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/MultiReaderStrategy.java 2007-01-22 18:22:20 UTC (rev 1838)
@@ -101,7 +101,7 @@
}
}
- protected void releaseAllReaders() {
+ protected synchronized void releaseAllReaders() {
for (Iterator<Map.Entry<XmlStreamReader, Thread>> iter = threads.entrySet().iterator(); iter.hasNext();) {
Thread thread = iter.next().getValue();
thread.interrupt();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-21 20:19:45
|
Revision: 1837
http://svn.sourceforge.net/rubyeclipse/?rev=1837&view=rev
Author: cawilliams
Date: 2007-01-21 12:19:41 -0800 (Sun, 21 Jan 2007)
Log Message:
-----------
Fix what I borke earlier. Now our Rdoc/RI stuff should work again. There's no need to hook it to a VM/Interpreter to execute these things (though we may want to try and detect the location of the executables by getting the selected VM install and then building the path to bin/rdoc and bin/ri).
Modified Paths:
--------------
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
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-21 18:37:43 UTC (rev 1836)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-21 20:19:41 UTC (rev 1837)
@@ -10,7 +10,6 @@
import java.util.Iterator;
import java.util.List;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.Action;
@@ -46,7 +45,6 @@
import org.rubypeople.rdt.internal.ui.rdocexport.RdocListener;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallChangedListener;
-import org.rubypeople.rdt.launching.IVMRunner;
import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
@@ -360,13 +358,10 @@
}
private abstract class RubyInvoker {
- protected abstract List getArgList();
+ protected abstract List<String> getArgList();
protected abstract void handleOutput(Process process);
protected void beforeInvoke(){}
-
-
-
public final void invoke() {
IPath riPath = new Path( RubyPlugin.getDefault().getPreferenceStore().getString( PreferenceConstants.RI_PATH ) );
@@ -382,17 +377,16 @@
return;
}
-// try {
- List args = getArgList();
+ try {
+ List<String> args = getArgList();
args.add(0, riPath.toString());
- IVMRunner runner = RubyRuntime.getDefaultVMInstall().getVMRunner("run");
- // XXX How in the world do we do these quick little background launches and grab the process?
- final Process p = null;
+ String[] argArray= (String[]) args.toArray(new String[args.size()]);
+ Process p= Runtime.getRuntime().exec(argArray);
handleOutput(p);
-// } catch (CoreException coreException) {
-// // message of RuntimeException will be displayed in the RI View
-// throw new RuntimeException(coreException.getStatus().getMessage());
-// }
+ } catch (IOException e) {
+ // message of RuntimeException will be displayed in the RI View
+ throw new RuntimeException(e.getMessage(), e);
+ }
}
}
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-21 18:37:43 UTC (rev 1836)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-21 20:19:41 UTC (rev 1837)
@@ -2,6 +2,7 @@
import java.io.BufferedReader;
import java.io.File;
+import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
@@ -11,17 +12,13 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.rubypeople.rdt.internal.launching.LaunchingMessages;
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.IVMInstall;
-import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
/**
@@ -32,8 +29,8 @@
* @author Chris
*/
public class RDocUtility {
-
- private static Set listeners = new HashSet();
+
+ private static Set<RdocListener> listeners = new HashSet<RdocListener>();
private static boolean isDebug = false;
public static void addRdocListener(RdocListener listener) {
@@ -85,12 +82,6 @@
public final void invoke() {
log("Generating RDoc for " + resource.getName());
- IVMInstall interpreter = RubyRuntime.getDefaultVMInstall();
- if (interpreter == null) {
- MessageDialog.openInformation(RubyPlugin.getActiveWorkbenchShell(), LaunchingMessages.RdtLaunchingPlugin_noInterpreterSelectedTitle, LaunchingMessages.RdtLaunchingPlugin_noInterpreterSelected);
- return ;
- }
-
IPath rdocPath = new Path(RubyPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.RDOC_PATH));
// check the rdoc path for existence. It might have been
@@ -103,21 +94,22 @@
MessageDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("RDocPathErrorTitle"), RubyUIMessages.getString("RDocPathError")) ;
return;
}
-
- List args = new ArrayList();
+
+ List<String> args = new ArrayList<String>();
args.add(rdocPath.toString());
args.add("-r");
args.add(resource.getLocation().toOSString());
-// try {
- // XXX How do we do quick background launches of the interpreter?
-// final Process p = interpreter.exec(args, null);
- final Process p = null;
- handleOutput(p, args);
-// } catch (CoreException e) {
-// RubyPlugin.log(e);
-// log(e.getMessage());
-// ErrorDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("ErrorRunningRdocTitle"), e.getMessage(), new StatusInfo(StatusInfo.ERROR, e.getMessage()));
-// }
+ String[] argArray= (String[]) args.toArray(new String[args.size()]);
+ try {
+ Process process= Runtime.getRuntime().exec(argArray);
+ if (process != null) {
+ handleOutput(process, args);
+ }
+ } catch (IOException e) {
+ RubyPlugin.log(e);
+ log(e.getMessage());
+ ErrorDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("ErrorRunningRdocTitle"), e.getMessage(), new StatusInfo(StatusInfo.ERROR, e.getMessage()));
+ }
}
/**
@@ -128,7 +120,7 @@
* @param p
* The Process.
*/
- private void handleOutput(Process p, List cmdLine) {
+ private void handleOutput(Process p, List<String> cmdLine) {
BufferedReader reader = null;
String lastLine = null;
try {
@@ -166,7 +158,7 @@
*
*/
public static void notifyListeners() {
- for (Iterator iter = listeners.iterator(); iter.hasNext();) {
+ for (Iterator<RdocListener> iter = listeners.iterator(); iter.hasNext();) {
RdocListener listener = (RdocListener) iter.next();
listener.rdocChanged();
}
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-21 18:37:43 UTC (rev 1836)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-21 20:19:41 UTC (rev 1837)
@@ -6,7 +6,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.BadLocationException;
@@ -14,8 +13,6 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.ui.IEditorInput;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
-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;
@@ -23,7 +20,7 @@
public class RiDocHoverProvider implements ITextHoverProvider {
public String getHoverInfo(IEditorInput input, ITextViewer textViewer, IRegion hoverRegion){
IPath riPath = new Path( RubyPlugin.getDefault().getPreferenceStore().getString( PreferenceConstants.RI_PATH ) );
- List args = new ArrayList();
+ List<String> args = new ArrayList<String>();
args.add(0, riPath.toString());
// these will get rid of some of the overhead formatting
args.add("-f");
@@ -34,11 +31,8 @@
try {
String symbol = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
args.add(symbol);
- IVMInstall selectedInterpreter = RubyRuntime.getDefault().getDefaultVMInstall();
- if (selectedInterpreter == null) return null;
-// XXX How in the world do we do these quick little background launches and grab the process?
-// Process p = selectedInterpreter.exec(args, null);
- Process p = null;
+ String[] argArray= (String[]) args.toArray(new String[args.size()]);
+ Process p = Runtime.getRuntime().exec(argArray);
if (p == null) return null;
br = new BufferedReader(new InputStreamReader(p.getInputStream()));
// TODO: format the documentation that was fetched from RI
@@ -58,8 +52,6 @@
return "" + buf.toString();
} catch (BadLocationException e) {
RubyPlugin.log(e);
-// } catch (CoreException e) {
-// RubyPlugin.log(e);
} catch (IOException e) {
RubyPlugin.log(e);
} finally {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-21 18:37:45
|
Revision: 1836
http://svn.sourceforge.net/rubyeclipse/?rev=1836&view=rev
Author: cawilliams
Date: 2007-01-21 10:37:43 -0800 (Sun, 21 Jan 2007)
Log Message:
-----------
move its location
Added Paths:
-----------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java 2007-01-21 18:37:43 UTC (rev 1836)
@@ -0,0 +1,402 @@
+package org.rubypeople.rdt.internal.debug.ui.rubyvms;
+
+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.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+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.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstall2;
+import org.rubypeople.rdt.launching.IVMInstallType;
+import org.rubypeople.rdt.launching.VMStandin;
+
+public class AddVMDialog extends StatusDialog {
+
+ protected IStatus[] allStatus = new IStatus[2];
+
+ protected IVMInstall fEditedVM;
+ private StringButtonDialogField fRubyVMRoot;
+ private StringDialogField fVMName;
+
+ private StringDialogField fVMArgs;
+
+ private IVMInstallType fSelectedVMType;
+ private IVMInstallType[] fVMTypes;
+ private ComboDialogField fVMTypeCombo;
+ private VMLibraryBlock fLibraryBlock;
+
+ private IStatus[] fStati;
+
+ private int fPrevIndex = -1;
+
+ private IAddVMDialogRequestor fRequestor;
+
+ public AddVMDialog(IAddVMDialogRequestor requestor, Shell shell, IVMInstallType[] vmInstallTypes, IVMInstall 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.getVMInstallType() : vmInstallTypes[0];
+
+ fEditedVM= editedVM;
+ }
+
+ protected void setSystemLibraryStatus(IStatus status) {
+ fStati[3]= status;
+ }
+
+ protected IStatus validateInterpreterLocationText() {
+ String locationName= fRubyVMRoot.getText();
+ IStatus s = null;
+ File file = null;
+ if (locationName.length() == 0) {
+ s = new StatusInfo(IStatus.INFO, RubyVMMessages.addVMDialog_enterLocation);
+ } else {
+ file= new File(locationName);
+ if (!file.exists()) {
+ s = new StatusInfo(IStatus.ERROR, RubyVMMessages.addVMDialog_locationNotExists);
+ } else {
+ final IStatus[] temp = new IStatus[1];
+ final File tempFile = file;
+ Runnable r = new Runnable() {
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ temp[0] = getVMType().validateInstallLocation(tempFile);
+ }
+ };
+ BusyIndicator.showWhile(getShell().getDisplay(), r);
+ s = temp[0];
+ }
+ }
+ if (s.isOK()) {
+ fLibraryBlock.setHomeDirectory(file);
+ String name = fVMName.getText();
+ if (name == null || name.trim().length() == 0) {
+ // auto-generate VM name
+ try {
+ String genName = null;
+ IPath path = new Path(file.getCanonicalPath());
+ int segs = path.segmentCount();
+ if (segs == 1) {
+ genName = path.segment(0);
+ } else if (segs >= 2) {
+ String last = path.lastSegment();
+ // FIXME What is this reference to a jre directory?
+ if ("jre".equalsIgnoreCase(last)) { //$NON-NLS-1$
+ genName = path.segment(segs - 2);
+ } else {
+ genName = last;
+ }
+ }
+ if (genName != null) {
+ fVMName.setText(genName);
+ }
+ } catch (IOException e) {}
+ }
+ } else {
+ fLibraryBlock.setHomeDirectory(null);
+ }
+ fLibraryBlock.restoreDefaultLibraries();
+ return s;
+ }
+
+ private IVMInstallType getVMType() {
+ return fSelectedVMType;
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.Dialog#setButtonLayoutData(org.eclipse.swt.widgets.Button)
+ */
+ protected void setButtonLayoutData(Button button) {
+ super.setButtonLayoutData(button);
+ }
+
+ protected void browseForInstallLocation() {
+ DirectoryDialog dialog= new DirectoryDialog(getShell());
+ dialog.setFilterPath(fRubyVMRoot.getText());
+ dialog.setMessage(RubyVMMessages.addVMDialog_pickJRERootDialog_message);
+ String newPath= dialog.open();
+ if (newPath != null) {
+ fRubyVMRoot.setText(newPath);
+ }
+ }
+
+ protected void okPressed() {
+ doOkPressed();
+ super.okPressed();
+ }
+
+ private void doOkPressed() {
+ if (fEditedVM == null) {
+ IVMInstall 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(IVMInstallType vmType) {
+ String id= null;
+ do {
+ id= String.valueOf(System.currentTimeMillis());
+ } while (vmType.findVMInstall(id) != null);
+ return id;
+ }
+
+ private void selectVMType() {
+ for (int i= 0; i < fVMTypes.length; i++) {
+ if (fSelectedVMType == fVMTypes[i]) {
+ fVMTypeCombo.selectItem(i);
+ return;
+ }
+ }
+ }
+
+ private void updateVMType() {
+ int selIndex= fVMTypeCombo.getSelectionIndex();
+ if (selIndex == fPrevIndex) {
+ return;
+ }
+ fPrevIndex = selIndex;
+ if (selIndex >= 0 && selIndex < fVMTypes.length) {
+ fSelectedVMType= fVMTypes[selIndex];
+ }
+ setRubyVMLocationStatus(validateInterpreterLocationText());
+ fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
+ updateStatusLine();
+ }
+
+ private void setRubyVMLocationStatus(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);
+
+ fVMName.doFillIntoGrid(parent, 3);
+
+ fRubyVMRoot.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= fRubyVMRoot.getTextControl(parent);
+ gd= (GridData)t.getLayoutData();
+ gd.grabExcessHorizontalSpace=true;
+ gd.widthHint= convertWidthInCharsToPixels(50);
+
+ initializeFields();
+ createFieldListeners();
+ applyDialogFont(parent);
+ return parent;
+ }
+
+ private void initializeFields() {
+ fVMTypeCombo.setItems(getVMTypeNames());
+ if (fEditedVM == null) {
+ fVMName.setText(""); //$NON-NLS-1$
+ fRubyVMRoot.setText(""); //$NON-NLS-1$
+ fLibraryBlock.initializeFrom(null, fSelectedVMType);
+ fVMArgs.setText(""); //$NON-NLS-1$
+ } else {
+ fVMTypeCombo.setEnabled(false);
+ fVMName.setText(fEditedVM.getName());
+ fRubyVMRoot.setText(fEditedVM.getInstallLocation().getAbsolutePath());
+ fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
+ if (fEditedVM instanceof IVMInstall2) {
+ IVMInstall2 vm2 = (IVMInstall2) fEditedVM;
+ String vmArgs = vm2.getVMArgs();
+ if (vmArgs != null) {
+ fVMArgs.setText(vmArgs);
+ }
+ } else {
+ String[] vmArgs = fEditedVM.getVMArguments();
+ 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());
+ }
+ }
+ }
+ setVMNameStatus(validateVMName());
+ updateStatusLine();
+ }
+
+ private void setVMNameStatus(IStatus status) {
+ fStati[0]= status;
+ }
+
+ 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();
+ }
+ });
+
+ fRubyVMRoot.setDialogFieldListener(new IDialogFieldListener() {
+ public void dialogFieldChanged(DialogField field) {
+ setRubyVMLocationStatus(validateInterpreterLocationText());
+ updateStatusLine();
+ }
+ });
+ }
+
+ 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 status;
+ }
+
+ 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);
+
+ fRubyVMRoot= new StringButtonDialogField(new IStringButtonAdapter() {
+ public void changeControlPressed(DialogField field) {
+ browseForInstallLocation();
+ }
+ });
+ fRubyVMRoot.setLabelText(RubyVMMessages.addVMDialog_jreHome);
+ fRubyVMRoot.setButtonLabel(RubyVMMessages.addVMDialog_browse1);
+
+ fVMArgs= new StringDialogField();
+ fVMArgs.setLabelText(RubyVMMessages.AddVMDialog_23);
+ }
+
+ 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 void setFieldValuesToVM(IVMInstall vm) {
+ File dir = new File(fRubyVMRoot.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 IVMInstall2) {
+ IVMInstall2 vm2 = (IVMInstall2) vm;
+ if (argString != null && argString.length() >0) {
+ vm2.setVMArgs(argString);
+ } else {
+ vm2.setVMArgs(null);
+ }
+ } else {
+ if (argString != null && argString.length() >0) {
+ vm.setVMArguments(DebugPlugin.parseArguments(argString));
+ } else {
+ vm.setVMArguments(null);
+ }
+ }
+
+
+ fLibraryBlock.performApply(vm);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
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-21 18:36:46
|
Revision: 1835
http://svn.sourceforge.net/rubyeclipse/?rev=1835&view=rev
Author: cawilliams
Date: 2007-01-21 10:36:44 -0800 (Sun, 21 Jan 2007)
Log Message:
-----------
move its location
Removed Paths:
-------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/AddVMDialog.java
Deleted: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/AddVMDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/AddVMDialog.java 2007-01-21 18:35:37 UTC (rev 1834)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/AddVMDialog.java 2007-01-21 18:36:44 UTC (rev 1835)
@@ -1,390 +0,0 @@
-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.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.rubypeople.rdt.internal.debug.ui.rubyvms.IAddVMDialogRequestor;
-import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
-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.IVMInstall;
-import org.rubypeople.rdt.launching.IVMInstall2;
-import org.rubypeople.rdt.launching.IVMInstallType;
-import org.rubypeople.rdt.launching.VMStandin;
-
-public class AddVMDialog extends StatusDialog {
-
- protected IStatus[] allStatus = new IStatus[2];
-
- protected IVMInstall fEditedVM;
- private StringButtonDialogField fRubyVMRoot;
- private StringDialogField fVMName;
-
- private StringDialogField fVMArgs;
-
- private IVMInstallType fSelectedVMType;
- private IVMInstallType[] fVMTypes;
- private ComboDialogField fVMTypeCombo;
-
- private IStatus[] fStati;
-
- private int fPrevIndex = -1;
-
- private IAddVMDialogRequestor fRequestor;
-
- public AddVMDialog(IAddVMDialogRequestor requestor, Shell shell, IVMInstallType[] vmInstallTypes, IVMInstall 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.getVMInstallType() : vmInstallTypes[0];
-
- fEditedVM= editedVM;
- }
-
- protected IStatus validateInterpreterLocationText() {
- String locationName= fRubyVMRoot.getText();
- IStatus s = null;
- File file = null;
- if (locationName.length() == 0) {
- s = new StatusInfo(IStatus.INFO, RubyVMMessages.addVMDialog_enterLocation);
- } else {
- file= new File(locationName);
- if (!file.exists()) {
- s = new StatusInfo(IStatus.ERROR, RubyVMMessages.addVMDialog_locationNotExists);
- } else {
- final IStatus[] temp = new IStatus[1];
- final File tempFile = file;
- Runnable r = new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- temp[0] = getVMType().validateInstallLocation(tempFile);
- }
- };
- BusyIndicator.showWhile(getShell().getDisplay(), r);
- s = temp[0];
- }
- }
- if (s.isOK()) {
-// fLibraryBlock.setHomeDirectory(file);
- String name = fVMName.getText();
- if (name == null || name.trim().length() == 0) {
- // auto-generate VM name
- try {
- String genName = null;
- IPath path = new Path(file.getCanonicalPath());
- int segs = path.segmentCount();
- if (segs == 1) {
- genName = path.segment(0);
- } else if (segs >= 2) {
- String last = path.lastSegment();
- if ("jre".equalsIgnoreCase(last)) { //$NON-NLS-1$
- genName = path.segment(segs - 2);
- } else {
- genName = last;
- }
- }
- if (genName != null) {
- fVMName.setText(genName);
- }
- } catch (IOException e) {}
- }
- } else {
-// fLibraryBlock.setHomeDirectory(null);
- }
-// fLibraryBlock.restoreDefaultLibraries();
- return s;
- }
-
- private IVMInstallType getVMType() {
- return fSelectedVMType;
- }
-
- protected void browseForInstallLocation() {
- DirectoryDialog dialog= new DirectoryDialog(getShell());
- dialog.setFilterPath(fRubyVMRoot.getText());
- dialog.setMessage(RubyVMMessages.addVMDialog_pickJRERootDialog_message);
- String newPath= dialog.open();
- if (newPath != null) {
- fRubyVMRoot.setText(newPath);
- }
- }
-
- protected void okPressed() {
- doOkPressed();
- super.okPressed();
- }
-
- private void doOkPressed() {
- if (fEditedVM == null) {
- IVMInstall 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(IVMInstallType vmType) {
- String id= null;
- do {
- id= String.valueOf(System.currentTimeMillis());
- } while (vmType.findVMInstall(id) != null);
- return id;
- }
-
- private void selectVMType() {
- for (int i= 0; i < fVMTypes.length; i++) {
- if (fSelectedVMType == fVMTypes[i]) {
- fVMTypeCombo.selectItem(i);
- return;
- }
- }
- }
-
- private void updateVMType() {
- int selIndex= fVMTypeCombo.getSelectionIndex();
- if (selIndex == fPrevIndex) {
- return;
- }
- fPrevIndex = selIndex;
- if (selIndex >= 0 && selIndex < fVMTypes.length) {
- fSelectedVMType= fVMTypes[selIndex];
- }
- setRubyVMLocationStatus(validateInterpreterLocationText());
-// fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
- updateStatusLine();
- }
-
- private void setRubyVMLocationStatus(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);
-
- fVMName.doFillIntoGrid(parent, 3);
-
- fRubyVMRoot.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= fRubyVMRoot.getTextControl(parent);
- gd= (GridData)t.getLayoutData();
- gd.grabExcessHorizontalSpace=true;
- gd.widthHint= convertWidthInCharsToPixels(50);
-
- initializeFields();
- createFieldListeners();
- applyDialogFont(parent);
- return parent;
- }
-
- private void initializeFields() {
- fVMTypeCombo.setItems(getVMTypeNames());
- if (fEditedVM == null) {
- fVMName.setText(""); //$NON-NLS-1$
- fRubyVMRoot.setText(""); //$NON-NLS-1$
-// fLibraryBlock.initializeFrom(null, fSelectedVMType);
- fVMArgs.setText(""); //$NON-NLS-1$
- } else {
- fVMTypeCombo.setEnabled(false);
- fVMName.setText(fEditedVM.getName());
- fRubyVMRoot.setText(fEditedVM.getInstallLocation().getAbsolutePath());
-// fLibraryBlock.initializeFrom(fEditedVM, fSelectedVMType);
- if (fEditedVM instanceof IVMInstall2) {
- IVMInstall2 vm2 = (IVMInstall2) fEditedVM;
- String vmArgs = vm2.getVMArgs();
- if (vmArgs != null) {
- fVMArgs.setText(vmArgs);
- }
- } else {
- String[] vmArgs = fEditedVM.getVMArguments();
- 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());
- }
- }
- }
- setVMNameStatus(validateVMName());
- updateStatusLine();
- }
-
- private void setVMNameStatus(IStatus status) {
- fStati[0]= status;
- }
-
- 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();
- }
- });
-
- fRubyVMRoot.setDialogFieldListener(new IDialogFieldListener() {
- public void dialogFieldChanged(DialogField field) {
- setRubyVMLocationStatus(validateInterpreterLocationText());
- updateStatusLine();
- }
- });
- }
-
- 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 status;
- }
-
- 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);
-
- fRubyVMRoot= new StringButtonDialogField(new IStringButtonAdapter() {
- public void changeControlPressed(DialogField field) {
- browseForInstallLocation();
- }
- });
- fRubyVMRoot.setLabelText(RubyVMMessages.addVMDialog_jreHome);
- fRubyVMRoot.setButtonLabel(RubyVMMessages.addVMDialog_browse1);
-
- fVMArgs= new StringDialogField();
- fVMArgs.setLabelText(RubyVMMessages.AddVMDialog_23);
- }
-
- 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 void setFieldValuesToVM(IVMInstall vm) {
- File dir = new File(fRubyVMRoot.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 IVMInstall2) {
- IVMInstall2 vm2 = (IVMInstall2) vm;
- if (argString != null && argString.length() >0) {
- vm2.setVMArgs(argString);
- } else {
- vm2.setVMArgs(null);
- }
- } else {
- if (argString != null && argString.length() >0) {
- vm.setVMArguments(DebugPlugin.parseArguments(argString));
- } else {
- vm.setVMArguments(null);
- }
- }
-
-
-// fLibraryBlock.performApply(vm);
- }
-
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-21 18:35:39
|
Revision: 1834
http://svn.sourceforge.net/rubyeclipse/?rev=1834&view=rev
Author: cawilliams
Date: 2007-01-21 10:35:37 -0800 (Sun, 21 Jan 2007)
Log Message:
-----------
More work to get the Interpreter/VM setup done correctly - expect that system libraries are folders, not jar/zip files.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/debug/ui/RdtDebugUiConstants.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.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/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
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.debug.ui/icons/full/ovr16/
trunk/org.rubypeople.rdt.debug.ui/icons/full/ovr16/error_co.gif
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RDTImageDescriptor.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubyDebugImages.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryStandin.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/VMLibraryBlock.java
trunk/org.rubypeople.rdt.ui/icons/full/obj16/jar_lsrc_obj.gif
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/SharedImages.java
Added: trunk/org.rubypeople.rdt.debug.ui/icons/full/ovr16/error_co.gif
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.debug.ui/icons/full/ovr16/error_co.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/debug/ui/RdtDebugUiConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/debug/ui/RdtDebugUiConstants.java 2007-01-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/debug/ui/RdtDebugUiConstants.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -7,4 +7,5 @@
public static final String SHOW_STATIC_VARIABLES_PREFERENCE = RdtDebugUiPlugin.PLUGIN_ID + ".showStaticVariables";
public static final String SHOW_CONSTANTS_PREFERENCE = RdtDebugUiPlugin.PLUGIN_ID + ".showConstants";
public static final String EVALUATION_EXPRESSIONS_PREFERENCE = RdtDebugUiPlugin.PLUGIN_ID + ".evaluationExpressions";
+ public static final int INTERNAL_ERROR = 0;
}
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RDTImageDescriptor.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RDTImageDescriptor.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RDTImageDescriptor.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,82 @@
+package org.rubypeople.rdt.internal.debug.ui;
+
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+
+public class RDTImageDescriptor extends CompositeImageDescriptor {
+
+ /** Flag to render the is out of synch adornment */
+ public final static int IS_OUT_OF_SYNCH= 0x0001;
+
+ private Point fSize;
+ private ImageDescriptor fBaseImage;
+ private int fFlags;
+
+ public RDTImageDescriptor(ImageDescriptor baseImage, int flags) {
+ setBaseImage(baseImage);
+ setFlags(flags);
+ }
+
+ @Override
+ protected void drawCompositeImage(int width, int height) {
+ ImageData bg= getBaseImage().getImageData();
+ if (bg == null) {
+ bg= DEFAULT_IMAGE_DATA;
+ }
+ drawImage(bg, 0, 0);
+ drawOverlays();
+ }
+
+ @Override
+ protected Point getSize() {
+ if (fSize == null) {
+ ImageData data= getBaseImage().getImageData();
+ setSize(new Point(data.width, data.height));
+ }
+ return fSize;
+ }
+
+ protected void setSize(Point size) {
+ fSize = size;
+ }
+
+ protected ImageDescriptor getBaseImage() {
+ return fBaseImage;
+ }
+
+ protected void setBaseImage(ImageDescriptor baseImage) {
+ fBaseImage = baseImage;
+ }
+
+ protected int getFlags() {
+ return fFlags;
+ }
+
+ protected void setFlags(int flags) {
+ fFlags = flags;
+ }
+
+ /**
+ * Add any overlays to the image as specified in the flags.
+ */
+ protected void drawOverlays() {
+ int flags= getFlags();
+ int x= 0;
+ int y= 0;
+ ImageData data= null;
+ if ((flags & IS_OUT_OF_SYNCH) != 0) {
+ x= getSize().x;
+ y= 0;
+ data= getImageData(RubyDebugImages.IMG_OVR_OUT_OF_SYNCH);
+ x -= data.width;
+ drawImage(data, x, y);
+ }
+ }
+
+ private ImageData getImageData(String imageDescriptorKey) {
+ return RubyDebugImages.getImageDescriptor(imageDescriptorKey).getImageData();
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java 2007-01-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RdtDebugUiPlugin.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -5,6 +5,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.internal.ui.ImageDescriptorRegistry;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -19,7 +21,9 @@
public static final String PLUGIN_ID = "org.rubypeople.rdt.debug.ui"; //$NON-NLS-1$
protected static RdtDebugUiPlugin plugin;
- private EvaluationExpressionModel evaluationExpressionModel ;
+ private EvaluationExpressionModel evaluationExpressionModel;
+
+ private ImageDescriptorRegistry fImageDescriptorRegistry;
public RdtDebugUiPlugin() {
super();
@@ -58,6 +62,17 @@
new CodeReloader();
}
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ try {
+ if (fImageDescriptorRegistry != null) {
+ fImageDescriptorRegistry.dispose();
+ }
+ } finally {
+ super.stop(context);
+ }
+ }
+
public EvaluationExpressionModel getEvaluationExpressionModel() {
if (evaluationExpressionModel == null) {
evaluationExpressionModel = new EvaluationExpressionModel() ;
@@ -65,4 +80,31 @@
return evaluationExpressionModel ;
}
+ public static String getUniqueIdentifier() {
+ return PLUGIN_ID;
+ }
+
+ /**
+ * Returns the standard display to be used. The method first checks, if
+ * the thread calling this method has an associated display. If so, this
+ * display is returned. Otherwise the method returns the default display.
+ */
+ public static Display getStandardDisplay() {
+ Display display;
+ display= Display.getCurrent();
+ if (display == null)
+ display= Display.getDefault();
+ return display;
+ }
+
+ /**
+ * Returns the image descriptor registry used for this plugin.
+ */
+ public static ImageDescriptorRegistry getImageDescriptorRegistry() {
+ if (getDefault().fImageDescriptorRegistry == null) {
+ getDefault().fImageDescriptorRegistry = new ImageDescriptorRegistry();
+ }
+ return getDefault().fImageDescriptorRegistry;
+ }
+
}
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubyDebugImages.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubyDebugImages.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/RubyDebugImages.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,65 @@
+package org.rubypeople.rdt.internal.debug.ui;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.osgi.framework.Bundle;
+
+public class RubyDebugImages {
+ private static String ICONS_PATH = "$nl$/icons/full/"; //$NON-NLS-1$
+
+ private static ImageRegistry fgImageRegistry;
+
+ public static final String IMG_OVR_OUT_OF_SYNCH = "IMG_OVR_OUT_OF_SYNCH"; //$NON-NLS-1$
+
+ private static final String T_OVR= ICONS_PATH + "ovr16/"; //$NON-NLS-1$
+
+ /**
+ * Returns the <code>ImageDescriptor</code> identified by the given key,
+ * or <code>null</code> if it does not exist.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getImageRegistry().getDescriptor(key);
+ }
+
+ /*
+ * Helper method to access the image registry from the JDIDebugUIPlugin
+ * class.
+ */
+ /* package */static ImageRegistry getImageRegistry() {
+ if (fgImageRegistry == null) {
+ initializeImageRegistry();
+ }
+ return fgImageRegistry;
+ }
+
+ private static void initializeImageRegistry() {
+ fgImageRegistry= new ImageRegistry(RdtDebugUiPlugin.getStandardDisplay());
+ declareImages();
+ }
+
+ private static void declareImages() {
+ declareRegistryImage(IMG_OVR_OUT_OF_SYNCH, T_OVR + "error_co.gif"); //$NON-NLS-1$
+ }
+
+ /**
+ * Declare an Image in the registry table.
+ * @param key The key to use when registering the image
+ * @param path The path where the image can be found. This path is relative to where
+ * this plugin class is found (i.e. typically the packages directory)
+ */
+ private final static void declareRegistryImage(String key, String path) {
+ ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
+ Bundle bundle = Platform.getBundle(RdtDebugUiPlugin.getUniqueIdentifier());
+ URL url = null;
+ if (bundle != null){
+ url = FileLocator.find(bundle, new Path(path), null);
+ desc = ImageDescriptor.createFromURL(url);
+ }
+ fgImageRegistry.put(key, desc);
+ }
+}
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-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/RubyEnvironmentTab.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -33,7 +33,7 @@
import org.rubypeople.rdt.internal.core.RubyModelManager;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
-import org.rubypeople.rdt.internal.debug.ui.preferences.AddVMDialog;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.AddVMDialog;
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;
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-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/preferences/RubyInterpreterPreferencePage.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -27,6 +27,7 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
+import org.rubypeople.rdt.internal.debug.ui.rubyvms.AddVMDialog;
import org.rubypeople.rdt.internal.debug.ui.rubyvms.IAddVMDialogRequestor;
import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMMessages;
import org.rubypeople.rdt.internal.debug.ui.rubyvms.RubyVMsUpdater;
@@ -40,7 +41,7 @@
/**
* VMs being displayed
*/
- private List fVMs = new ArrayList();
+ private List<IVMInstall> fVMs = new ArrayList<IVMInstall>();
protected CheckboxTableViewer fVMList;
protected Button addButton, editButton, removeButton;
@@ -72,7 +73,7 @@
private void fillWithWorkspaceRubyVMs() {
// fill with Ruby VMs
- List standins = new ArrayList();
+ List<VMStandin> standins = new ArrayList<VMStandin>();
IVMInstallType[] types = RubyRuntime.getVMInstallTypes();
for (int i = 0; i < types.length; i++) {
IVMInstallType type = types[i];
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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 java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+
+public class LibraryContentProvider implements ITreeContentProvider {
+
+ private Viewer fViewer;
+
+ private HashMap fChildren= new HashMap();
+
+ private LibraryStandin[] fLibraries= new LibraryStandin[0];
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ fViewer = viewer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ return fLibraries;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof LibraryStandin) {
+ LibraryStandin standin= (LibraryStandin) parentElement;
+ Object[] children= (Object[])fChildren.get(standin);
+ return children;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public void setLibraries(IPath[] libs) {
+ fLibraries = new LibraryStandin[libs.length];
+ for (int i = 0; i < libs.length; i++) {
+ fLibraries[i] = new LibraryStandin(libs[i]);
+ }
+ fViewer.refresh();
+ }
+
+ public IPath[] getLibraries() {
+ IPath[] locations = new IPath[fLibraries.length];
+ for (int i = 0; i < locations.length; i++) {
+ locations[i] = fLibraries[i].toLibraryLocation();
+ }
+ return locations;
+ }
+
+ /**
+ * Returns the list of libraries in the given selection. SubElements
+ * are replaced by their parent libraries.
+ */
+ private Set getSelectedLibraries(IStructuredSelection selection) {
+ Set libraries= new HashSet();
+ for (Iterator iter= selection.iterator(); iter.hasNext();) {
+ Object element= iter.next();
+ if (element instanceof LibraryStandin) {
+ libraries.add(element);
+ }
+ }
+ return libraries;
+ }
+
+ /**
+ * Move the libraries of the given selection up.
+ */
+ public void up(IStructuredSelection selection) {
+ Set libraries= getSelectedLibraries(selection);
+ for (int i= 0; i < fLibraries.length - 1; i++) {
+ if (libraries.contains(fLibraries[i + 1])) {
+ LibraryStandin temp= fLibraries[i];
+ fLibraries[i]= fLibraries[i + 1];
+ fLibraries[i + 1]= temp;
+ }
+ }
+ fViewer.refresh();
+ fViewer.setSelection(selection);
+ }
+
+ /**
+ * Move the libraries of the given selection down.
+ */
+ public void down(IStructuredSelection selection) {
+ Set libraries= getSelectedLibraries(selection);
+ for (int i= fLibraries.length - 1; i > 0; i--) {
+ if (libraries.contains(fLibraries[i - 1])) {
+ LibraryStandin temp= fLibraries[i];
+ fLibraries[i]= fLibraries[i - 1];
+ fLibraries[i - 1]= temp;
+ }
+ }
+ fViewer.refresh();
+ fViewer.setSelection(selection);
+ }
+
+ /**
+ * Remove the libraries contained in the given selection.
+ */
+ public void remove(IStructuredSelection selection) {
+ List newLibraries = new ArrayList();
+ for (int i = 0; i < fLibraries.length; i++) {
+ newLibraries.add(fLibraries[i]);
+ }
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ if (element instanceof LibraryStandin) {
+ newLibraries.remove(element);
+ }
+ }
+ fLibraries= (LibraryStandin[]) newLibraries.toArray(new LibraryStandin[newLibraries.size()]);
+ fViewer.refresh();
+ }
+
+ /**
+ * Add the given libraries before the selection, or after the existing libraries
+ * if the selection is empty.
+ */
+ public void add(IPath[] libs, IStructuredSelection selection) {
+ List newLibraries = new ArrayList(fLibraries.length + libs.length);
+ for (int i = 0; i < fLibraries.length; i++) {
+ newLibraries.add(fLibraries[i]);
+ }
+ List toAdd = new ArrayList(libs.length);
+ for (int i = 0; i < libs.length; i++) {
+ toAdd.add(new LibraryStandin(libs[i]));
+ }
+ if (selection.isEmpty()) {
+ newLibraries.addAll(toAdd);
+ } else {
+ Object element= selection.getFirstElement();
+ LibraryStandin firstLib= (LibraryStandin) element;
+ int index = newLibraries.indexOf(firstLib);
+ newLibraries.addAll(index, toAdd);
+ }
+ fLibraries= (LibraryStandin[]) newLibraries.toArray(new LibraryStandin[newLibraries.size()]);
+ fViewer.refresh();
+ fViewer.setSelection(new StructuredSelection(libs), true);
+ }
+
+ /**
+ * Returns the standin libraries being edited.
+ *
+ * @return standins
+ */
+ LibraryStandin[] getStandins() {
+ return fLibraries;
+ }
+
+}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryLabelProvider.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2006 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.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.rubypeople.rdt.internal.debug.ui.RDTImageDescriptor;
+import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
+import org.rubypeople.rdt.ui.ISharedImages;
+import org.rubypeople.rdt.ui.RubyUI;
+
+/**
+ * Label provider for Ruby vM libraries.
+ *
+ * @since 0.9.0
+ */
+public class LibraryLabelProvider extends LabelProvider {
+
+ public Image getImage(Object element) {
+ if (element instanceof LibraryStandin) {
+ LibraryStandin library= (LibraryStandin) element;
+ String key = ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE;
+ IStatus status = library.validate();
+ if (!status.isOK()) {
+ ImageDescriptor base = RubyUI.getSharedImages().getImageDescriptor(key);
+ RDTImageDescriptor descriptor= new RDTImageDescriptor(base, RDTImageDescriptor.IS_OUT_OF_SYNCH);
+ return RdtDebugUiPlugin.getImageDescriptorRegistry().get(descriptor);
+ }
+ return RubyUI.getSharedImages().getImage(key);
+ }
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof LibraryStandin) {
+ return ((LibraryStandin)element).getSystemLibraryPath().toOSString();
+ }
+ return null;
+ }
+
+}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryStandin.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryStandin.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryStandin.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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 java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.rubypeople.rdt.debug.ui.RdtDebugUiConstants;
+import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
+
+
+/**
+ * Wrapper for an original library location, to support editing.
+ *
+ */
+public final class LibraryStandin {
+ private IPath fSystemLibrary;
+
+ /**
+ * Creates a new library standin on the given library location.
+ */
+ public LibraryStandin(IPath path) {
+ fSystemLibrary= path;
+ }
+
+ /**
+ * Returns the JRE library jar location.
+ *
+ * @return The JRE library jar location.
+ */
+ public IPath getSystemLibraryPath() {
+ return fSystemLibrary;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if (obj instanceof LibraryStandin) {
+ LibraryStandin lib = (LibraryStandin)obj;
+ return getSystemLibraryPath().equals(lib.getSystemLibraryPath());
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return getSystemLibraryPath().hashCode();
+ }
+
+ /**
+ * Returns whether the given paths are equal - either may be <code>null</code>.
+ * @param path1 path to be compared
+ * @param path2 path to be compared
+ * @return whether the given paths are equal
+ */
+ protected boolean equals(IPath path1, IPath path2) {
+ return equalsOrNull(path1, path2);
+ }
+
+ /**
+ * Returns whether the given objects are equal - either may be <code>null</code>.
+ * @param o1 object to be compared
+ * @param o2 object to be compared
+ * @return whether the given objects are equal or both null
+ * @since 3.1
+ */
+ private boolean equalsOrNull(Object o1, Object o2) {
+ if (o1 == null) {
+ return o2 == null;
+ }
+ if (o2 == null) {
+ return false;
+ }
+ return o1.equals(o2);
+ }
+
+ /**
+ * Returns an equivalent library location.
+ *
+ * @return library location
+ */
+ IPath toLibraryLocation() {
+ return getSystemLibraryPath();
+ }
+
+ /**
+ * Returns a status for this library describing any error states
+ *
+ * @return
+ */
+ IStatus validate() {
+ if (!getSystemLibraryPath().toFile().exists()) {
+ return new Status(IStatus.ERROR, RdtDebugUiPlugin.getUniqueIdentifier(), RdtDebugUiConstants.INTERNAL_ERROR,
+ MessageFormat.format(RubyVMMessages.LibraryStandin_0, new String[]{getSystemLibraryPath().toOSString()}), null);
+ }
+ return Status.OK_STATUS;
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java 2007-01-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -21,6 +21,15 @@
public static String JREsUpdater_0;
public static String addVMDialog_pickJRERootDialog_message;
+ public static String VMLibraryBlock_7;
+ public static String VMLibraryBlock_6;
+ public static String VMLibraryBlock_4;
+ public static String VMLibraryBlock_5;
+ public static String VMLibraryBlock_9;
+ public static String VMLibraryBlock_Libraries_cannot_be_empty__1;
+ public static String VMLibraryBlock_10;
+ public static String LibraryStandin_0;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, RubyVMMessages.class);
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/RubyVMMessages.properties 2007-01-21 18:35:37 UTC (rev 1834)
@@ -16,4 +16,12 @@
InstalledJREsBlock_7=Add RubyVM
InstalledJREsBlock_8=Edit RubyVM
-JREsUpdater_0=Save VM Definitions
\ No newline at end of file
+JREsUpdater_0=Save VM Definitions
+
+VMLibraryBlock_4=U&p
+VMLibraryBlock_5=&Down
+VMLibraryBlock_6=Re&move
+VMLibraryBlock_7=Add E&xternal Folders...
+VMLibraryBlock_9=&Restore Default
+
+LibraryStandin_0=System library does not exist: {0}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/VMLibraryBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/VMLibraryBlock.java (rev 0)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/VMLibraryBlock.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 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 java.io.File;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Label;
+import org.rubypeople.rdt.debug.ui.RdtDebugUiConstants;
+import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallType;
+import org.rubypeople.rdt.launching.RubyRuntime;
+
+/**
+ * Control used to edit the libraries associated with a VM install
+ */
+public class VMLibraryBlock implements SelectionListener, ISelectionChangedListener {
+
+ /**
+ * Attribute name for the last path used to open a file/directory chooser
+ * dialog.
+ */
+ protected static final String LAST_PATH_SETTING = "LAST_PATH_SETTING"; //$NON-NLS-1$
+
+ /**
+ * the prefix for dialog setting pertaining to this block
+ */
+ protected static final String DIALOG_SETTINGS_PREFIX = "VMLibraryBlock"; //$NON-NLS-1$
+
+ protected boolean fInCallback = false;
+ protected IVMInstall fVmInstall;
+ protected IVMInstallType fVmInstallType;
+ protected File fHome;
+
+ //widgets
+ protected LibraryContentProvider fLibraryContentProvider;
+ protected AddVMDialog fDialog = null;
+ protected TreeViewer fLibraryViewer;
+ private Button fUpButton;
+ private Button fDownButton;
+ private Button fRemoveButton;
+ private Button fAddButton;
+ protected Button fDefaultButton;
+
+ /**
+ * Constructor for VMLibraryBlock.
+ */
+ public VMLibraryBlock(AddVMDialog dialog) {
+ fDialog = dialog;
+ }
+
+ /**
+ * Creates and returns the source lookup control.
+ *
+ * @param parent the parent widget of this control
+ */
+ public Control createControl(Composite parent) {
+ Font font = parent.getFont();
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ GridLayout topLayout = new GridLayout();
+ topLayout.numColumns = 2;
+ topLayout.marginHeight = 0;
+ topLayout.marginWidth = 0;
+ comp.setLayout(topLayout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ comp.setLayoutData(gd);
+
+ fLibraryViewer= new TreeViewer(comp);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 6;
+ fLibraryViewer.getControl().setLayoutData(gd);
+ fLibraryContentProvider= new LibraryContentProvider();
+ fLibraryViewer.setContentProvider(fLibraryContentProvider);
+ fLibraryViewer.setLabelProvider(new LibraryLabelProvider());
+ fLibraryViewer.setInput(this);
+ fLibraryViewer.addSelectionChangedListener(this);
+
+ Composite pathButtonComp = new Composite(comp, SWT.NONE);
+ GridLayout pathButtonLayout = new GridLayout();
+ pathButtonLayout.marginHeight = 0;
+ pathButtonLayout.marginWidth = 0;
+ pathButtonComp.setLayout(pathButtonLayout);
+ gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
+ pathButtonComp.setLayoutData(gd);
+ pathButtonComp.setFont(font);
+
+ fAddButton= createPushButton(pathButtonComp, RubyVMMessages.VMLibraryBlock_7);
+ fAddButton.addSelectionListener(this);
+
+ fRemoveButton= createPushButton(pathButtonComp, RubyVMMessages.VMLibraryBlock_6);
+ fRemoveButton.addSelectionListener(this);
+
+ fUpButton= createPushButton(pathButtonComp, RubyVMMessages.VMLibraryBlock_4);
+ fUpButton.addSelectionListener(this);
+
+ fDownButton= createPushButton(pathButtonComp, RubyVMMessages.VMLibraryBlock_5);
+ fDownButton.addSelectionListener(this);
+
+ fDefaultButton= createPushButton(pathButtonComp, RubyVMMessages.VMLibraryBlock_9);
+ fDefaultButton.addSelectionListener(this);
+
+ return comp;
+ }
+
+ /**
+ * The "default" button has been toggled
+ */
+ public void restoreDefaultLibraries() {
+ IPath[] libs = null;
+ File installLocation = getHomeDirectory();
+ if (installLocation == null) {
+ libs = new IPath[0];
+ } else {
+ libs = getVMInstallType().getDefaultLibraryLocations(installLocation);
+ }
+ fLibraryContentProvider.setLibraries(libs);
+ update();
+ }
+
+ /**
+ * Creates and returns a button
+ *
+ * @param parent parent widget
+ * @param label label
+ * @return Button
+ */
+ protected Button createPushButton(Composite parent, String label) {
+ Button button = new Button(parent, SWT.PUSH);
+ button.setFont(parent.getFont());
+ button.setText(label);
+ fDialog.setButtonLayoutData(button);
+ return button;
+ }
+
+ /**
+ * Create some empty space
+ */
+ protected void createVerticalSpacer(Composite comp, int colSpan) {
+ Label label = new Label(comp, SWT.NONE);
+ GridData gd = new GridData();
+ gd.horizontalSpan = colSpan;
+ label.setLayoutData(gd);
+ }
+
+ /**
+ * Initializes this control based on the settings in the given
+ * vm install and type.
+ *
+ * @param vm vm or <code>null</code> if none
+ * @param type type of vm install
+ */
+ public void initializeFrom(IVMInstall vm, IVMInstallType type) {
+ fVmInstall = vm;
+ fVmInstallType = type;
+ if (vm != null) {
+ setHomeDirectory(vm.getInstallLocation());
+ fLibraryContentProvider.setLibraries(RubyRuntime.getLibraryLocations(getVMInstall()));
+ }
+ update();
+ }
+
+ /**
+ * Sets the home directory of the VM Install the user has chosen
+ */
+ public void setHomeDirectory(File file) {
+ fHome = file;
+ }
+
+ /**
+ * Returns the home directory
+ */
+ protected File getHomeDirectory() {
+ return fHome;
+ }
+
+ /**
+ * Updates buttons and status based on current libraries
+ */
+ public void update() {
+ updateButtons();
+ IStatus status = Status.OK_STATUS;
+ if (fLibraryContentProvider.getLibraries().length == 0) { // && !isDefaultSystemLibrary()) {
+ status = new Status(IStatus.ERROR, RdtDebugUiPlugin.getUniqueIdentifier(), RdtDebugUiConstants.INTERNAL_ERROR,
+ RubyVMMessages.VMLibraryBlock_Libraries_cannot_be_empty__1, null);
+ }
+ LibraryStandin[] standins = fLibraryContentProvider.getStandins();
+ for (int i = 0; i < standins.length; i++) {
+ IStatus st = standins[i].validate();
+ if (!st.isOK()) {
+ status = st;
+ break;
+ }
+ }
+ fDialog.setSystemLibraryStatus(status);
+ fDialog.updateStatusLine();
+ }
+
+ /**
+ * Saves settings in the given working copy
+ */
+ public void performApply(IVMInstall vm) {
+ if (isDefaultLocations()) {
+ vm.setLibraryLocations(null);
+ } else {
+ IPath[] libs = fLibraryContentProvider.getLibraries();
+ vm.setLibraryLocations(libs);
+ }
+ }
+
+ /**
+ * Determines if the present setup is the default location s for this JRE
+ * @return true if the current set of locations are the defaults, false otherwise
+ */
+ protected boolean isDefaultLocations() {
+ IPath[] libraryLocations = fLibraryContentProvider.getLibraries();
+ IVMInstall install = getVMInstall();
+
+ if (install == null || libraryLocations == null) {
+ return true;
+ }
+ File installLocation = install.getInstallLocation();
+ if (installLocation != null) {
+ IPath[] def = getVMInstallType().getDefaultLibraryLocations(installLocation);
+ if (def.length == libraryLocations.length) {
+ for (int i = 0; i < def.length; i++) {
+ if (!def[i].equals(libraryLocations[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the vm install associated with this library block.
+ *
+ * @return vm install
+ */
+ protected IVMInstall getVMInstall() {
+ return fVmInstall;
+ }
+
+ /**
+ * Returns the vm install type associated with this library block.
+ *
+ * @return vm install
+ */
+ protected IVMInstallType getVMInstallType() {
+ return fVmInstallType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ Object source= e.getSource();
+ if (source == fUpButton) {
+ fLibraryContentProvider.up((IStructuredSelection) fLibraryViewer.getSelection());
+ } else if (source == fDownButton) {
+ fLibraryContentProvider.down((IStructuredSelection) fLibraryViewer.getSelection());
+ } else if (source == fRemoveButton) {
+ fLibraryContentProvider.remove((IStructuredSelection) fLibraryViewer.getSelection());
+ } else if (source == fAddButton) {
+ add((IStructuredSelection) fLibraryViewer.getSelection());
+ }
+ else if (source == fDefaultButton) {
+ restoreDefaultLibraries();
+ }
+ update();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ /**
+ * Open the file selection dialog, and add the return jars as libraries.
+ */
+ private void add(IStructuredSelection selection) {
+ IDialogSettings dialogSettings= RdtDebugUiPlugin.getDefault().getDialogSettings();
+ String lastUsedPath= dialogSettings.get(LAST_PATH_SETTING);
+ if (lastUsedPath == null) {
+ lastUsedPath= ""; //$NON-NLS-1$
+ }
+ DirectoryDialog dialog= new DirectoryDialog(fLibraryViewer.getControl().getShell(), SWT.MULTI);
+ dialog.setText(RubyVMMessages.VMLibraryBlock_10);
+ dialog.setFilterPath(lastUsedPath);
+ String res= dialog.open();
+ if (res == null) {
+ return;
+ }
+ String dirName = dialog.getText();
+
+
+ IPath filterPath= new Path(dialog.getFilterPath());
+ IPath[] libs= new IPath[1];
+ libs[0]= filterPath.append(dirName).makeAbsolute();
+
+ dialogSettings.put(LAST_PATH_SETTING, filterPath.toOSString());
+
+ fLibraryContentProvider.add(libs, selection);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateButtons();
+ }
+
+ /**
+ * Refresh the enable/disable state for the buttons.
+ */
+ private void updateButtons() {
+ IStructuredSelection selection = (IStructuredSelection) fLibraryViewer.getSelection();
+ fRemoveButton.setEnabled(!selection.isEmpty());
+ boolean enableUp = true,
+ enableDown = true,
+ allRoots = true;
+ Object[] libraries = fLibraryContentProvider.getElements(null);
+ if (selection.isEmpty() || libraries.length == 0) {
+ enableUp = false;
+ enableDown = false;
+ } else {
+ Object first = libraries[0];
+ Object last = libraries[libraries.length - 1];
+ for (Iterator iter= selection.iterator(); iter.hasNext();) {
+ Object element= iter.next();
+ Object lib = element;
+ if (lib == first) {
+ enableUp = false;
+ }
+ if (lib == last) {
+ enableDown = false;
+ }
+ }
+ }
+ fUpButton.setEnabled(enableUp);
+ fDownButton.setEnabled(enableDown);
+ }
+}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -7,9 +7,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.service.environment.Constants;
import org.rubypeople.rdt.launching.AbstractVMInstallType;
import org.rubypeople.rdt.launching.IVMInstall;
@@ -40,14 +38,11 @@
}
public IPath[] getDefaultLibraryLocations(File installLocation) {
- File rubyExecutable = findRubyExecutable(installLocation);
- // FIXME This is a big hack and is tailored to the one click installer on windows!
- String rubyPath = rubyExecutable.getParentFile().getAbsolutePath();
- String stdPath = rubyPath + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "1.8";
- String sitePath = rubyPath + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "site_ruby";
+ String stdPath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "1.8";
+ String sitePath = installLocation.getAbsolutePath() + fgSeparator + "lib" + fgSeparator + "ruby" + fgSeparator + "site_ruby" + fgSeparator + "1.8";
IPath[] paths = new IPath[2];
paths[0] = new Path(stdPath);
- paths[0] = new Path(sitePath);
+ paths[1] = new Path(sitePath);
return paths;
}
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-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -699,7 +699,7 @@
IPath[] libraryPaths = new IPath[dflts.length];
for (int i = 0; i < dflts.length; i++) {
libraryPaths[i]= dflts[i];
- if (!libraryPaths[i].toFile().isFile()) {
+ if (!libraryPaths[i].toFile().isDirectory()) {
libraryPaths[i]= Path.EMPTY;
}
}
Added: trunk/org.rubypeople.rdt.ui/icons/full/obj16/jar_lsrc_obj.gif
===================================================================
(Binary files differ)
Property changes on: trunk/org.rubypeople.rdt.ui/icons/full/obj16/jar_lsrc_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-20 22:54:05 UTC (rev 1833)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPluginImages.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -1,7 +1,8 @@
package org.rubypeople.rdt.internal.ui;
-import java.net.MalformedURLException;
import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
@@ -16,15 +17,12 @@
protected static final String NAME_PREFIX = "org.rubypeople.rdt.ui.";
protected static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
- protected static URL iconBaseURL;
-
- static {
- iconBaseURL= RubyPlugin.getDefault().getBundle().getEntry("/icons/full/"); //$NON-NLS-1$
- }
public static final IPath ICONS_PATH= new Path("$nl$/icons/full"); //$NON-NLS-1$
- private static final ImageRegistry IMAGE_REGISTRY = new ImageRegistry();
+ // The plug-in registry
+ private static ImageRegistry fgImageRegistry= null;
+ private static HashMap fgAvoidSWTErrorMap= null;
private static final String T_OBJ = "obj16"; //$NON-NLS-1$
private static final String T_OVR= "ovr16"; //$NON-NLS-1$
@@ -40,6 +38,8 @@
public static final String IMG_MISC_PROTECTED= NAME_PREFIX + "methpro_obj.gif"; //$NON-NLS-1$
public static final String IMG_MISC_PRIVATE= NAME_PREFIX + "methpri_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_EXTJAR_WSRC= NAME_PREFIX + "jar_lsrc_obj.gif"; //$NON-NLS-1$
+
public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif";
public static final String IMG_OBJS_WARNING = NAME_PREFIX + "warning_obj.gif";
public static final String IMG_OBJS_INFO = NAME_PREFIX + "info_obj.gif";
@@ -87,8 +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_OBJS_LIBRARY= createManagedFromKey(T_OBJ, IMG_OBJS_LIBRARY);
+ public static final ImageDescriptor DESC_OBJS_EXTJAR_WSRC= createManagedFromKey(T_OBJ, IMG_OBJS_EXTJAR_WSRC);
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$
@@ -107,59 +107,59 @@
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$
- public static final ImageDescriptor DESC_OBJS_GHOST= createManaged(T_OBJ, IMG_OBJS_GHOST);
- public static final ImageDescriptor DESC_OBJS_IMPDECL= createManaged(T_OBJ, IMG_CTOOLS_RUBY_IMPORT);
- public static final ImageDescriptor DESC_OBJS_IMPCONT= createManaged(T_OBJ, IMG_CTOOLS_RUBY_IMPORT_CONTAINER);
+ public static final ImageDescriptor DESC_OBJS_GHOST= createManagedFromKey(T_OBJ, IMG_OBJS_GHOST);
+ public static final ImageDescriptor DESC_OBJS_IMPDECL= createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_IMPORT);
+ public static final ImageDescriptor DESC_OBJS_IMPCONT= createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_IMPORT_CONTAINER);
- public static final ImageDescriptor DESC_OBJS_RUBY_MODEL= createManaged(T_OBJ, IMG_OBJS_RUBY_MODEL);
- public static final ImageDescriptor DESC_OBJS_SOURCE_FOLDER= createManaged(T_OBJ, IMG_OBJS_SOURCE_FOLDER);
- public static final ImageDescriptor DESC_OBJS_LOCAL_VAR = createManaged(T_OBJ, IMG_CTOOLS_RUBY_LOCAL_VAR);
- public static final ImageDescriptor DESC_OBJS_GLOBAL = createManaged(T_OBJ, IMG_CTOOLS_RUBY_GLOBAL);
- public static final ImageDescriptor DESC_OBJS_MODULE = createManaged(T_OBJ, IMG_OBJS_MODULE);
- public static final ImageDescriptor DESC_OBJS_CLASS_VAR = createManaged(T_OBJ, IMG_CTOOLS_RUBY_CLASS_VAR);
- public static final ImageDescriptor DESC_OBJS_INSTANCE_VAR = createManaged(T_OBJ, IMG_CTOOLS_RUBY_INSTANCE_VAR);
- public static final ImageDescriptor DESC_OBJS_CONSTANT = createManaged(T_OBJ, IMG_CTOOLS_RUBY_CONSTANT);
+ public static final ImageDescriptor DESC_OBJS_RUBY_MODEL= createManagedFromKey(T_OBJ, IMG_OBJS_RUBY_MODEL);
+ public static final ImageDescriptor DESC_OBJS_SOURCE_FOLDER= createManagedFromKey(T_OBJ, IMG_OBJS_SOURCE_FOLDER);
+ public static final ImageDescriptor DESC_OBJS_LOCAL_VAR = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_LOCAL_VAR);
+ public static final ImageDescriptor DESC_OBJS_GLOBAL = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_GLOBAL);
+ public static final ImageDescriptor DESC_OBJS_MODULE = createManagedFromKey(T_OBJ, IMG_OBJS_MODULE);
+ public static final ImageDescriptor DESC_OBJS_CLASS_VAR = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_CLASS_VAR);
+ public static final ImageDescriptor DESC_OBJS_INSTANCE_VAR = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_INSTANCE_VAR);
+ public static final ImageDescriptor DESC_OBJS_CONSTANT = createManagedFromKey(T_OBJ, IMG_CTOOLS_RUBY_CONSTANT);
- public static final ImageDescriptor DESC_OBJS_CLASS= createManaged(T_OBJ, IMG_OBJS_CLASS);
- public static final ImageDescriptor DESC_OBJS_CLASSALT= createManaged(T_OBJ, IMG_OBJS_CLASSALT);
- public static final ImageDescriptor DESC_OBJS_INNER_CLASS= createManaged(T_OBJ, IMG_OBJS_INNER_CLASS);
- public static final ImageDescriptor DESC_OBJS_MODULEALT = createManaged(T_OBJ, IMG_OBJS_MODULEALT);
+ public static final ImageDescriptor DESC_OBJS_CLASS= createManagedFromKey(T_OBJ, IMG_OBJS_CLASS);
+ public static final ImageDescriptor DESC_OBJS_CLASSALT= createManagedFromKey(T_OBJ, IMG_OBJS_CLASSALT);
+ public static final ImageDescriptor DESC_OBJS_INNER_CLASS= createManagedFromKey(T_OBJ, IMG_OBJS_INNER_CLASS);
+ public static final ImageDescriptor DESC_OBJS_MODULEALT = createManagedFromKey(T_OBJ, IMG_OBJS_MODULEALT);
- public static final ImageDescriptor DESC_OBJS_SCRIPT= createManaged(T_OBJ, IMG_OBJS_SCRIPT);
- public static final ImageDescriptor DESC_OBJS_RUBY_RESOURCE= createManaged(T_OBJ, IMG_OBJS_RUBY_RESOURCE);
+ public static final ImageDescriptor DESC_OBJS_SCRIPT= createManagedFromKey(T_OBJ, IMG_OBJS_SCRIPT);
+ public static final ImageDescriptor DESC_OBJS_RUBY_RESOURCE= createManagedFromKey(T_OBJ, IMG_OBJS_RUBY_RESOURCE);
- public static final ImageDescriptor DESC_MISC_PUBLIC= createManaged(T_OBJ, IMG_MISC_PUBLIC);
- public static final ImageDescriptor DESC_MISC_PROTECTED= createManaged(T_OBJ, IMG_MISC_PROTECTED);
- public static final ImageDescriptor DESC_MISC_PRIVATE= createManaged(T_OBJ, IMG_MISC_PRIVATE);
+ public static final ImageDescriptor DESC_MISC_PUBLIC= createManagedFromKey(T_OBJ, IMG_MISC_PUBLIC);
+ public static final ImageDescriptor DESC_MISC_PROTECTED= createManagedFromKey(T_OBJ, IMG_MISC_PROTECTED);
+ public static final ImageDescriptor DESC_MISC_PRIVATE= createManagedFromKey(T_OBJ, IMG_MISC_PRIVATE);
- public static final ImageDescriptor DESC_OBJS_UNKNOWN= createManaged(T_OBJ, IMG_OBJS_UNKNOWN);
+ public static final ImageDescriptor DESC_OBJS_UNKNOWN= createManagedFromKey(T_OBJ, IMG_OBJS_UNKNOWN);
static {
- createManaged(T_OBJ, IMG_OBJS_FIXABLE_ERROR);
- createManaged(T_OBJ, IMG_OBJS_FIXABLE_PROBLEM);
- createManaged(T_OBJ, IMG_OBJS_ERROR);
- createManaged(T_OBJ, IMG_OBJS_WARNING);
- createManaged(T_OBJ, IMG_OBJS_INFO);
- createManaged(T_OBJ, IMG_OBJS_TEMPLATE);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_IMPORT_CONTAINER);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_IMPORT);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_PAGE);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_GLOBAL);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_CLASS);
- createManaged(T_CTOOL, IMG_OBJS_MODULE);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_METHOD);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBYMETHOD_PRO);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBYMETHOD_PUB);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_SINGLETONMETHOD );
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_SINGLETONMETHOD_PUB );
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_SINGLETONMETHOD_PRO );
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_CLASS_VAR);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_CONSTANT);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_LOCAL_VAR);
- createManaged(T_CTOOL, IMG_CTOOLS_RUBY_INSTANCE_VAR);
+ createManagedFromKey(T_OBJ, IMG_OBJS_FIXABLE_ERROR);
+ createManagedFromKey(T_OBJ, IMG_OBJS_FIXABLE_PROBLEM);
+ createManagedFromKey(T_OBJ, IMG_OBJS_ERROR);
+ createManagedFromKey(T_OBJ, IMG_OBJS_WARNING);
+ createManagedFromKey(T_OBJ, IMG_OBJS_INFO);
+ createManagedFromKey(T_OBJ, IMG_OBJS_TEMPLATE);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_IMPORT_CONTAINER);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_IMPORT);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_PAGE);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_GLOBAL);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_CLASS);
+ createManagedFromKey(T_CTOOL, IMG_OBJS_MODULE);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_METHOD);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBYMETHOD_PRO);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBYMETHOD_PUB);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_SINGLETONMETHOD );
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_SINGLETONMETHOD_PUB );
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_SINGLETONMETHOD_PRO );
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_CLASS_VAR);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_CONSTANT);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_LOCAL_VAR);
+ createManagedFromKey(T_CTOOL, IMG_CTOOLS_RUBY_INSTANCE_VAR);
}
@@ -168,9 +168,9 @@
*
* @param key the image's key
* @return the image managed under the given key
- */
+ */
public static Image get(String key) {
- return IMAGE_REGISTRY.get(key);
+ return getImageRegistry().get(key);
}
/**
@@ -188,55 +188,77 @@
public static void setLocalImageDescriptors(IAction action, String iconName) {
setImageDescriptors(action, "lcl16", iconName);
}
-
- public static ImageRegistry getImageRegistry() {
- return IMAGE_REGISTRY;
+
+ /*
+ * Helper method to access the image registry from the JavaPlugin class.
+ */
+ /* package */ static ImageRegistry getImageRegistry() {
+ if (fgImageRegistry == null) {
+ fgImageRegistry= new ImageRegistry();
+ for (Iterator iter= fgAvoidSWTErrorMap.keySet().iterator(); iter.hasNext();) {
+ String key= (String) iter.next();
+ fgImageRegistry.put(key, (ImageDescriptor) fgAvoidSWTErrorMap.get(key));
+ }
+ fgAvoidSWTErrorMap= null;
+ }
+ return fgImageRegistry;
}
+
+ private static ImageDescriptor createManagedFromKey(String prefix, String key) {
+ return createManaged(prefix, key.substring(NAME_PREFIX_LENGTH), key);
+ }
//---- Helper methods to access icons on the file system --------------------------------------
- protected static void setImageDescriptors(IAction action, String type, String relPath) {
-
- try {
- ImageDescriptor id = ImageDescriptor.createFromURL(makeIconFileURL("d" + type, relPath));
- if (id != null)
- action.setDisabledImageDescriptor(id);
- } catch (MalformedURLException e) {}
-
- // we don't use hover images. If we set it nonetheless it would be preferred to the "normal" image descriptor
- // see ActionContributionItem.updateImages
- // ImageDescriptor.createFromURL(makeIconFileURL("c" + type, relPath));
-
- action.setImageDescriptor(createUnManaged("e" + type, relPath));
+ private static void setImageDescriptors(IAction action, String type, String relPath) {
+ ImageDescriptor id= create("d" + type, relPath, false); //$NON-NLS-1$
+ if (id != null)
+ action.setDisabledImageDescriptor(id);
+
+ /*
+ * id= create("c" + type, relPath, false); //$NON-NLS-1$
+ * if (id != null)
+ * action.setHoverImageDescriptor(id);
+ */
+
+ ImageDescriptor descriptor= create("e" + type, relPath, true); //$NON-NLS-1$
+ action.setHoverImageDescriptor(descriptor);
+ action.setImageDescriptor(descriptor);
}
-
- protected static ImageDescriptor createManaged(String prefix, String name) {
- try {
- ImageDescriptor result = ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
- IMAGE_REGISTRY.put(name, result);
- return result;
- } catch (MalformedURLException e) {
- return ImageDescriptor.getMissingImageDescriptor();
+
+ private static ImageDescriptor createManaged(String prefix, String name, String key) {
+ ImageDescriptor result= create(prefix, name, true);
+
+ if (fgAvoidSWTErrorMap == null) {
+ fgAvoidSWTErrorMap= new HashMap();
}
- }
-
- protected static ImageDescriptor createUnManaged(String prefix, String name) {
- try {
- return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
- } catch (MalformedURLException e) {
- return ImageDescriptor.getMissingImageDescriptor();
+ fgAvoidSWTErrorMap.put(key, result);
+ if (fgImageRegistry != null) {
+ RubyPlugin.logErrorMessage("Image registry already defined"); //$NON-NLS-1$
}
+ return result;
}
-
- protected static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
- if (iconBaseURL == null)
- throw new MalformedURLException();
-
- StringBuffer buffer = new StringBuffer(prefix);
- buffer.append('/');
- buffer.append(name);
- return new URL(iconBaseURL, buffer.toString());
+
+ /*
+ * Creates an image descriptor for the given prefix and name in the JDT UI bundle. The path can
+ * contain variables like $NL$.
+ * If no image could be found, <code>useMissingImageDescriptor</code> decides if either
+ * the 'missing image descriptor' is returned or <code>null</code>.
+ * or <code>null</code>.
+ */
+ private static ImageDescriptor create(String prefix, String name, boolean useMissingImageDescriptor) {
+ IPath path= ICONS_PATH.append(prefix).append(name);
+ return createImageDescriptor(RubyPlugin.getDefault().getBundle(), path, useMissingImageDescriptor);
}
+
+ /*
+ * Creates an image descriptor for the given prefix and name in the JDT UI bundle. The path can
+ * contain variables like $NL$.
+ * If no image could be found, the 'missing image descriptor' is returned.
+ */
+ private static ImageDescriptor createUnManaged(String prefix, String name) {
+ return create(prefix, name, true);
+ }
/*
* Creates an image descriptor for the given path in a bundle. The path can contain variables
@@ -255,4 +277,17 @@
}
return null;
}
+
+ /**
+ * Returns the image descriptor for the given key in this registry. Might be called in a non-UI thread.
+ *
+ * @param key the image's key
+ * @return the image descriptor for the given key
+ */
+ public static ImageDescriptor getDescriptor(String key) {
+ if (fgImageRegistry == null) {
+ return (ImageDescriptor) fgAvoidSWTErrorMap.get(key);
+ }
+ return getImageRegistry().getDescriptor(key);
+ }
}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/SharedImages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/SharedImages.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/SharedImages.java 2007-01-21 18:35:37 UTC (rev 1834)
@@ -0,0 +1,23 @@
+package org.rubypeople.rdt.internal.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.rubypeople.rdt.ui.ISharedImages;
+
+public class SharedImages implements ISharedImages {
+ public SharedImages() {}
+
+ /*
+ * (Non-Javadoc) Method declared in ISharedImages
+ */
+ public Image getImage(String key) {
+ return RubyPluginImages.get(key);
+ }
+
+ /*
+ * (Non-Javadoc) Method declared in ISharedImages
+ */
+ public ImageDescriptor getImageDescriptor(String key) {
+ return RubyPluginImages.getDescriptor(key);
+ }
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/ISharedImages.java
===================================================================
---...
[truncated message content] |
|
From: <caw...@us...> - 2007-01-20 22:54:08
|
Revision: 1833
http://svn.sourceforge.net/rubyeclipse/?rev=1833&view=rev
Author: cawilliams
Date: 2007-01-20 14:54:05 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
fix static call...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
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-20 22:53:20 UTC (rev 1832)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-01-20 22:54:05 UTC (rev 1833)
@@ -126,7 +126,7 @@
}
protected ILaunchConfiguration createConfiguration(IFile rubyFile, String container, String testName) {
- if (RubyRuntime.getDefault().getDefaultVMInstall() == null) {
+ if (RubyRuntime.getDefaultVMInstall() == null) {
showNoInterpreterDialog();
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-20 22:53:23
|
Revision: 1832
http://svn.sourceforge.net/rubyeclipse/?rev=1832&view=rev
Author: cawilliams
Date: 2007-01-20 14:53:20 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
hey look at that! The Test::Unit launcher stuff works again. I should probably clean it up a bunch more...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java 2007-01-20 22:15:24 UTC (rev 1831)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java 2007-01-20 22:53:20 UTC (rev 1832)
@@ -1,5 +1,13 @@
package org.rubypeople.rdt.testunit.launcher;
+import java.io.File;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.SocketUtil;
import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
import org.rubypeople.rdt.launching.RubyLaunchDelegate;
@@ -18,9 +26,44 @@
public static final String LAUNCH_CONTAINER_ATTR = TestunitPlugin.PLUGIN_ID + ".CONTAINER"; //$NON-NLS-1$
public static final String ID_TESTUNIT_APPLICATION = "org.rubypeople.rdt.testunit.launchconfig"; //$NON-NLS-1$
+
+ private int port = -1;
- public TestUnitLaunchConfigurationDelegate() {
- super();
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ launch.setAttribute(TestunitPlugin.TESTUNIT_PORT_ATTR, Integer.toString(getPort()));
+ super.launch(configuration, mode, launch, monitor);
}
-// FIXME This won't work anymore!
+
+ public static String getTestRunnerPath() {
+ String directory = RubyCore.getOSDirectory(TestunitPlugin.getDefault());
+ File pluginDirFile = new File(directory, "ruby");
+
+ if (!pluginDirFile.exists())
+ throw new RuntimeException("Expected directory of RemoteTestRunner.rb does not exist: " + pluginDirFile.getAbsolutePath());
+
+ return pluginDirFile.getAbsolutePath() + File.separator + TestUnitLaunchShortcut.TEST_RUNNER_FILE;
+ }
+
+ private int getPort() {
+ if (port == -1) {
+ port = SocketUtil.findFreePort();
+ }
+ return port;
+ }
+
+ @Override
+ public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, ""));
+ buffer.append(' ');
+ buffer.append(Integer.toString(getPort()));
+ buffer.append(' ');
+ buffer.append(Boolean.toString(false));
+ buffer.append(' ');
+ buffer.append(configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""));
+ buffer.append(' ');
+ buffer.append(configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, ""));
+ return buffer.toString();
+ }
}
\ No newline at end of file
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-20 22:15:24 UTC (rev 1831)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-01-20 22:53:20 UTC (rev 1832)
@@ -46,7 +46,6 @@
* @param rubyElement
*/
protected void doLaunch(IRubyElement rubyElement, String mode) throws CoreException {
-
String container = getContainer(rubyElement);
ILaunchConfiguration config = findOrCreateLaunchConfiguration(rubyElement, mode, container, "", "");
if (config != null) {
@@ -58,10 +57,10 @@
protected ILaunchConfiguration findOrCreateLaunchConfiguration(IRubyElement rubyElement, String mode, String container, String testClass, String testName) throws CoreException {
IFile rubyFile = (IFile) rubyElement.getUnderlyingResource();
ILaunchConfigurationType configType = getRubyLaunchConfigType();
- List candidateConfigs = null;
+ List<ILaunchConfiguration> candidateConfigs = null;
ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(configType);
- candidateConfigs = new ArrayList(configs.length);
+ candidateConfigs = new ArrayList<ILaunchConfiguration>(configs.length);
for (int i = 0; i < configs.length; i++) {
ILaunchConfiguration config = configs[i];
if ((config.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, "").equals(container))
@@ -137,9 +136,7 @@
ILaunchConfigurationType configType = getRubyLaunchConfigType();
ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(rubyFile.getName()));
wc.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, rubyFile.getProject().getName());
-
- // FIXME Probably shouldn't write this out. It's now ignored at runtime
- wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, TestUnitRunnerConfiguration.getTestRunnerPath());
+ wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, TestUnitLaunchConfigurationDelegate.getTestRunnerPath());
wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, TestUnitLaunchShortcut.getDefaultWorkingDirectory(rubyFile.getProject()));
wc.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, RubyRuntime.getCompositeIdFromVM(RubyRuntime.getDefaultVMInstall()));
wc.setAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, container);
Deleted: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java 2007-01-20 22:15:24 UTC (rev 1831)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java 2007-01-20 22:53:20 UTC (rev 1832)
@@ -1,108 +0,0 @@
-package org.rubypeople.rdt.testunit.launcher;
-
-import java.io.File;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.core.SocketUtil;
-import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
-import org.rubypeople.rdt.launching.VMRunnerConfiguration;
-
-public class TestUnitRunnerConfiguration extends VMRunnerConfiguration {
- private int port = -1 ;
- private ILaunchConfiguration configuration;
-
- public TestUnitRunnerConfiguration(ILaunchConfiguration aConfiguration) {
- super(getTestRunnerPath(), null);
- configuration = aConfiguration;
- }
-
- public String getAbsoluteFileName() {
- return new File(getFileName()).getAbsolutePath();
- }
-
- public String getFileName() {
- return getTestRunnerPath();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration#getAbsoluteFileDirectory()
- */
- public String getAbsoluteFileDirectory() {
- IPath path = new Path(this.getFileName());
- path = path.removeLastSegments(1);
- return path.toOSString();
- }
-
- public String getAbsoluteTestFileName() {
- String fileName = "";
- try {
- fileName = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, "");
- } catch (CoreException e) {}
-
- IPath path = new Path(fileName);
- path = path.removeLastSegments(1);
- return path.toOSString();
- }
-
- public int getPort() {
- // the port is needed render the command line for the ruby interpreter call
- // and in TestUnitPlugin::launchChanged in order to start the server on
- // the java side
- if (port == -1) {
- port = SocketUtil.findFreePort();
- }
- return port ;
- }
- /*
- * (non-Javadoc)
- *
- * @see org.rubypeople.rdt.launching.VMRunnerConfiguration#getProgramArguments()
- */
- public String[] getProgramArguments() {
- String fileName = "";
- String testClass = "";
- String testMethod = "";
- // FIXME Remove keepAlive on this end and remove looking for it on
- // RemoteTestRunner.rb
- boolean keepAlive = false;
- try {
- // Pull out the port and other unit testing variables
- // and convert them into command line args
- fileName = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, "");
- testClass = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, "");
- testMethod = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, "");
- } catch (CoreException e) {
- TestunitPlugin.log(e);
- throw new RuntimeException("Could not get necessary attributes from the launch configuration.") ;
- }
-
- return new String[] { fileName, Integer.toString(getPort()), Boolean.toString(keepAlive), testClass, testMethod};
- }
-
- public String[] getLoadPath() {
- String[] loadPath = super.getLoadPath();
- String[] newLoadPath = new String[loadPath.length + 1];
- for (int i = 0; i < loadPath.length; i++) {
- newLoadPath[i] = loadPath[i];
- }
- newLoadPath[loadPath.length] = getAbsoluteTestFileName();
- return newLoadPath;
- }
-
- public static String getTestRunnerPath() {
- String directory = RubyCore.getOSDirectory(TestunitPlugin.getDefault());
- File pluginDirFile = new File(directory, "ruby");
-
- if (!pluginDirFile.exists())
- throw new RuntimeException("Expected directory of RemoteTestRunner.rb does not exist: " + pluginDirFile.getAbsolutePath());
-
- return pluginDirFile.getAbsolutePath() + File.separator + TestUnitLaunchShortcut.TEST_RUNNER_FILE;
- }
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-20 22:15:25
|
Revision: 1831
http://svn.sourceforge.net/rubyeclipse/?rev=1831&view=rev
Author: cawilliams
Date: 2007-01-20 14:15:24 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
more translation strings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties 2007-01-20 22:07:49 UTC (rev 1830)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties 2007-01-20 22:15:24 UTC (rev 1831)
@@ -36,13 +36,11 @@
AbstractInterpreterInstall_3=Reading system properties
AbstractInterpreterInstall_4=Exception retrieving system properties
-
vmRunnerConfig_assert_classNotNull=classToLaunch cannot be null
vmRunnerConfig_assert_classPathNotNull=loadPath cannot be null
vmRunnerConfig_assert_programArgsNotNull=args cannot be null
vmRunnerConfig_assert_vmArgsNotNull=args cannot be null
-
StandardVMRunner__0____1___2={0} ({1})
StandardVMRunner__0__at_localhost__1__1={0} at localhost:{1}
StandardVMRunner_Specified_working_directory_does_not_exist_or_is_not_a_directory___0__3=Specified working directory does not exist or is not a directory: {0}
@@ -55,24 +53,26 @@
JavaLocalApplicationLaunchConfigurationDelegate_Verifying_launch_attributes____1=Verifying launch attributes...
JavaLocalApplicationLaunchConfigurationDelegate_Creating_source_locator____2=Creating source locator...
-AbstractJavaLaunchConfigurationDelegate_The_specified_JRE_installation_does_not_exist_4=
-AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_not_specified_for__0__5=
-AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_for__0__does_not_exist___1__6=
-JavaLocalApplicationLaunchConfigurationDelegate_0=
-JavaRuntime_Specified_VM_install_type_does_not_exist___0__2=
-JavaRuntime_Specified_VM_install_not_found__type__0___name__1__2=
-JavaRuntime_VM_not_fully_specified_in_launch_configuration__0____missing_VM_name__Reverting_to_default_VM__1=
-JavaRuntime_Launch_configuration__0__references_non_existing_project__1___1=
-AbstractJavaLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12=
-AbstractJavaLaunchConfigurationDelegate_Main_type_not_specified_11=
-RuntimeLoadpathEntry_Illegal_classpath_entry__0__1=
-RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry_type_2=
-RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry_location_3=
-RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_project_name_4=
-RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_archive_path_5=
-RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_variable_name_6=
-RuntimeLoadpathEntry_An_exception_occurred_generating_runtime_classpath_memento_8=
+AbstractJavaLaunchConfigurationDelegate_Main_type_not_specified_11=Main type not specified
+AbstractJavaLaunchConfigurationDelegate_The_specified_JRE_installation_does_not_exist_4=The specified JRE installation does not exist
+AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_not_specified_for__0__5=JRE home directory not specified for {0}
+AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_for__0__does_not_exist___1__6=JRE home directory for {0} does not exist: {1}
+AbstractJavaLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12=Working directory does not exist: {0}
+JavaLocalApplicationLaunchConfigurationDelegate_0=Ruby VM {0} does not support debug mode.
+JavaRuntime_Specified_VM_install_type_does_not_exist___0__2=Specified VM install type does not exist: {0}
+JavaRuntime_Specified_VM_install_not_found__type__0___name__1__2=Specified VM install not found: type {0}, name {1}
+JavaRuntime_VM_not_fully_specified_in_launch_configuration__0____missing_VM_name__Reverting_to_default_VM__1=VM not fully specified in launch configuration {0} - missing VM name. Reverting to default VM.
+JavaRuntime_Launch_configuration__0__references_non_existing_project__1___1=Launch configuration {0} references non-existing project {1}.
+
+RuntimeLoadpathEntry_Illegal_classpath_entry__0__1=Illegal loadpath entry {0}
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry_type_2=Unable to recover runtime loadpath entry type
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry_location_3=Unable to recover runtime loadpath entry location
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_project_name_4=Unable to recover runtime loadpath entry - missing project name
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_archive_path_5=Unable to recover runtime loadpath entry - missing archive path
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_variable_name_6=Unable to recover runtime loadpath entry - missing variable name
+RuntimeLoadpathEntry_An_exception_occurred_generating_runtime_classpath_memento_8=An exception occurred generating runtime loadpath memento
+
DefaultProjectLoadpathEntry_4={0} (default loadpath)
DefaultProjectLoadpathEntry_2={0} (default loadpath - exported entries only)
DefaultProjectLoadpathEntry_3==Invalid memento - expecting name attribute
@@ -82,11 +82,12 @@
JavaRuntime_31=Unable to restore classpath entry.
JavaRuntime_32=Unable to restore classpath entry.
-LaunchingPlugin_32=
-JavaRuntime_Classpath_references_non_existant_archive___0__4=
-JavaRuntime_Classpath_references_non_existant_project___0__3=
-JavaRuntime_Could_not_resolve_classpath_container___0__1=
+LaunchingPlugin_32=Unable to create runtime loadpath entry for unknown type {0}
+JavaRuntime_Could_not_resolve_classpath_container___0__1=Could not resolve loadpath container: {0}
+JavaRuntime_Classpath_references_non_existant_project___0__3=The project: {0} which is referenced by the loadpath, does not exist.
+JavaRuntime_Classpath_references_non_existant_archive___0__4=The archive: {0} which is referenced by the loadpath, does not exist.
+
StandardVMDebugger_Could_not_find_a_free_socket_for_the_debugger_1=Cannot find a free socket for the debugger
StandardVMDebugger_Couldn__t_connect_to_VM_4=Cannot connect to VM
StandardVMDebugger_Couldn__t_connect_to_VM_5=Cannot connect to VM
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-20 22:07:50
|
Revision: 1830
http://svn.sourceforge.net/rubyeclipse/?rev=1830&view=rev
Author: cawilliams
Date: 2007-01-20 14:07:49 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
standard VM type works ok on Mac OSX, so don't complain and say it doesn't!
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java 2007-01-20 22:05:00 UTC (rev 1829)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java 2007-01-20 22:07:49 UTC (rev 1830)
@@ -26,11 +26,9 @@
public static String RubyRuntime_exceptionsOccurred;
public static String vmInstallType_duplicateVM;
public static String StandardVMType_Standard_VM_3;
- public static String StandardVMType_Standard_VM_not_supported_on_MacOS__1;
public static String StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1;
public static String StandardVMType_ok_2;
public static String StandardVMType_Not_a_JDK_root__System_library_was_not_found__1;
-
public static String AbstractVMRunner_0;
public static String vmRunnerConfig_assert_classNotNull;
public static String vmRunnerConfig_assert_classPathNotNull;
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties 2007-01-20 22:05:00 UTC (rev 1829)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties 2007-01-20 22:07:49 UTC (rev 1830)
@@ -26,7 +26,6 @@
LaunchingPlugin_34=Unable to create XML parser.
vmInstallType_duplicateVM=Duplicate VM: {0}
StandardVMType_Standard_VM_3=Standard VM
-StandardVMType_Standard_VM_not_supported_on_MacOS__1=Standard VM not supported on MacOS.
StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1=Target is not a Ruby installation root. Ruby executable was not found
StandardVMType_ok_2=ok
StandardVMType_Not_a_JDK_root__System_library_was_not_found__1=Target is not a Ruby installation root. System library was not found.
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-20 22:05:00 UTC (rev 1829)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-01-20 22:07:49 UTC (rev 1830)
@@ -57,18 +57,14 @@
public IStatus validateInstallLocation(File rubyHome) {
IStatus status = null;
- if (Platform.getOS().equals(Constants.OS_MACOSX)) {
- status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Standard_VM_not_supported_on_MacOS__1, null);
+ File rubyExecutable = findRubyExecutable(rubyHome);
+ if (rubyExecutable == null) {
+ status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1, null);
} else {
- File rubyExecutable = findRubyExecutable(rubyHome);
- if (rubyExecutable == null) {
- status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1, null); //
+ if (canDetectDefaultSystemLibraries(rubyHome, rubyExecutable)) {
+ status = new Status(IStatus.OK, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_ok_2, null);
} else {
- if (canDetectDefaultSystemLibraries(rubyHome, rubyExecutable)) {
- status = new Status(IStatus.OK, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_ok_2, null);
- } else {
- status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_root__System_library_was_not_found__1, null);
- }
+ status = new Status(IStatus.ERROR, LaunchingPlugin.getUniqueIdentifier(), 0, LaunchingMessages.StandardVMType_Not_a_JDK_root__System_library_was_not_found__1, null);
}
}
return status;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-20 22:05:04
|
Revision: 1829
http://svn.sourceforge.net/rubyeclipse/?rev=1829&view=rev
Author: cawilliams
Date: 2007-01-20 14:05:00 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
attempting to fix debugging support again - I may need help here, but this looks OK to me
Modified Paths:
--------------
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/model/RubyDebugTarget.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
Modified: 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/RubyDebuggerProxy.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -59,7 +59,7 @@
public String registerRdebugExtension(String pathToRdebugExtension) throws IOException, RubyProcessingException {
// should be called before start
- if (!isRubyDebug) {
+ if (!isRubyDebug) { // Should never happen
return "false";
}
try {
@@ -71,8 +71,7 @@
String expression = "eval require '" + pathToRdebugExtension + "'";
println(expression);
EvalReader reader = new EvalReader(getMultiReaderStrategy());
- return reader.readEvalResult(); // throws
- // RubyProcessingException
+ return reader.readEvalResult(); // throws RubyProcessingException
}
public void start() throws RubyProcessingException {
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -18,7 +18,6 @@
import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IThread;
-import org.rubypeople.rdt.core.SocketUtil;
import org.rubypeople.rdt.internal.debug.core.RdtDebugCorePlugin;
import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy;
import org.rubypeople.rdt.internal.debug.core.SuspensionPoint;
@@ -29,28 +28,38 @@
// This kind of Adapter is deliverd from the DebugElementAdapterFactory.
public class RubyDebugTarget extends PlatformObject implements IRubyDebugTarget {
- private static int DEFAULT_PORT = 1098 ;
+ private static int DEFAULT_PORT = 1098;
private IProcess process;
private boolean isTerminated;
private ILaunch launch;
private RubyThread[] threads;
private RubyDebuggerProxy rubyDebuggerProxy;
- private int port = -1 ;
+ private int port;
private File debugParameterFile;
public RubyDebugTarget(ILaunch launch) {
- this(launch, null) ;
+ this(launch, null);
}
public RubyDebugTarget(ILaunch launch, IProcess process) {
+ this(launch, process, DEFAULT_PORT);
+ }
+
+ public RubyDebugTarget(ILaunch launch, IProcess process, int port) {
this.launch = launch;
+ this.port = port;
this.process = process;
this.threads = new RubyThread[0] ;
this.isTerminated = false ;
IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
manager.addBreakpointListener(this);
+ addDebugParameter("$EclipseListenPort=" + port);
}
+ public RubyDebugTarget(ILaunch launch, int port) {
+ this(launch, null, port);
+ }
+
public void updateThreads() {
// preconditions:
// 1) both threadInfos and updatedThreads are sorted by their id attribute
@@ -75,7 +84,6 @@
}
}
threads = updatedThreads;
-
}
protected RubyThread getThreadById(int id) {
@@ -244,42 +252,29 @@
RdtDebugCorePlugin.log("Could not create debugParameterFile", e) ;
}
}
- return debugParameterFile ;
+ return debugParameterFile;
}
- public boolean addDebugParameter(String line) {
+ private boolean addDebugParameter(String line) {
+ PrintWriter writer = null;
try {
- FileWriter writer = new FileWriter(this.getDebugParameterFile());
- new PrintWriter(writer).println(line);
+ writer = new PrintWriter(new FileWriter(getDebugParameterFile()));
+ writer.println(line);
writer.flush();
- writer.close();
return true;
} catch (IOException ex) {
RdtDebugCorePlugin.log(ex);
return false;
+ } finally {
+ writer.close();
}
}
public int getPort() {
- if (port == -1) {
- port = SocketUtil.findFreePort() ;
- // port can still be -1, if findFreePort fails
- if (port != -1) {
- // see eclipseDebug.rb for how $EclipseListenPort is used from ruby side
- if (!addDebugParameter("$EclipseListenPort=" + port)) {
- port = -1 ;
- }
- }
- // if we couldn't find a free port a write the free port to the file, use the default
- if (port == -1) {
- port = DEFAULT_PORT ;
- }
- RdtDebugCorePlugin.debug("Using port: " + port) ;
- }
- return port ;
+ return port;
}
public boolean isUsingDefaultPort() {
- return this.getPort() == DEFAULT_PORT ;
+ return getPort() == DEFAULT_PORT ;
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -74,6 +74,14 @@
public static String JavaRuntime_Classpath_references_non_existant_archive___0__4;
public static String JavaRuntime_Classpath_references_non_existant_project___0__3;
public static String JavaRuntime_Could_not_resolve_classpath_container___0__1;
+ public static String StandardVMDebugger_Launching_VM____1;
+ public static String StandardVMDebugger_Finding_free_socket____2;
+ public static String StandardVMDebugger_Could_not_find_a_free_socket_for_the_debugger_1;
+ public static String StandardVMDebugger_Constructing_command_line____3;
+ public static String StandardVMDebugger_Starting_virtual_machine____4;
+ public static String StandardVMDebugger_Establishing_debug_connection____5;
+ public static String StandardVMDebugger_Couldn__t_connect_to_VM_4;
+ public static String StandardVMDebugger_Couldn__t_connect_to_VM_5;
private LaunchingMessages() {}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingMessages.properties 2007-01-20 22:05:00 UTC (rev 1829)
@@ -21,10 +21,7 @@
vmInstall_assert_idNotNull=id cannot be null
vmInstall_assert_typeNotNull=VM type cannot be null
-AbstractInterpreterInstall_0=Unable to retrieve system properties
-AbstractInterpreterInstall_1=Evaluating system properties
-AbstractInterpreterInstall_3=Reading system properties
-AbstractInterpreterInstall_4=Exception retrieving system properties
+
LaunchingPlugin_33=Unable to create XML parser.
LaunchingPlugin_34=Unable to create XML parser.
vmInstallType_duplicateVM=Duplicate VM: {0}
@@ -32,4 +29,70 @@
StandardVMType_Standard_VM_not_supported_on_MacOS__1=Standard VM not supported on MacOS.
StandardVMType_Not_a_JDK_Root__Java_executable_was_not_found_1=Target is not a Ruby installation root. Ruby executable was not found
StandardVMType_ok_2=ok
-StandardVMType_Not_a_JDK_root__System_library_was_not_found__1=Target is not a Ruby installation root. System library was not found.
\ No newline at end of file
+StandardVMType_Not_a_JDK_root__System_library_was_not_found__1=Target is not a Ruby installation root. System library was not found.
+
+AbstractVMRunner_0=An IProcess could not be created for the launch
+AbstractInterpreterInstall_0=Unable to retrieve system properties
+AbstractInterpreterInstall_1=Evaluating system properties
+AbstractInterpreterInstall_3=Reading system properties
+AbstractInterpreterInstall_4=Exception retrieving system properties
+
+
+vmRunnerConfig_assert_classNotNull=classToLaunch cannot be null
+vmRunnerConfig_assert_classPathNotNull=loadPath cannot be null
+vmRunnerConfig_assert_programArgsNotNull=args cannot be null
+vmRunnerConfig_assert_vmArgsNotNull=args cannot be null
+
+
+StandardVMRunner__0____1___2={0} ({1})
+StandardVMRunner__0__at_localhost__1__1={0} at localhost:{1}
+StandardVMRunner_Specified_working_directory_does_not_exist_or_is_not_a_directory___0__3=Specified working directory does not exist or is not a directory: {0}
+StandardVMRunner_Launching_VM____1=Launching VM...
+StandardVMRunner_Constructing_command_line____2=Constructing command line...
+StandardVMRunner_Starting_virtual_machine____3=Starting virtual machine...
+StandardVMRunner_Unable_to_locate_executable_for__0__1=Unable to locate executable for {0}
+StandardVMRunner_Specified_executable__0__does_not_exist_for__1__4=Specified executable {0} does not exist for {1}
+
+JavaLocalApplicationLaunchConfigurationDelegate_Verifying_launch_attributes____1=Verifying launch attributes...
+JavaLocalApplicationLaunchConfigurationDelegate_Creating_source_locator____2=Creating source locator...
+
+AbstractJavaLaunchConfigurationDelegate_The_specified_JRE_installation_does_not_exist_4=
+AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_not_specified_for__0__5=
+AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_for__0__does_not_exist___1__6=
+JavaLocalApplicationLaunchConfigurationDelegate_0=
+JavaRuntime_Specified_VM_install_type_does_not_exist___0__2=
+JavaRuntime_Specified_VM_install_not_found__type__0___name__1__2=
+JavaRuntime_VM_not_fully_specified_in_launch_configuration__0____missing_VM_name__Reverting_to_default_VM__1=
+JavaRuntime_Launch_configuration__0__references_non_existing_project__1___1=
+AbstractJavaLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12=
+AbstractJavaLaunchConfigurationDelegate_Main_type_not_specified_11=
+RuntimeLoadpathEntry_Illegal_classpath_entry__0__1=
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry_type_2=
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry_location_3=
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_project_name_4=
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_archive_path_5=
+RuntimeLoadpathEntry_Unable_to_recover_runtime_class_path_entry___missing_variable_name_6=
+RuntimeLoadpathEntry_An_exception_occurred_generating_runtime_classpath_memento_8=
+
+DefaultProjectLoadpathEntry_4={0} (default loadpath)
+DefaultProjectLoadpathEntry_2={0} (default loadpath - exported entries only)
+DefaultProjectLoadpathEntry_3==Invalid memento - expecting name attribute
+
+JavaRuntime_26=Referenced classpath provider does not exist: {0}
+JavaRuntime_28=Launch configuration {0} references closed project {1}
+JavaRuntime_31=Unable to restore classpath entry.
+JavaRuntime_32=Unable to restore classpath entry.
+
+LaunchingPlugin_32=
+JavaRuntime_Classpath_references_non_existant_archive___0__4=
+JavaRuntime_Classpath_references_non_existant_project___0__3=
+JavaRuntime_Could_not_resolve_classpath_container___0__1=
+
+StandardVMDebugger_Could_not_find_a_free_socket_for_the_debugger_1=Cannot find a free socket for the debugger
+StandardVMDebugger_Couldn__t_connect_to_VM_4=Cannot connect to VM
+StandardVMDebugger_Couldn__t_connect_to_VM_5=Cannot connect to VM
+StandardVMDebugger_Launching_VM____1=Launching VM...
+StandardVMDebugger_Finding_free_socket____2=Finding free socket...
+StandardVMDebugger_Constructing_command_line____3=Constructing command line...
+StandardVMDebugger_Starting_virtual_machine____4=Starting virtual machine...
+StandardVMDebugger_Establishing_debug_connection____5=Establishing debug connection...
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -0,0 +1,64 @@
+package org.rubypeople.rdt.internal.launching;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy;
+import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
+import org.rubypeople.rdt.internal.debug.core.model.RubyProcessingException;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
+import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.VMRunnerConfiguration;
+
+public class RDebugVMDebugger extends StandardVMDebugger {
+
+ public RDebugVMDebugger(IVMInstall vmInstance) {
+ super(vmInstance);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.rubypeople.rdt.launching.IVMRunner#run(org.rubypeople.rdt.launching.VMRunnerConfiguration,
+ * org.eclipse.debug.core.ILaunch,
+ * org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+
+ // Set it up to use rdebug executable
+ Map map = config.getVMSpecificAttributesMap();
+ if (map == null) map = new HashMap();
+ map.put(IRubyLaunchConfigurationConstants.ATTR_RUBY_COMMAND, "rdebug");
+ config.setVMSpecificAttributesMap(map);
+
+ super.run(config, launch, monitor);
+ }
+
+ protected List<String> debugSpecificVMArgs(RubyDebugTarget debugTarget) {
+ List<String> arguments = new ArrayList<String>();
+ arguments.add("--server");
+ arguments.add("--port");
+ arguments.add(Integer.toString(debugTarget.getPort()));
+ arguments.add("--cport");
+ arguments.add(Integer.toString(debugTarget.getPort() + 1));
+ arguments.add("-w");
+ if (isDebuggerVerbose()) {
+ arguments.add("-d");
+ }
+ arguments.add("-f");
+ arguments.add("xml");
+ return arguments;
+ }
+
+ protected void updateProxy(RubyDebuggerProxy proxy) throws IOException, RubyProcessingException {
+ proxy.registerRdebugExtension(getDirectoryOfRubyDebuggerFile() + File.separator + "rdebugExtension.rb");
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVM.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -18,11 +18,18 @@
if (ILaunchManager.RUN_MODE.equals(mode)) {
return new StandardVMRunner(this);
} else if (ILaunchManager.DEBUG_MODE.equals(mode)) {
+ if (useRDebug()) {
+ return new RDebugVMDebugger(this);
+ }
return new StandardVMDebugger(this);
}
return null;
}
+ private boolean useRDebug() {
+ return LaunchingPlugin.getDefault().getPluginPreferences().getBoolean(PreferenceConstants.USE_RUBY_DEBUG);
+ }
+
public String getRubyVersion() {
StandardVMType installType = (StandardVMType) getVMInstallType();
File installLocation = getInstallLocation();
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -1,13 +1,187 @@
package org.rubypeople.rdt.internal.launching;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IProcess;
+import org.rubypeople.rdt.core.RubyCore;
+import org.rubypeople.rdt.core.SocketUtil;
+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.internal.debug.core.model.RubyProcessingException;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMRunner;
+import org.rubypeople.rdt.launching.VMRunnerConfiguration;
public class StandardVMDebugger extends StandardVMRunner implements IVMRunner {
public StandardVMDebugger(IVMInstall vmInstance) {
super(vmInstance);
- // TODO Auto-generated constructor stub
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.launching.IVMRunner#run(org.eclipse.jdt.launching.VMRunnerConfiguration,
+ * org.eclipse.debug.core.ILaunch,
+ * org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
+ subMonitor.beginTask(LaunchingMessages.StandardVMDebugger_Launching_VM____1, 4);
+ subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Finding_free_socket____2);
+
+ int port = SocketUtil.findFreePort();
+ if (port == -1) {
+ abort(LaunchingMessages.StandardVMDebugger_Could_not_find_a_free_socket_for_the_debugger_1, null, IRubyLaunchConfigurationConstants.ERR_NO_SOCKET_AVAILABLE);
+ }
+
+ subMonitor.worked(1);
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Constructing_command_line____3);
+
+ RubyDebugTarget debugTarget = new RubyDebugTarget(launch, port);
+
+ String program = constructProgramString(config);
+
+ List<String> arguments = new ArrayList<String>(12);
+
+ arguments.add(program);
+
+ // VM args are the first thing after the ruby program so that users can
+ // specify
+ // options like '-client' & '-server' which are required to be the first
+ // options
+ String[] allVMArgs = combineVmArgs(config, fVMInstance);
+ addArguments(allVMArgs, arguments);
+
+ String[] cp = config.getLoadPath();
+ if (cp.length > 0) {
+ arguments.addAll(convertLoadPath(cp));
+ }
+
+ arguments.addAll(debugSpecificVMArgs(debugTarget));
+
+ arguments.add(StandardVMRunner.END_OF_OPTIONS_DELIMITER);
+
+ arguments.add(config.getFileToLaunch());
+ addArguments(config.getProgramArguments(), arguments);
+ String[] cmdLine = new String[arguments.size()];
+ arguments.toArray(cmdLine);
+
+ String[] envp = config.getEnvironment();
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ subMonitor.worked(1);
+ subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Starting_virtual_machine____4);
+
+ Process p = null;
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ File workingDir = getWorkingDir(config);
+ p = exec(cmdLine, workingDir, envp);
+ if (p == null) {
+ return;
+ }
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ p.destroy();
+ return;
+ }
+
+ IProcess process = newProcess(launch, p, renderProcessLabel(cmdLine), getDefaultProcessMap());
+ process.setAttribute(IProcess.ATTR_CMDLINE, renderCommandLine(cmdLine));
+ subMonitor.worked(1);
+ subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Establishing_debug_connection____5);
+
+ debugTarget.setProcess(process);
+ RubyDebuggerProxy proxy = new RubyDebuggerProxy(debugTarget, true);
+
+ if (proxy.checkConnection()) {
+ try {
+ updateProxy(proxy);
+ proxy.start();
+ launch.addDebugTarget(debugTarget);
+ } catch (IOException e) {
+ abort(LaunchingMessages.StandardVMDebugger_Couldn__t_connect_to_VM_4, e, IRubyLaunchConfigurationConstants.ERR_CONNECTION_FAILED);
+ } catch (RubyProcessingException e) {
+ abort(LaunchingMessages.StandardVMDebugger_Couldn__t_connect_to_VM_5, e, IRubyLaunchConfigurationConstants.ERR_CONNECTION_FAILED);
+ } finally {
+ // FIXME Should this always terminate, or just on exceptions?
+ debugTarget.terminate();
+ }
+ } else {
+ LaunchingPlugin.log(new Status(IStatus.ERROR, LaunchingPlugin.PLUGIN_ID, IStatus.ERROR, LaunchingMessages.RdtLaunchingPlugin_processTerminatedBecauseNoDebuggerConnection, null));
+ debugTarget.terminate();
+ }
+ if (p != null) {
+ p.destroy();
+ }
+ }
+
+ /**
+ * A method to set up the RubyDebuggerProxy prior to launching
+ * @param proxy
+ * @throws IOException
+ * @throws RubyProcessingException
+ */
+ protected void updateProxy(RubyDebuggerProxy proxy) throws IOException, RubyProcessingException {
+ // do nothing, needed for rdebug
+ }
+
+ protected List<String> debugSpecificVMArgs(RubyDebugTarget debugTarget) {
+ List<String> arguments = new ArrayList<String>();
+ if (!debugTarget.isUsingDefaultPort()) {
+ arguments.add("-r" + debugTarget.getDebugParameterFile().getAbsolutePath());
+ }
+
+ if (RdtDebugCorePlugin.isRubyDebuggerVerbose() || isDebuggerVerbose()) {
+ arguments.add("-reclipseDebugVerbose");
+ } else {
+ arguments.add("-reclipseDebug");
+ }
+ // FIXME Somehow hook this into the loadpath stuff?
+ arguments.add("-I");
+ arguments.add(LaunchingPlugin.osDependentPath(getDirectoryOfRubyDebuggerFile().replace('/', File.separatorChar)));
+ return arguments;
+ }
+
+ protected static boolean isDebuggerVerbose() {
+ return LaunchingPlugin.getDefault().getPluginPreferences().getBoolean(PreferenceConstants.VERBOSE_DEBUGGER);
+ }
+
+ protected static String getDirectoryOfRubyDebuggerFile() {
+ return RubyCore.getOSDirectory(LaunchingPlugin.getDefault()) + "ruby";
+ }
+
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -32,7 +32,7 @@
public class StandardVMRunner extends AbstractVMRunner {
- private static final String END_OF_OPTIONS_DELIMITER = "--";
+ protected static final String END_OF_OPTIONS_DELIMITER = "--";
protected IVMInstall fVMInstance;
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java 2007-01-20 22:03:22 UTC (rev 1828)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRubyLaunchConfigurationConstants.java 2007-01-20 22:05:00 UTC (rev 1829)
@@ -41,6 +41,18 @@
public static final int ERR_WORKING_DIRECTORY_DOES_NOT_EXIST = 108;
/**
+ * Status code indicating that a free socket was not available to
+ * communicate with the VM.
+ */
+ public static final int ERR_NO_SOCKET_AVAILABLE = 118;
+
+ /**
+ * Status code indicating that the debugger failed to connect
+ * to the VM.
+ */
+ public static final int ERR_CONNECTION_FAILED = 120;
+
+ /**
* Status code indicating that the project referenced by a launch configuration
* is closed.
*
@@ -175,7 +187,6 @@
* loadpath is generated by the loadpath provider associated with a launch
* configuration (via the <code>ATTR_LOADPATH_PROVIDER</code> attribute).
*/
- public static final String ATTR_LOADPATH = LaunchingPlugin.getUniqueIdentifier() + ".LOADPATH"; //$NON-NLS-1$
+ public static final String ATTR_LOADPATH = LaunchingPlugin.getUniqueIdentifier() + ".LOADPATH"; //$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-20 22:03:27
|
Revision: 1828
http://svn.sourceforge.net/rubyeclipse/?rev=1828&view=rev
Author: cawilliams
Date: 2007-01-20 14:03:22 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
Fix ticket # 226 - text needed to be wrapped, otherwise it goes way off screen.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-01-19 21:36:56 UTC (rev 1827)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-01-20 22:03:22 UTC (rev 1828)
@@ -171,7 +171,7 @@
DebuggerPreferencePage_description_label=Debugger preferences
DebuggerPreferencePage_useRubyDebug_label=Use ruby-debug library
DebuggerPreferencePage_verboseDebugger_label=Debugger verbose mode
-DebuggerPreferencePage_useRubyDebug_comment=ruby-debug requires a ruby version >= 1.8.4. At the time being a patched ruby-debug version must be used. It is packaged with RDT and can be found at {0}plugins/org.rubypeople.rdt.launching. It can be installed with the command 'gem install'. Please be aware that the package contains native code and therefore a c-compiler for your platform must be available.
+DebuggerPreferencePage_useRubyDebug_comment=ruby-debug requires a ruby version >= 1.8.4.\nAt the time being a patched ruby-debug version must be used.\nIt is packaged with RDT and can be found at:\n {0}plugins/org.rubypeople.rdt.launching.\nIt can be installed with the command 'gem install'.\nPlease be aware that the package contains native code and therefore a c-compiler for your platform must be available.
PropertyAndPreferencePage_useprojectsettings_label=Enable pr&oject specific settings
PropertyAndPreferencePage_useworkspacesettings_change=Configure Workspace Settings...
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-19 21:36:58
|
Revision: 1827
http://svn.sourceforge.net/rubyeclipse/?rev=1827&view=rev
Author: cawilliams
Date: 2007-01-19 13:36:56 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
just try to get back to building properly...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java 2007-01-19 21:23:16 UTC (rev 1826)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java 2007-01-19 21:36:56 UTC (rev 1827)
@@ -1,12 +1,9 @@
package org.rubypeople.rdt.testunit.launcher;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration;
-import org.rubypeople.rdt.internal.launching.RubyApplicationLaunchConfigurationDelegate;
import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
+import org.rubypeople.rdt.launching.RubyLaunchDelegate;
-public class TestUnitLaunchConfigurationDelegate extends RubyApplicationLaunchConfigurationDelegate {
+public class TestUnitLaunchConfigurationDelegate extends RubyLaunchDelegate {
/**
* The single test type, or "" iff running a launch container.
*/
@@ -25,12 +22,5 @@
public TestUnitLaunchConfigurationDelegate() {
super();
}
-
- protected InterpreterRunnerConfiguration wrapConfigurationAndHandleLaunch(ILaunchConfiguration configuration, ILaunch launch) {
-
- TestUnitRunnerConfiguration testRunnerConfiguration = new TestUnitRunnerConfiguration(configuration) ;
- launch.setAttribute(TestunitPlugin.TESTUNIT_PORT_ATTR, Integer.toString(testRunnerConfiguration.getPort())) ;
- return testRunnerConfiguration ;
- }
-
+// FIXME This won't work anymore!
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java 2007-01-19 21:23:16 UTC (rev 1826)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java 2007-01-19 21:36:56 UTC (rev 1827)
@@ -9,14 +9,16 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.SocketUtil;
-import org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration;
import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
+import org.rubypeople.rdt.launching.VMRunnerConfiguration;
-public class TestUnitRunnerConfiguration extends InterpreterRunnerConfiguration {
+public class TestUnitRunnerConfiguration extends VMRunnerConfiguration {
private int port = -1 ;
+ private ILaunchConfiguration configuration;
public TestUnitRunnerConfiguration(ILaunchConfiguration aConfiguration) {
- super(aConfiguration);
+ super(getTestRunnerPath(), null);
+ configuration = aConfiguration;
}
public String getAbsoluteFileName() {
@@ -61,9 +63,9 @@
/*
* (non-Javadoc)
*
- * @see org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration#getProgramArguments()
+ * @see org.rubypeople.rdt.launching.VMRunnerConfiguration#getProgramArguments()
*/
- public String getProgramArguments() {
+ public String[] getProgramArguments() {
String fileName = "";
String testClass = "";
String testMethod = "";
@@ -81,18 +83,17 @@
throw new RuntimeException("Could not get necessary attributes from the launch configuration.") ;
}
- return "\"" + fileName + "\" " + this.getPort() + " " + keepAlive + " " + testClass + " " + testMethod;
+ return new String[] { fileName, Integer.toString(getPort()), Boolean.toString(keepAlive), testClass, testMethod};
}
- public List renderLoadPath() {
- List loadPath = super.renderLoadPath();
-
- String absoluteTestFileName = this.getAbsoluteTestFileName();
- if (absoluteTestFileName.length() != 0) {
- loadPath.add("-I");
- loadPath.add(absoluteTestFileName);
+ public String[] getLoadPath() {
+ String[] loadPath = super.getLoadPath();
+ String[] newLoadPath = new String[loadPath.length + 1];
+ for (int i = 0; i < loadPath.length; i++) {
+ newLoadPath[i] = loadPath[i];
}
- return loadPath;
+ newLoadPath[loadPath.length] = getAbsoluteTestFileName();
+ return newLoadPath;
}
public static String getTestRunnerPath() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-19 21:23:17
|
Revision: 1826
http://svn.sourceforge.net/rubyeclipse/?rev=1826&view=rev
Author: cawilliams
Date: 2007-01-19 13:23:16 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
just try to get back to building properly...
Modified Paths:
--------------
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
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-19 21:17:23 UTC (rev 1825)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-01-19 21:23:16 UTC (rev 1826)
@@ -46,6 +46,7 @@
import org.rubypeople.rdt.internal.ui.rdocexport.RdocListener;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallChangedListener;
+import org.rubypeople.rdt.launching.IVMRunner;
import org.rubypeople.rdt.launching.PropertyChangeEvent;
import org.rubypeople.rdt.launching.RubyRuntime;
import org.rubypeople.rdt.ui.PreferenceConstants;
@@ -228,6 +229,7 @@
private void initSearchList() {
RubyInvoker invoker = new RubyInvoker() {
protected void handleOutput(Process process) {
+ if (process == null) return;
riFound = false;
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;
@@ -318,6 +320,7 @@
}
protected void handleOutput(final Process process) {
+ if (process == null) return;
// any output?
final StreamRedirector outputRedirect = new StreamRedirector(process.getInputStream(), "");
// kick them off
@@ -379,15 +382,17 @@
return;
}
- try {
+// try {
List args = getArgList();
args.add(0, riPath.toString());
- final Process p = RubyRuntime.getDefault().getDefaultVMInstall().exec(args, null);
+ IVMRunner runner = RubyRuntime.getDefaultVMInstall().getVMRunner("run");
+ // XXX How in the world do we do these quick little background launches and grab the process?
+ final Process p = null;
handleOutput(p);
- } catch (CoreException coreException) {
- // message of RuntimeException will be displayed in the RI View
- throw new RuntimeException(coreException.getStatus().getMessage());
- }
+// } catch (CoreException coreException) {
+// // message of RuntimeException will be displayed in the RI View
+// throw new RuntimeException(coreException.getStatus().getMessage());
+// }
}
}
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-19 21:17:23 UTC (rev 1825)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rdocexport/RDocUtility.java 2007-01-19 21:23:16 UTC (rev 1826)
@@ -85,7 +85,7 @@
public final void invoke() {
log("Generating RDoc for " + resource.getName());
- IVMInstall interpreter = RubyRuntime.getDefault().getDefaultVMInstall();
+ IVMInstall interpreter = RubyRuntime.getDefaultVMInstall();
if (interpreter == null) {
MessageDialog.openInformation(RubyPlugin.getActiveWorkbenchShell(), LaunchingMessages.RdtLaunchingPlugin_noInterpreterSelectedTitle, LaunchingMessages.RdtLaunchingPlugin_noInterpreterSelected);
return ;
@@ -108,14 +108,16 @@
args.add(rdocPath.toString());
args.add("-r");
args.add(resource.getLocation().toOSString());
- try {
- final Process p = interpreter.exec(args, null);
+// try {
+ // XXX How do we do quick background launches of the interpreter?
+// final Process p = interpreter.exec(args, null);
+ final Process p = null;
handleOutput(p, args);
- } catch (CoreException e) {
- RubyPlugin.log(e);
- log(e.getMessage());
- ErrorDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("ErrorRunningRdocTitle"), e.getMessage(), new StatusInfo(StatusInfo.ERROR, e.getMessage()));
- }
+// } catch (CoreException e) {
+// RubyPlugin.log(e);
+// log(e.getMessage());
+// ErrorDialog.openError(RubyPlugin.getActiveWorkbenchShell(), RubyUIMessages.getString("ErrorRunningRdocTitle"), e.getMessage(), new StatusInfo(StatusInfo.ERROR, e.getMessage()));
+// }
}
/**
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-19 21:17:23 UTC (rev 1825)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RiDocHoverProvider.java 2007-01-19 21:23:16 UTC (rev 1826)
@@ -36,7 +36,10 @@
args.add(symbol);
IVMInstall selectedInterpreter = RubyRuntime.getDefault().getDefaultVMInstall();
if (selectedInterpreter == null) return null;
- Process p = selectedInterpreter.exec(args, null);
+// XXX How in the world do we do these quick little background launches and grab the process?
+// Process p = selectedInterpreter.exec(args, null);
+ Process p = null;
+ if (p == null) return null;
br = new BufferedReader(new InputStreamReader(p.getInputStream()));
// TODO: format the documentation that was fetched from RI
// for now: read the first 15 lines so
@@ -55,8 +58,8 @@
return "" + buf.toString();
} catch (BadLocationException e) {
RubyPlugin.log(e);
- } catch (CoreException e) {
- RubyPlugin.log(e);
+// } catch (CoreException e) {
+// RubyPlugin.log(e);
} catch (IOException e) {
RubyPlugin.log(e);
} finally {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-19 21:17:26
|
Revision: 1825
http://svn.sourceforge.net/rubyeclipse/?rev=1825&view=rev
Author: cawilliams
Date: 2007-01-19 13:17:23 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
just try to get back to building properly...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
trunk/org.rubypeople.rdt.launching.tests/plugin.xml
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java
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-19 21:12:12 UTC (rev 1824)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-01-19 21:17:23 UTC (rev 1825)
@@ -2,7 +2,6 @@
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.internal.debug.core.SuspensionPoint;
-import org.rubypeople.rdt.internal.launching.DebuggerRunner;
import org.rubypeople.rdt.internal.launching.LaunchingPlugin;
public class FTC_RubyDebugCommunicationTest extends FTC_ClassicDebuggerCommunicationTest {
@@ -84,7 +83,7 @@
protected String getDirectoryOfRubyDebuggerFile() {
String result = null;
if (RubyCore.getPlugin() != null) {
- result = DebuggerRunner.getDirectoryOfRubyDebuggerFile();
+ result = RubyCore.getOSDirectory(LaunchingPlugin.getDefault()) + "ruby";
} else {
result = LaunchingPlugin.class.getResource(".").getPath() + "/../../../../../../ruby";
}
Modified: trunk/org.rubypeople.rdt.launching.tests/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.launching.tests/plugin.xml 2007-01-19 21:12:12 UTC (rev 1824)
+++ trunk/org.rubypeople.rdt.launching.tests/plugin.xml 2007-01-19 21:17:23 UTC (rev 1825)
@@ -19,6 +19,7 @@
<import plugin="org.rubypeople.rdt.launching"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.rubypeople.eclipse.testutils"/>
+ <import plugin="org.rubypeople.rdt.core"/>
</requires>
</plugin>
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-19 21:12:12 UTC (rev 1824)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RunnerLaunching.java 2007-01-19 21:17:23 UTC (rev 1825)
@@ -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.core.RubyCore;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.IVMInstallType;
import org.rubypeople.rdt.launching.RubyRuntime;
@@ -66,7 +67,7 @@
}
// The include paths and the executed ruby file is quoted on windows
if (debug) {
- String dirOfRubyDebuggerFile = DebuggerRunner.getDirectoryOfRubyDebuggerFile().replace('/', File.separatorChar) ;
+ String dirOfRubyDebuggerFile = getDirectoryOfRubyDebuggerFile().replace('/', File.separatorChar) ;
if (dirOfRubyDebuggerFile.startsWith("\\")) {
dirOfRubyDebuggerFile = dirOfRubyDebuggerFile.substring(1) ;
}
@@ -85,6 +86,10 @@
return commandLine;
}
+ private String getDirectoryOfRubyDebuggerFile() {
+ return RubyCore.getOSDirectory(LaunchingPlugin.getDefault()) + "ruby";
+ }
+
public void testDebugEnabled() throws Exception {
// check if debugging is enabled in plugin.xml
ILaunchConfigurationType launchConfigurationType =
@@ -100,7 +105,7 @@
IProject project = ResourceTools.createProject(PROJECT_NAME);
- ShamInterpreter interpreter = new ShamInterpreter("", new File(""));
+ IVMInstall interpreter = new VMStandin((IVMInstallType)null, "");
ILaunchConfiguration configuration = new ShamLaunchConfiguration();
ILaunch launch = new Launch(configuration, debug ? ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE, null);
@@ -115,11 +120,11 @@
assertEquals("One process has been spawned", 1, launch.getProcesses().length);
List expected = getCommandLine(project, debug);
- List actual = interpreter.getArguments();
+ String[] actual = interpreter.getVMArguments();
if (debug) {
// we must cheat with the first argument, because it is a temporary file which
// contains is different for every call
- expected.add(0, actual.get(0)) ;
+ expected.add(0, actual[0]) ;
}
assertEquals("Assembled command line.", expected, actual);
assertEquals(
@@ -264,21 +269,4 @@
}
}
- public class ShamInterpreter extends RubyInterpreter {
- public ShamInterpreter(String aName, File validInstallLocation) {
- super(aName, validInstallLocation);
- }
- private List arguments;
- public List getArguments() {
- return arguments;
- }
- public String getCommand() {
- return RUBY_COMMAND;
- }
- public Process exec(List args, File workingDirectory) {
- arguments = args;
- return new ShamProcess();
- }
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-19 21:12:14
|
Revision: 1824
http://svn.sourceforge.net/rubyeclipse/?rev=1824&view=rev
Author: cawilliams
Date: 2007-01-19 13:12:12 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
fix it up some (and remove tests that don't make sense anymore)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java
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-19 21:11:46 UTC (rev 1823)
+++ trunk/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/TC_RubyInterpreter.java 2007-01-19 21:12:12 UTC (rev 1824)
@@ -1,109 +1,33 @@
package org.rubypeople.rdt.internal.launching;
import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
import org.rubypeople.rdt.launching.IVMInstall;
+import org.rubypeople.rdt.launching.IVMInstallType;
+import org.rubypeople.rdt.launching.RubyRuntime;
public class TC_RubyInterpreter extends TestCase {
- private static final String TEST_RUBY_CMD = "/foo bar ruby";
- private static final File WORKING_DIR = new File("/testDir");
+ private static final String VM_TYPE_ID = "org.rubypeople.rdt.launching.StandardVMType";
+ private IVMInstallType vmType;
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ vmType = RubyRuntime.getVMInstallType(VM_TYPE_ID);
+ }
+
public void testEquals() {
- IVMInstall interpreterOne = new RubyInterpreter("InterpreterOne", new File("/InterpreterOnePath"));
- IVMInstall similarInterpreterOne = new RubyInterpreter("InterpreterOne", new File("/InterpreterOnePath"));
+ IVMInstall interpreterOne = new StandardVM(vmType, "InterpreterOne");
+ interpreterOne.setInstallLocation(new File("/InterpreterOnePath"));
+ IVMInstall similarInterpreterOne = new StandardVM(vmType, "InterpreterOne");
+ similarInterpreterOne.setInstallLocation(new File("/InterpreterOnePath"));
assertTrue("Interpreters should be equal.", interpreterOne.equals(similarInterpreterOne));
- IVMInstall interpreterTwo = new RubyInterpreter("InterpreterTwo", new File("/InterpreterTwoPath"));
+ IVMInstall interpreterTwo = new StandardVM(vmType, "InterpreterTwo");
+ interpreterTwo.setInstallLocation(new File("/InterpreterTwoPath"));
assertTrue("Interpreters should not be equal.", !interpreterOne.equals(interpreterTwo));
}
-
- public void testExecList() throws Exception {
- ShamCommandExecutor executor = new ShamCommandExecutor();
- RubyInterpreter interpreter = new NonValidatingInterpreter("Test", new File("/path to ruby"), executor);
- ShamProcess process = new ShamProcess();
- executor.setProcessToReturn(process);
-
- Process result = interpreter.exec(Arrays.asList(new String[] {"a","b b", "c"}), WORKING_DIR);
-
- executor.assertExecute(new String[] {TEST_RUBY_CMD, "a", "b b", "c"}, WORKING_DIR);
- assertEquals(process, result);
- }
-
- public void testExecutorThrows() throws Exception {
- ShamCommandExecutor executor = new ShamCommandExecutor();
- RubyInterpreter interpreter = new NonValidatingInterpreter("Test", new File("/path to ruby"), executor);
- IOException testException = new IOException("test");
- executor.setExceptionToThrow(testException);
-
- try {
- interpreter.exec(new ArrayList(), WORKING_DIR);
- fail("Expected CoreException");
- } catch (CoreException expected) {
- assertEquals(IStatus.ERROR, expected.getStatus().getSeverity());
- assertEquals(testException, expected.getStatus().getException());
- }
- }
-
- public void testUnknownInterperterThrows() throws Exception {
- RubyInterpreter interpreter = new RubyInterpreter("Test", new File("unknown ruby interpreter"), null);
-
- try {
- interpreter.exec(new ArrayList(), WORKING_DIR);
- fail("Expected CoreException");
- } catch (CoreException expected) {
- assertEquals(IStatus.ERROR, expected.getStatus().getSeverity());
- assertEquals(IllegalCommandException.class, expected.getStatus().getException().getClass());
- }
- }
-
- private static final class NonValidatingInterpreter extends RubyInterpreter {
- private NonValidatingInterpreter(String name, File location, CommandExecutor executor) {
- super(name, location, executor);
- }
-
-
- public String getCommand() {
- return TEST_RUBY_CMD;
- }
- }
-
- private static class ShamCommandExecutor implements CommandExecutor {
- private String[] commandArg;
- private File workingDirectoryArg;
- private ShamProcess processToReturn;
- private IOException exceptionToThrow;
-
- public void assertExecute(String[] expectedCommand, File expectedWorkingDir) {
- assertEquals("Command ", Arrays.asList(expectedCommand), Arrays.asList(commandArg));
- assertEquals("Working dir", expectedWorkingDir, workingDirectoryArg);
- }
-
- public void setExceptionToThrow(IOException exception) {
- this.exceptionToThrow = exception;
-
- }
-
- public void setProcessToReturn(ShamProcess process) {
- this.processToReturn = process;
-
- }
-
- public Process exec(String[] command, File workingDirectory) throws IOException {
- commandArg = command;
- workingDirectoryArg = workingDirectory;
- if (exceptionToThrow != null)
- throw exceptionToThrow;
- return processToReturn;
- }
-
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-01-19 21:11:47
|
Revision: 1823
http://svn.sourceforge.net/rubyeclipse/?rev=1823&view=rev
Author: cawilliams
Date: 2007-01-19 13:11:46 -0800 (Fri, 19 Jan 2007)
Log Message:
-----------
not needed
Removed Paths:
-------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/CommandExecutor.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardCommandExecutor.java
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/CommandExecutor.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/CommandExecutor.java 2007-01-19 21:07:05 UTC (rev 1822)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/CommandExecutor.java 2007-01-19 21:11:46 UTC (rev 1823)
@@ -1,8 +0,0 @@
-package org.rubypeople.rdt.internal.launching;
-
-import java.io.File;
-import java.io.IOException;
-
-public interface CommandExecutor {
- public Process exec(String[] command, File workingDirectory) throws IOException;
-}
Deleted: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardCommandExecutor.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardCommandExecutor.java 2007-01-19 21:07:05 UTC (rev 1822)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardCommandExecutor.java 2007-01-19 21:11:46 UTC (rev 1823)
@@ -1,13 +0,0 @@
-/**
- *
- */
-package org.rubypeople.rdt.internal.launching;
-
-import java.io.File;
-import java.io.IOException;
-
-class StandardCommandExecutor implements CommandExecutor {
- public Process exec(String[] command, File workingDirectory) throws IOException {
- return Runtime.getRuntime().exec(command, null, workingDirectory);
- }
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|