|
From: <mba...@us...> - 2007-03-21 21:45:14
|
Revision: 2204
http://svn.sourceforge.net/rubyeclipse/?rev=2204&view=rev
Author: mbarchfe
Date: 2007-03-21 14:44:55 -0700 (Wed, 21 Mar 2007)
Log Message:
-----------
Provide a more meaningful message if a user tries to open/save a ruby script in a project without ruby nature
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyModelStatusConstants.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -307,4 +307,5 @@
* @since 3.1
*/
// public static final int INVALID_COMPILER_OPTION = 1007;
+ public static final int PROJECT_HAS_NO_RUBY_NATURE = 1007;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelStatus.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -308,6 +308,11 @@
newPath = path.removeFirstSegments(1);
}
return Messages.bind(Messages.classpath_disabledMultipleOutputLocations, newPath.makeRelative().toString(), projectName);
+
+ case PROJECT_HAS_NO_RUBY_NATURE:
+ javaProject = (IRubyProject)elements[0];
+ projectName = javaProject.getElementName();
+ return Messages.bind(Messages.project_has_no_ruby_nature, projectName);
}
if (string != null) {
return string;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -469,7 +469,7 @@
// check whether the ruby project can be opened
if (!hasRubyNature((IProject) underlyingResource)) {
- throw newNotPresentException();
+ throw new RubyModelException(new RubyModelStatus(IRubyModelStatusConstants.PROJECT_HAS_NO_RUBY_NATURE, this));
}
// cannot refresh cp markers on opening (emulate cp check on startup)
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-03-21 21:44:55 UTC (rev 2204)
@@ -153,6 +153,7 @@
public static String convention_package_uppercaseName;
public static String build_saveStateProgress;
public static String build_saveStateComplete;
+ public static String project_has_no_ruby_nature;
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-03-21 16:02:43 UTC (rev 2203)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/messages.properties 2007-03-21 21:44:55 UTC (rev 2204)
@@ -159,3 +159,5 @@
convention_package_nameWithBlanks = A package name must not start or end with a blank
convention_package_consecutiveDotsName = A package name must not contain two consecutive dots
convention_package_uppercaseName = By convention, package names usually start with a lowercase letter
+
+project_has_no_ruby_nature = The project {0} is supposed to have a ruby nature.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|