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-03-09 20:17:08
|
Revision: 2122
http://svn.sourceforge.net/rubyeclipse/?rev=2122&view=rev
Author: cawilliams
Date: 2007-03-09 12:17:06 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
do some more code completion tweaking
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 17:20:36 UTC (rev 2121)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 20:17:06 UTC (rev 2122)
@@ -60,11 +60,23 @@
this.correctedSource = source.toString();
}
- public boolean isMethodInvokation() {
+ /**
+ * This is when we have a receiver and a period in the prefix
+ * @return
+ */
+ public boolean isExplicitMethodInvokation() {
return isMethodInvokation;
}
/**
+ * This is when it could be a method call with an implicit self, or when it may just be a local
+ * @return
+ */
+ public boolean isMethodInvokationOrLocal() {
+ return !isExplicitMethodInvokation() && (emptyPrefix() || Character.isLowerCase(getPartialPrefix().charAt(0)));
+ }
+
+ /**
* The last portion of prefix is not null, not empty and starts with an uppercase letter
* @return
*/
@@ -125,7 +137,7 @@
}
public boolean isGlobal() {
- return !emptyPrefix() && !isMethodInvokation() && getPartialPrefix().startsWith("$");
+ return !emptyPrefix() && !isExplicitMethodInvokation() && getPartialPrefix().startsWith("$");
}
public boolean fullPrefixIsConstant() {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 17:20:36 UTC (rev 2121)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 20:17:06 UTC (rev 2122)
@@ -30,6 +30,7 @@
import org.rubypeople.rdt.core.CompletionProposal;
import org.rubypeople.rdt.core.CompletionRequestor;
import org.rubypeople.rdt.core.Flags;
+import org.rubypeople.rdt.core.IMember;
import org.rubypeople.rdt.core.IMethod;
import org.rubypeople.rdt.core.IOpenable;
import org.rubypeople.rdt.core.IRubyElement;
@@ -75,7 +76,7 @@
suggestTypeNames();
suggestConstantNames();
}
- if (fContext.isMethodInvokation()) {
+ if (fContext.isExplicitMethodInvokation()) {
ITypeInferrer inferrer = new DefaultTypeInferrer();
List<ITypeGuess> guesses = inferrer.infer(fContext.getCorrectedSource(), fContext.getOffset());
RubyElementRequestor requestor = new RubyElementRequestor(script);
@@ -92,7 +93,17 @@
} else {
// FIXME If we're invoked on the class declaration (it's super class) don't do this!
// FIXME Traverse the IRubyElement model, not nodes (and don't reparse)?
- getDocumentsRubyElementsInScope();
+ if (fContext.isMethodInvokationOrLocal()) {
+ // Grab all the methods in this type and it's super/module.
+ IMember element = (IMember) script.getElementAt(fContext.getOffset());
+ IType type = element.getDeclaringType();
+ List<CompletionProposal> list = sort(suggestMethods(100, type));
+ for (CompletionProposal proposal : list) {
+ fRequestor.accept(proposal);
+ }
+ }
+ // FIXME WHat about instance and class variables?
+// getDocumentsRubyElementsInScope();
}
if (fContext.isGlobal()) { // looks like a global
suggestGlobals();
@@ -159,8 +170,41 @@
proposals.put(proposal.getName(), proposal); // If a method name matches an existing suggestion (i.e. its overriden in the subclass), don't suggest it again!
}
}
+ proposals.putAll(addModuleMethods(confidence, type));
+ proposals.putAll(addSuperClassMethods(confidence, type));
+ return proposals;
+ }
+
+ private Map<String, CompletionProposal> addModuleMethods(int confidence, IType type) {
+ Map<String, CompletionProposal> proposals = new HashMap<String, CompletionProposal>();
+ if (type.isModule()) return proposals;
+ String[] modules = null;
+ try {
+ modules = type.getIncludedModuleNames();
+ } catch (RubyModelException e) {
+ // ignore
+ }
+ if (modules == null || modules.length == 0) return proposals;
+ RubyElementRequestor requestor = new RubyElementRequestor(type.getRubyScript());
+ for (int i = 0; i < modules.length; i++) {
+ IType[] moduleTypes = requestor.findType(modules[i]);
+ for (int j = 0; j < moduleTypes.length; j++) {
+ try {
+ IType moduleType = moduleTypes[j];
+ proposals.putAll(suggestMethods(confidence, moduleType));
+ } catch (RubyModelException e) {
+ // ignore
+ }
+ }
+ }
+ return proposals;
+ }
+
+ private Map<String, CompletionProposal> addSuperClassMethods(int confidence, IType type) throws RubyModelException {
+ Map<String, CompletionProposal> proposals = new HashMap<String, CompletionProposal>();
String superClass = type.getSuperclassName();
if (superClass == null) return proposals;
+ if (type.isModule() && superClass.equals("Module")) return proposals;
RubyElementRequestor requestor = new RubyElementRequestor(type.getRubyScript());
IType[] supers = requestor.findType(superClass);
for (int i = 0; i < supers.length; i++) {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-03-09 17:20:36 UTC (rev 2121)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-03-09 20:17:06 UTC (rev 2122)
@@ -916,89 +916,94 @@
*/
public Instruction visitFCallNode(FCallNode iVisited) {
handleNode(iVisited);
- // FIXME Evaluate self and check to see if the method exists!
if (DEBUG)
System.out.println(iVisited.getName());
String functionName = iVisited.getName();
if (functionName.equals("require") || functionName.equals("load")) {
- ArrayNode node = (ArrayNode) iVisited.getArgsNode();
- String arg = getString(node);
- if (arg != null) {
- ImportContainer importContainer = (ImportContainer) script
- .getImportContainer();
- // create the import container and its info
- if (this.importContainerInfo == null) {
- this.importContainerInfo = new RubyElementInfo();
- scriptInfo.addChild(importContainer);
- this.newElements.put(importContainer,
- this.importContainerInfo);
- }
- RubyImport handle = new RubyImport(importContainer, arg);
-
- ImportDeclarationElementInfo info = new ImportDeclarationElementInfo();
- setKeywordRange(functionName, node.getPosition(), info, arg);
- info.name = arg; // no trailing * if onDemand
-
- this.importContainerInfo.addChild(handle);
- this.newElements.put(handle, info);
- }
+ addImport(iVisited, functionName);
}
// Collect included mixins
if ( functionName.equals("include") ) {
- List<String> mixins = new LinkedList<String>();
- Node argsNode = iVisited.getArgsNode();
- Iterator iter = null;
- if (argsNode instanceof SplatNode) {
- SplatNode splat = (SplatNode) argsNode;
- iter = splat.childNodes().iterator();
+ includeModule(iVisited);
+ }
+ visitNode(iVisited.getArgsNode());
+ visitNode(iVisited.getIterNode());
+ return null;
+ }
+
+ private void addImport(FCallNode iVisited, String functionName) {
+ ArrayNode node = (ArrayNode) iVisited.getArgsNode();
+ String arg = getString(node);
+ if (arg != null) {
+ ImportContainer importContainer = (ImportContainer) script
+ .getImportContainer();
+ // create the import container and its info
+ if (this.importContainerInfo == null) {
+ this.importContainerInfo = new RubyElementInfo();
+ scriptInfo.addChild(importContainer);
+ this.newElements.put(importContainer,
+ this.importContainerInfo);
}
- else if (argsNode instanceof ArrayNode) {
- ArrayNode arrayNode = (ArrayNode) iVisited.getArgsNode();
- iter = arrayNode.iterator();
+ RubyImport handle = new RubyImport(importContainer, arg);
+
+ ImportDeclarationElementInfo info = new ImportDeclarationElementInfo();
+ setKeywordRange(functionName, node.getPosition(), info, arg);
+ info.name = arg; // no trailing * if onDemand
+
+ this.importContainerInfo.addChild(handle);
+ this.newElements.put(handle, info);
+ }
+ }
+
+ private void includeModule(FCallNode iVisited) {
+ List<String> mixins = new LinkedList<String>();
+ Node argsNode = iVisited.getArgsNode();
+ Iterator iter = null;
+ if (argsNode instanceof SplatNode) {
+ SplatNode splat = (SplatNode) argsNode;
+ iter = splat.childNodes().iterator();
+ }
+ else if (argsNode instanceof ArrayNode) {
+ ArrayNode arrayNode = (ArrayNode) iVisited.getArgsNode();
+ iter = arrayNode.iterator();
+ }
+ for (; iter.hasNext();) {
+ Node mixinNameNode = (Node) iter.next();
+ if ( mixinNameNode instanceof StrNode ) {
+ mixins.add( ((StrNode)mixinNameNode).getValue().toString() );
}
- for (; iter.hasNext();) {
- Node mixinNameNode = (Node) iter.next();
- if ( mixinNameNode instanceof StrNode ) {
- mixins.add( ((StrNode)mixinNameNode).getValue().toString() );
+ if ( mixinNameNode instanceof DStrNode ) {
+ Node next = (Node)((DStrNode)mixinNameNode).iterator().next();
+ if ( next instanceof StrNode ) {
+ mixins.add( ((StrNode)next).getValue().toString() );
}
- if ( mixinNameNode instanceof DStrNode ) {
- Node next = (Node)((DStrNode)mixinNameNode).iterator().next();
- if ( next instanceof StrNode ) {
- mixins.add( ((StrNode)next).getValue().toString() );
- }
- }
- if (mixinNameNode instanceof ConstNode) {
- mixins.add( ((ConstNode)mixinNameNode).getName() );
- }
}
+ if (mixinNameNode instanceof ConstNode) {
+ mixins.add( ((ConstNode)mixinNameNode).getName() );
+ }
+ }
+
+ // Push mixins into parent type, if available
+ if ( infoStack.peek() instanceof RubyTypeElementInfo ) {
- // Push mixins into parent type, if available
- if ( infoStack.peek() instanceof RubyTypeElementInfo ) {
-
- // Get parent type
- RubyTypeElementInfo parentType = (RubyTypeElementInfo)infoStack.peek();
+ // Get parent type
+ RubyTypeElementInfo parentType = (RubyTypeElementInfo)infoStack.peek();
- // Get existing imported module names
- String[] importedModuleNames = parentType.getIncludedModuleNames();
- List<String> mergedModuleNames = new LinkedList<String>();
-
- // Merge newly found module name(s)
- if ( importedModuleNames != null ) {
- mergedModuleNames.addAll( (Arrays.asList( importedModuleNames )));
- }
- mergedModuleNames.addAll( mixins );
-
- // Apply included module names back to parent type info
- String[] newIncludedModuleNames = mergedModuleNames.toArray(new String[]{});
- parentType.setIncludedModuleNames( newIncludedModuleNames );
+ // Get existing imported module names
+ String[] importedModuleNames = parentType.getIncludedModuleNames();
+ List<String> mergedModuleNames = new LinkedList<String>();
+
+ // Merge newly found module name(s)
+ if ( importedModuleNames != null ) {
+ mergedModuleNames.addAll( (Arrays.asList( importedModuleNames )));
}
-
+ mergedModuleNames.addAll( mixins );
+ // Apply included module names back to parent type info
+ String[] newIncludedModuleNames = mergedModuleNames.toArray(new String[]{});
+ parentType.setIncludedModuleNames( newIncludedModuleNames );
}
- visitNode(iVisited.getArgsNode());
- visitNode(iVisited.getIterNode());
- return null;
}
/**
@@ -1344,8 +1349,6 @@
info.setHandle(module);
ISourcePosition pos = iVisited.getPosition();
setKeywordRange(MODULE_KEYWORD, pos, info, name);
- // TODO Set super module better! set Module if null, set nothing if name is Module.
- info.setSuperclassName(MODULE);
infoStack.push(info);
newElements.put(module, info);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-09 17:20:41
|
Revision: 2121
http://svn.sourceforge.net/rubyeclipse/?rev=2121&view=rev
Author: mirkostocker
Date: 2007-03-09 09:20:36 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
code cleanup: remove unnecessary casts, organize imports
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryStandin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -3,8 +3,6 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyModelException;
-import com.sun.org.apache.xpath.internal.operations.Gte;
-
public class CompletionContext {
private IRubyScript script;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -190,7 +190,7 @@
public void updateRubyModel(IRubyElementDelta customDelta) {
if (customDelta == null) {
for (int i = 0, length = this.rubyModelDeltas.size(); i < length; i++) {
- IRubyElementDelta delta = (IRubyElementDelta) this.rubyModelDeltas.get(i);
+ IRubyElementDelta delta = this.rubyModelDeltas.get(i);
this.modelUpdater.processRubyDelta(delta);
}
} else {
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -389,7 +389,7 @@
* Returns an empty stack if no operations are currently running in this thread.
*/
protected ArrayList<RubyModelOperation> getCurrentOperationStack() {
- ArrayList<RubyModelOperation> stack = (ArrayList<RubyModelOperation>)operationStacks.get();
+ ArrayList<RubyModelOperation> stack = operationStacks.get();
if (stack == null) {
stack = new ArrayList<RubyModelOperation>();
operationStacks.set(stack);
@@ -585,7 +585,7 @@
}
}
- RubyModelOperation topLevelOp = (RubyModelOperation)getCurrentOperationStack().get(0);
+ RubyModelOperation topLevelOp = getCurrentOperationStack().get(0);
IPostAction[] postActions = topLevelOp.actions;
if (postActions == null) {
topLevelOp.actions = postActions = new IPostAction[1];
@@ -640,7 +640,7 @@
System.out.println("(" + Thread.currentThread() + ") [RubyModelOperation.removeAllPostAction(String)] Removing actions " + actionID); //$NON-NLS-1$ //$NON-NLS-2$
}
- RubyModelOperation topLevelOp = (RubyModelOperation)getCurrentOperationStack().get(0);
+ RubyModelOperation topLevelOp = getCurrentOperationStack().get(0);
IPostAction[] postActions = topLevelOp.actions;
if (postActions == null) return;
int index = this.actionsStart-1;
@@ -684,7 +684,7 @@
// update RubyModel using deltas that were recorded during this operation
for (int i = previousDeltaCount, size = deltaProcessor.rubyModelDeltas.size(); i < size; i++) {
- deltaProcessor.updateRubyModel((IRubyElementDelta)deltaProcessor.rubyModelDeltas.get(i));
+ deltaProcessor.updateRubyModel(deltaProcessor.rubyModelDeltas.get(i));
}
// close the parents of the created elements and reset their project's cache (in case we are in an
@@ -757,7 +757,7 @@
* Registers the given attribute at the given key with the top level operation.
*/
protected void setAttribute(Object key, Object attribute) {
- RubyModelOperation topLevelOp = (RubyModelOperation)this.getCurrentOperationStack().get(0);
+ RubyModelOperation topLevelOp = this.getCurrentOperationStack().get(0);
if (topLevelOp.attributes == null) {
topLevelOp.attributes = new HashMap<Object, Object>();
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -22,7 +22,7 @@
public ThreadInfo[] readThreads() throws XmlPullParserException, IOException, XmlStreamReaderException {
this.read();
- return (ThreadInfo[]) threads.toArray(new ThreadInfo[threads.size()]);
+ return threads.toArray(new ThreadInfo[threads.size()]);
}
protected boolean processStartElement(XmlPullParser xpp) {
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/launcher/LoadPathEntryLabelProvider.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -1,11 +1,9 @@
package org.rubypeople.rdt.internal.debug.ui.launcher;
-import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
import org.rubypeople.rdt.core.ILoadpathEntry;
-import org.rubypeople.rdt.internal.core.LoadpathEntry;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiPlugin;
public class LoadPathEntryLabelProvider implements ILabelProvider {
Modified: 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 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/AddVMDialog.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -335,7 +335,7 @@
} 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()}));
+ status.setError(MessageFormat.format(RubyVMMessages.AddVMDialog_JRE_name_must_be_a_valid_file_name___0__1, s.getMessage()));
}
}
}
Modified: 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 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryStandin.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -106,7 +106,7 @@
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);
+ MessageFormat.format(RubyVMMessages.LibraryStandin_0, getSystemLibraryPath().toOSString()), null);
}
return Status.OK_STATUS;
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -148,7 +148,7 @@
ordered.add(runtimeEntries[i]);
}
}
- return (IRuntimeLoadpathEntry[]) ordered.toArray(new IRuntimeLoadpathEntry[ordered.size()]);
+ return ordered.toArray(new IRuntimeLoadpathEntry[ordered.size()]);
}
/**
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -437,7 +437,7 @@
Iterator locations = fgLibraryInfoMap.keySet().iterator();
while (locations.hasNext()) {
String home = (String)locations.next();
- LibraryInfo info = (LibraryInfo) fgLibraryInfoMap.get(home);
+ LibraryInfo info = fgLibraryInfoMap.get(home);
Element locationElemnet = infoAsElement(doc, info);
locationElemnet.setAttribute("home", home); //$NON-NLS-1$
config.appendChild(locationElemnet);
@@ -494,7 +494,7 @@
if (fgLibraryInfoMap == null) {
restoreLibraryInfo();
}
- return (LibraryInfo) fgLibraryInfoMap.get(javaInstallPath);
+ return fgLibraryInfoMap.get(javaInstallPath);
}
/**
@@ -574,7 +574,7 @@
}
}
}
- return (String[])paths.toArray(new String[paths.size()]);
+ return paths.toArray(new String[paths.size()]);
}
/**
@@ -588,7 +588,7 @@
if (fClasspathEntryExtensions == null) {
initializeRuntimeLoadpathExtensions();
}
- IConfigurationElement config = (IConfigurationElement) fClasspathEntryExtensions.get(id);
+ IConfigurationElement config = fClasspathEntryExtensions.get(id);
if (config == null) {
abort(MessageFormat.format(LaunchingMessages.LaunchingPlugin_32, id), null);
}
@@ -764,7 +764,7 @@
String firstSegment = reference.segment(0);
if (RubyRuntime.RUBY_CONTAINER.equals(firstSegment)) {
if (reference.segmentCount() > 1) {
- IPath renamed = (IPath)fRenamedContainerIds.get(reference);
+ IPath renamed = fRenamedContainerIds.get(reference);
if (renamed != null) {
// The JRE was re-named. This changes the identifier of
// the container entry.
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -100,7 +100,7 @@
String dir = libraryPath.toFile().getParent();
resolvedEntries.add(resolveLibraryLocation(vm, location, kind, overrideRubydoc));
}
- return (IRuntimeLoadpathEntry[]) resolvedEntries.toArray(new IRuntimeLoadpathEntry[resolvedEntries.size()]);
+ return resolvedEntries.toArray(new IRuntimeLoadpathEntry[resolvedEntries.size()]);
}
}
}
@@ -111,7 +111,7 @@
resolvedEntries.add(resolveLibraryLocation(vm, libs[i], kind, overrideRubydoc));
}
}
- return (IRuntimeLoadpathEntry[]) resolvedEntries.toArray(new IRuntimeLoadpathEntry[resolvedEntries.size()]);
+ return resolvedEntries.toArray(new IRuntimeLoadpathEntry[resolvedEntries.size()]);
}
/**
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-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -128,7 +128,7 @@
String installPath = rubyHome.getAbsolutePath();
LibraryInfo info = LaunchingPlugin.getLibraryInfo(installPath);
if (info == null) {
- info= (LibraryInfo)fgFailedInstallPath.get(installPath);
+ info= fgFailedInstallPath.get(installPath);
if (info == null) {
info = generateLibraryInfo(rubyHome, rubyExecutable);
if (info == null) {
@@ -201,7 +201,7 @@
if (lines.size() > 0) {
String version = lines.remove(0);
if (lines.size() > 0) {
- String[] loadpath = (String[]) lines.toArray(new String[lines.size()]);
+ String[] loadpath = lines.toArray(new String[lines.size()]);
return new LibraryInfo(version, loadpath);
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -104,7 +104,7 @@
public void addVM(IVMInstall vm) {
if (!fVMList.contains(vm)) {
IVMInstallType vmInstallType = vm.getVMInstallType();
- List<IVMInstall> vmList = (List<IVMInstall>) fVMTypeToVMMap.get(vmInstallType);
+ List<IVMInstall> vmList = fVMTypeToVMMap.get(vmInstallType);
if (vmList == null) {
vmList = new ArrayList<IVMInstall>(3);
fVMTypeToVMMap.put(vmInstallType, vmList);
@@ -493,7 +493,7 @@
}
}
}
- vm.setLibraryLocations((IPath[])locations.toArray(new IPath[locations.size()]));
+ vm.setLibraryLocations(locations.toArray(new IPath[locations.size()]));
}
/**
@@ -504,7 +504,7 @@
public void removeVM(IVMInstall vm) {
fVMList.remove(vm);
fInvalidVMList.remove(vm);
- List list = (List) fVMTypeToVMMap.get(vm.getVMInstallType());
+ List list = fVMTypeToVMMap.get(vm.getVMInstallType());
if (list != null) {
list.remove(vm);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMRunner.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMRunner.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -22,7 +22,6 @@
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IProcess;
import org.rubypeople.rdt.internal.launching.LaunchingMessages;
-import org.rubypeople.rdt.internal.launching.LaunchingPlugin;
/**
* Abstract implementation of a VM runner.
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-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -1290,7 +1290,7 @@
}
}
loadpathEntries.add(newDefaultProjectLoadpathEntry(project));
- return (IRuntimeLoadpathEntry[]) loadpathEntries.toArray(new IRuntimeLoadpathEntry[loadpathEntries.size()]);
+ return loadpathEntries.toArray(new IRuntimeLoadpathEntry[loadpathEntries.size()]);
}
/**
@@ -1424,8 +1424,8 @@
break;
}
List<IRuntimeLoadpathEntry> resolved = new ArrayList<IRuntimeLoadpathEntry>(cpes.length);
- List<IRubyProject> projects = (List<IRubyProject>) fgProjects.get();
- Integer count = (Integer) fgEntryCount.get();
+ List<IRubyProject> projects = fgProjects.get();
+ Integer count = fgEntryCount.get();
if (projects == null) {
projects = new ArrayList<IRubyProject>();
fgProjects.set(projects);
@@ -1470,7 +1470,7 @@
// set loadpath property
IRuntimeLoadpathEntry[] result = new IRuntimeLoadpathEntry[resolved.size()];
for (int i = 0; i < result.length; i++) {
- result[i] = (IRuntimeLoadpathEntry) resolved.get(i);
+ result[i] = resolved.get(i);
result[i].setLoadpathProperty(property);
}
return result;
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -465,7 +465,7 @@
int testCount = Integer.parseInt(treeEntry.substring(index2 + 1));
TreeItem treeItem;
- while ((fSuiteInfos.size() > 0) && (((SuiteInfo) fSuiteInfos.lastElement()).fTestCount == 0)) {
+ while ((fSuiteInfos.size() > 0) && ((fSuiteInfos.lastElement()).fTestCount == 0)) {
fSuiteInfos.removeElementAt(fSuiteInfos.size() - 1);
}
@@ -474,14 +474,14 @@
treeItem.setImage(fSuiteIcon);
fSuiteInfos.addElement(new SuiteInfo(treeItem, testCount));
} else if (isSuite.equals("true")) { //$NON-NLS-1$
- treeItem = new TreeItem(((SuiteInfo) fSuiteInfos.lastElement()).fTreeItem, SWT.NONE);
+ treeItem = new TreeItem((fSuiteInfos.lastElement()).fTreeItem, SWT.NONE);
treeItem.setImage(fSuiteIcon);
- ((SuiteInfo) fSuiteInfos.lastElement()).fTestCount -= 1;
+ (fSuiteInfos.lastElement()).fTestCount -= 1;
fSuiteInfos.addElement(new SuiteInfo(treeItem, testCount));
} else {
- treeItem = new TreeItem(((SuiteInfo) fSuiteInfos.lastElement()).fTreeItem, SWT.NONE);
+ treeItem = new TreeItem((fSuiteInfos.lastElement()).fTreeItem, SWT.NONE);
treeItem.setImage(fTestIcon);
- ((SuiteInfo) fSuiteInfos.lastElement()).fTestCount -= 1;
+ (fSuiteInfos.lastElement()).fTestCount -= 1;
mapTest(testInfo, treeItem);
}
treeItem.setText(testInfo.getTestMethodName());
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java 2007-03-09 17:09:15 UTC (rev 2120)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java 2007-03-09 17:20:36 UTC (rev 2121)
@@ -253,7 +253,7 @@
loadTestRunTabs(tabFolder);
tabFolder.setSelection(0);
- fActiveRunTab = (TestRunTab) fTestRunTabs.firstElement();
+ fActiveRunTab = fTestRunTabs.firstElement();
tabFolder.addSelectionListener(new SelectionAdapter() {
@@ -342,7 +342,7 @@
public TestRunInfo getTestInfo(String testId) {
if (testId == null) return null;
- return (TestRunInfo) fTestInfos.get(testId);
+ return fTestInfos.get(testId);
}
private void showFailure(final TestRunInfo failure) {
@@ -862,7 +862,7 @@
}
protected void selectFirstFailure() {
- TestRunInfo firstFailure = (TestRunInfo) fFailures.get(0);
+ TestRunInfo firstFailure = fFailures.get(0);
if (firstFailure != null && fAutoScroll) {
fActiveRunTab.setSelectedTest(firstFailure.getTestId());
handleTestSelected(firstFailure.getTestId());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-09 17:09:20
|
Revision: 2120
http://svn.sourceforge.net/rubyeclipse/?rev=2120&view=rev
Author: mirkostocker
Date: 2007-03-09 09:09:15 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
more renaming..
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineTempAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/Messages.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/MethodCallReplaceProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/TempInliner.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/TempValueReplaceProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/messages.properties
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/messages.properties
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineTempPage.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/TempInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/InlineTempConditionTester.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/
Modified: trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF 2007-03-09 17:09:15 UTC (rev 2120)
@@ -17,8 +17,8 @@
org.rubypeople.rdt.refactoring.core.generateaccessors,
org.rubypeople.rdt.refactoring.core.generateconstructor,
org.rubypeople.rdt.refactoring.core.inlineclass,
+ org.rubypeople.rdt.refactoring.core.inlinelocal,
org.rubypeople.rdt.refactoring.core.inlinemethod,
- org.rubypeople.rdt.refactoring.core.inlinetemp,
org.rubypeople.rdt.refactoring.core.mergeclasspartsinfile,
org.rubypeople.rdt.refactoring.core.mergewithexternalclassparts,
org.rubypeople.rdt.refactoring.core.movefield,
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineTempAction.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineTempAction.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/InlineTempAction.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -30,7 +30,7 @@
package org.rubypeople.rdt.refactoring.action;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempRefactoring;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempRefactoring;
public class InlineTempAction extends WorkbenchWindowActionDelegate {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -39,8 +39,8 @@
import org.rubypeople.rdt.refactoring.core.generateaccessors.GenerateAccessorsRefactoring;
import org.rubypeople.rdt.refactoring.core.generateconstructor.GenerateConstructorRefactoring;
import org.rubypeople.rdt.refactoring.core.inlineclass.InlineClassRefactoring;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempRefactoring;
import org.rubypeople.rdt.refactoring.core.inlinemethod.InlineMethodRefactoring;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempRefactoring;
import org.rubypeople.rdt.refactoring.core.mergeclasspartsinfile.MergeClassPartsInFileRefactoring;
import org.rubypeople.rdt.refactoring.core.mergewithexternalclassparts.MergeWithExternalClassPartsRefactoring;
import org.rubypeople.rdt.refactoring.core.movefield.MoveFieldRefactoring;
Copied: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal (from rev 2117, trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp)
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempConditionChecker.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -28,7 +28,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import java.util.ArrayList;
import java.util.Collection;
@@ -99,26 +99,26 @@
@Override
protected void checkFinalConditions() {
if (!isNewMethodNameUnique()) {
- addError(Messages.InlineTempConditionChecker_NameNotUnique);
+ addError(Messages.InlineLocalConditionChecker_NameNotUnique);
}
}
@Override
protected void checkInitialConditions() {
if (config.getSelectedItem() == null) {
- addError(Messages.InlineTempConditionChecker_NoLocalVariable);
+ addError(Messages.InlineLocalConditionChecker_NoLocalVariable);
} else if (isTempParameter()) {
- addError(Messages.InlineTempConditionChecker_CannotMethodParameters);
+ addError(Messages.InlineLocalConditionChecker_CannotMethodParameters);
} else if (isBlockArgument()) {
- addError(Messages.InlineTempConditionChecker_CannotBlockArgument);
+ addError(Messages.InlineLocalConditionChecker_CannotBlockArgument);
} else if (isTempMultiassigned()) {
- addError(Messages.InlineTempConditionChecker_CannotMultiAssigned);
+ addError(Messages.InlineLocalConditionChecker_CannotMultiAssigned);
} else if (defintiontionContainsItself()) {
- addError(Messages.InlineTempConditionChecker_CannotSelfReferencing);
+ addError(Messages.InlineLocalConditionChecker_CannotSelfReferencing);
} else if (isMultipleAsgnNode()) {
- addError(Messages.InlineTempConditionChecker_CannotMultipleAssignments);
+ addError(Messages.InlineLocalConditionChecker_CannotMultipleAssignments);
} else if (!hasTarget()) {
- addError(Messages.InlineTempConditionChecker_NoTarget);
+ addError(Messages.InlineLocalConditionChecker_NoTarget);
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConfig.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempConfig.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -28,7 +28,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import java.util.Collection;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempRefactoring.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/InlineTempRefactoring.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -28,7 +28,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import org.rubypeople.rdt.refactoring.core.RubyRefactoring;
import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
@@ -36,7 +36,7 @@
public class InlineTempRefactoring extends RubyRefactoring {
- public static final String NAME = Messages.InlineTempRefactoring_Name;
+ public static final String NAME = Messages.InlineLocalRefactoring_Name;
private TempInliner tempInliner;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/Messages.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/Messages.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/Messages.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -1,27 +1,27 @@
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.rubypeople.rdt.refactoring.core.inlinetemp.messages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.rubypeople.rdt.refactoring.core.inlinelocal.messages"; //$NON-NLS-1$
- public static String InlineTempConditionChecker_CannotBlockArgument;
+ public static String InlineLocalConditionChecker_CannotBlockArgument;
- public static String InlineTempConditionChecker_CannotMethodParameters;
+ public static String InlineLocalConditionChecker_CannotMethodParameters;
- public static String InlineTempConditionChecker_CannotMultiAssigned;
+ public static String InlineLocalConditionChecker_CannotMultiAssigned;
- public static String InlineTempConditionChecker_CannotMultipleAssignments;
+ public static String InlineLocalConditionChecker_CannotMultipleAssignments;
- public static String InlineTempConditionChecker_CannotSelfReferencing;
+ public static String InlineLocalConditionChecker_CannotSelfReferencing;
- public static String InlineTempConditionChecker_NameNotUnique;
+ public static String InlineLocalConditionChecker_NameNotUnique;
- public static String InlineTempConditionChecker_NoLocalVariable;
+ public static String InlineLocalConditionChecker_NoLocalVariable;
- public static String InlineTempConditionChecker_NoTarget;
+ public static String InlineLocalConditionChecker_NoTarget;
- public static String InlineTempRefactoring_Name;
+ public static String InlineLocalRefactoring_Name;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/MethodCallReplaceProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/MethodCallReplaceProvider.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/MethodCallReplaceProvider.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -28,7 +28,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import org.jruby.ast.Node;
import org.jruby.ast.visitor.rewriter.FormatHelper;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/TempInliner.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/TempInliner.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/TempInliner.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -28,7 +28,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import java.util.ArrayList;
import java.util.Collection;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/TempValueReplaceProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/TempValueReplaceProvider.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/TempValueReplaceProvider.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -28,7 +28,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.inlinetemp;
+package org.rubypeople.rdt.refactoring.core.inlinelocal;
import org.jruby.ast.Node;
import org.jruby.lexer.yacc.ISourcePosition;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/messages.properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/messages.properties 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinelocal/messages.properties 2007-03-09 17:09:15 UTC (rev 2120)
@@ -1,9 +1,9 @@
-InlineTempRefactoring_Name=Inline Local Variable
-InlineTempConditionChecker_NameNotUnique=New method name is not unique.
-InlineTempConditionChecker_NoLocalVariable=There is no local variable at the current carret position.
-InlineTempConditionChecker_CannotMethodParameters=Cannot inline method parameters.
-InlineTempConditionChecker_CannotBlockArgument=Cannot inline block argument
-InlineTempConditionChecker_CannotMultiAssigned=Cannot inline a multi assigned local variable.
-InlineTempConditionChecker_CannotSelfReferencing=Cannot inline a local variable that uses its own value in the assignment.
-InlineTempConditionChecker_CannotMultipleAssignments=Inline in multiple assignments not jet supported.
-InlineTempConditionChecker_NoTarget=No target found to inline the selected variable.
+InlineLocalRefactoring_Name=Inline Local Variable
+InlineLocalConditionChecker_NameNotUnique=New method name is not unique.
+InlineLocalConditionChecker_NoLocalVariable=There is no local variable at the current carret position.
+InlineLocalConditionChecker_CannotMethodParameters=Cannot inline method parameters.
+InlineLocalConditionChecker_CannotBlockArgument=Cannot inline block argument
+InlineLocalConditionChecker_CannotMultiAssigned=Cannot inline a multi assigned local variable.
+InlineLocalConditionChecker_CannotSelfReferencing=Cannot inline a local variable that uses its own value in the assignment.
+InlineLocalConditionChecker_CannotMultipleAssignments=Inline in multiple assignments not jet supported.
+InlineLocalConditionChecker_NoTarget=No target found to inline the selected variable.
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -3,7 +3,7 @@
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.rubypeople.rdt.refactoring.core.renamelocalvariable.messages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.rubypeople.rdt.refactoring.core.renamelocal.messages"; //$NON-NLS-1$
public static String LocalVariableRenamer_Modified;
@@ -17,7 +17,7 @@
public static String RenameLocalConditionChecker_SameName;
- public static String RenameLocalVariableRefactoring_Name;
+ public static String RenameLocalRefactoring_Name;
public static String VariableNameProvider_NoValidName;
static {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -35,7 +35,7 @@
public class RenameLocalRefactoring extends RubyRefactoring {
- public static final String NAME = Messages.RenameLocalVariableRefactoring_Name;
+ public static final String NAME = Messages.RenameLocalRefactoring_Name;
public RenameLocalRefactoring(TextSelectionProvider selectionProvider) {
super(NAME);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/messages.properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/messages.properties 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/messages.properties 2007-03-09 17:09:15 UTC (rev 2120)
@@ -1,4 +1,4 @@
-RenameLocalVariableRefactoring_Name=Rename Local Variable
+RenameLocalRefactoring_Name=Rename Local Variable
RenameLocalConditionChecker_NameInvalid=Please enter a valid name for the variable.
RenameLocalConditionChecker_NoSelection=No variable selected. Please select the variable you want to rename.
RenameLocalConditionChecker_NoLocalVariable=There are no local variables at the current carret position.
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineTempPage.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineTempPage.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineTempPage.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -42,8 +42,8 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempConfig;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempRefactoring;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempRefactoring;
import org.rubypeople.rdt.refactoring.ui.LabeledTextField;
import org.rubypeople.rdt.refactoring.util.NameValidator;
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/TempInlinerTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/TempInlinerTester.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/TempInlinerTester.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -34,9 +34,9 @@
import java.io.IOException;
import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempConditionChecker;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempConfig;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.TempInliner;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempConditionChecker;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.TempInliner;
import org.rubypeople.rdt.refactoring.tests.FileTestData;
import org.rubypeople.rdt.refactoring.tests.RefactoringTestCase;
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/InlineTempConditionTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/InlineTempConditionTester.java 2007-03-09 16:49:52 UTC (rev 2119)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlinetemp/conditionchecks/InlineTempConditionTester.java 2007-03-09 17:09:15 UTC (rev 2120)
@@ -33,9 +33,9 @@
import java.io.FileNotFoundException;
import java.io.IOException;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempConditionChecker;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.InlineTempConfig;
-import org.rubypeople.rdt.refactoring.core.inlinetemp.TempInliner;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempConditionChecker;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.InlineTempConfig;
+import org.rubypeople.rdt.refactoring.core.inlinelocal.TempInliner;
import org.rubypeople.rdt.refactoring.tests.FileTestData;
import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-09 16:49:53
|
Revision: 2119
http://svn.sourceforge.net/rubyeclipse/?rev=2119&view=rev
Author: mirkostocker
Date: 2007-03-09 08:49:52 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
more renaming..
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -34,7 +34,7 @@
import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
import org.rubypeople.rdt.refactoring.core.renameclass.RenameClassRefactoring;
import org.rubypeople.rdt.refactoring.core.renamefield.RenameFieldRefactoring;
-import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalVariableRefactoring;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalRefactoring;
import org.rubypeople.rdt.refactoring.core.renamemethod.RenameMethodRefactoring;
public class RenameRefactoring extends RubyRefactoring {
@@ -50,7 +50,7 @@
setRefactoringConditionChecker(checker);
if(checker.shouldPerform()) {
if(checker.shouldRenameLocal()) {
- delegateRenameRefactoring = new RenameLocalVariableRefactoring(selectionProvider);
+ delegateRenameRefactoring = new RenameLocalRefactoring(selectionProvider);
} else if (checker.shouldRenameField()) {
delegateRenameRefactoring = new RenameFieldRefactoring(selectionProvider);
} else if(checker.shouldRenameMethod()) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -49,7 +49,7 @@
public TextEdit getEdit() {
RenameLocalConfig config = new RenameLocalConfig(doc, 0);
new RenameLocalConditionChecker(config);
- LocalVariablesEditProvider editProvider = new LocalVariablesEditProvider(config);
+ RenameLocalEditProvider editProvider = new RenameLocalEditProvider(config);
editProvider.setSelectedVariableName(from);
editProvider.setNewVariableName(to);
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -1,112 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.renamelocal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Observable;
-import java.util.Observer;
-
-import org.jruby.ast.DAsgnNode;
-import org.jruby.ast.DVarNode;
-import org.jruby.ast.MethodDefNode;
-import org.jruby.ast.Node;
-import org.rubypeople.rdt.refactoring.editprovider.EditProvider;
-import org.rubypeople.rdt.refactoring.editprovider.MultiEditProvider;
-import org.rubypeople.rdt.refactoring.util.NodeUtil;
-
-public class LocalVariablesEditProvider extends MultiEditProvider implements Observer {
-
- private static final class AbortOnScope implements IAbortCondition {
- public boolean abort(Node currentNode) {
- return NodeUtil.hasScope(currentNode);
- }
- }
-
- private static final class AbortOnMethodDef implements IAbortCondition {
- public boolean abort(Node currentNode) {
- return currentNode instanceof MethodDefNode;
- }
- }
-
- private String selectedVariableName = ""; //$NON-NLS-1$
-
- private String newVariableName = ""; //$NON-NLS-1$
-
- private final RenameLocalConfig config;
-
- public LocalVariablesEditProvider(RenameLocalConfig config) {
- this.config = config;
- config.setLocalVariablesEditProvider(this);
- }
-
- public void setSelectedVariableName(String name) {
- selectedVariableName = name;
- }
-
- public String getSelectedVariableName() {
- return selectedVariableName;
- }
-
- public void setNewVariableName(String name) {
- newVariableName = name;
- }
-
- public String getNewVariableName() {
- return newVariableName;
- }
-
- private ArrayList<Node> renameVariables() {
- VariableRenamer renamer = null;
- if (config.getSelectedNode() instanceof DVarNode || config.getSelectedNode() instanceof DAsgnNode) {
- renamer = new DynamicVariableRenamer(selectedVariableName, newVariableName, new AbortOnScope());
- } else {
- renamer = new VariableRenamer(selectedVariableName, newVariableName, new AbortOnMethodDef());
- }
-
- ArrayList<Node> changedNodes = renamer.replaceVariableNamesInNode(config.getSelectedMethod(), config.getLocalNames());
- return changedNodes;
- }
-
- public void update(Observable subject, Object arg1) {
- if(subject instanceof VariableNameProvider) {
- setSelectedVariableName(((VariableNameProvider) subject).getSelected());
- setNewVariableName(((VariableNameProvider) subject).getName());
- }
- }
-
- @Override
- protected Collection<EditProvider> getEditProviders() {
- Collection<EditProvider> edits = new ArrayList<EditProvider>();
- for (Node n : renameVariables()) {
- edits.add(new SingleLocalVariableEdit(n, config.getLocalNames()));
- }
- return edits;
- }
-}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -123,7 +123,7 @@
@Override
protected void checkFinalConditions() {
- LocalVariablesEditProvider editProvider = config.getRenameEditProvider();
+ RenameLocalEditProvider editProvider = config.getRenameEditProvider();
if (editProvider.getSelectedVariableName().equals("") && editProvider.getNewVariableName().equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
addError(NO_VARIABLE_SELECTED);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -41,7 +41,7 @@
private Node selectedNode;
private Node selectedMethod;
private String[] localNames;
- private LocalVariablesEditProvider editProvider;
+ private RenameLocalEditProvider editProvider;
public RenameLocalConfig(IDocumentProvider docProvider, int caretPosition) {
this.docProvider = docProvider;
@@ -85,11 +85,11 @@
return localNames;
}
- public void setLocalVariablesEditProvider(LocalVariablesEditProvider editProvider) {
+ public void setLocalVariablesEditProvider(RenameLocalEditProvider editProvider) {
this.editProvider = editProvider;
}
- public LocalVariablesEditProvider getRenameEditProvider() {
+ public RenameLocalEditProvider getRenameEditProvider() {
return editProvider;
}
Copied: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalEditProvider.java (from rev 2118, trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalEditProvider.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalEditProvider.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -0,0 +1,112 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.core.renamelocal;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Observable;
+import java.util.Observer;
+
+import org.jruby.ast.DAsgnNode;
+import org.jruby.ast.DVarNode;
+import org.jruby.ast.MethodDefNode;
+import org.jruby.ast.Node;
+import org.rubypeople.rdt.refactoring.editprovider.EditProvider;
+import org.rubypeople.rdt.refactoring.editprovider.MultiEditProvider;
+import org.rubypeople.rdt.refactoring.util.NodeUtil;
+
+public class RenameLocalEditProvider extends MultiEditProvider implements Observer {
+
+ private static final class AbortOnScope implements IAbortCondition {
+ public boolean abort(Node currentNode) {
+ return NodeUtil.hasScope(currentNode);
+ }
+ }
+
+ private static final class AbortOnMethodDef implements IAbortCondition {
+ public boolean abort(Node currentNode) {
+ return currentNode instanceof MethodDefNode;
+ }
+ }
+
+ private String selectedVariableName = ""; //$NON-NLS-1$
+
+ private String newVariableName = ""; //$NON-NLS-1$
+
+ private final RenameLocalConfig config;
+
+ public RenameLocalEditProvider(RenameLocalConfig config) {
+ this.config = config;
+ config.setLocalVariablesEditProvider(this);
+ }
+
+ public void setSelectedVariableName(String name) {
+ selectedVariableName = name;
+ }
+
+ public String getSelectedVariableName() {
+ return selectedVariableName;
+ }
+
+ public void setNewVariableName(String name) {
+ newVariableName = name;
+ }
+
+ public String getNewVariableName() {
+ return newVariableName;
+ }
+
+ private ArrayList<Node> renameVariables() {
+ VariableRenamer renamer = null;
+ if (config.getSelectedNode() instanceof DVarNode || config.getSelectedNode() instanceof DAsgnNode) {
+ renamer = new DynamicVariableRenamer(selectedVariableName, newVariableName, new AbortOnScope());
+ } else {
+ renamer = new VariableRenamer(selectedVariableName, newVariableName, new AbortOnMethodDef());
+ }
+
+ ArrayList<Node> changedNodes = renamer.replaceVariableNamesInNode(config.getSelectedMethod(), config.getLocalNames());
+ return changedNodes;
+ }
+
+ public void update(Observable subject, Object arg1) {
+ if(subject instanceof VariableNameProvider) {
+ setSelectedVariableName(((VariableNameProvider) subject).getSelected());
+ setNewVariableName(((VariableNameProvider) subject).getName());
+ }
+ }
+
+ @Override
+ protected Collection<EditProvider> getEditProviders() {
+ Collection<EditProvider> edits = new ArrayList<EditProvider>();
+ for (Node n : renameVariables()) {
+ edits.add(new SingleLocalVariableEdit(n, config.getLocalNames()));
+ }
+ return edits;
+ }
+}
Copied: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java (from rev 2118, trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalRefactoring.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -0,0 +1,62 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.core.renamelocal;
+
+import org.rubypeople.rdt.refactoring.core.RubyRefactoring;
+import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.ui.pages.RenamePage;
+
+public class RenameLocalRefactoring extends RubyRefactoring {
+
+ public static final String NAME = Messages.RenameLocalVariableRefactoring_Name;
+
+ public RenameLocalRefactoring(TextSelectionProvider selectionProvider) {
+ super(NAME);
+
+ DocumentProvider docProvider = getDocumentProvider();
+
+ RenameLocalConfig config = new RenameLocalConfig(docProvider, selectionProvider.getCarretPosition());
+ RenameLocalConditionChecker checker = new RenameLocalConditionChecker(config);
+ setRefactoringConditionChecker(checker);
+
+ if(checker.shouldPerform()) {
+ RenameLocalEditProvider editProvider = new RenameLocalEditProvider(config);
+ setEditProvider(editProvider);
+
+ String name = config.getSelectedNodeName();
+ editProvider.setSelectedVariableName(name);
+ editProvider.setNewVariableName(name);
+
+ VariableNameProvider nameProvider = new VariableNameProvider(name);
+ pages.add(new RenamePage(name, nameProvider));
+ nameProvider.addObserver(editProvider);
+ }
+ }
+}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -1,62 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
- * Version: CPL 1.0/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Common Public
- * License Version 1.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.eclipse.org/legal/cpl-v10.html
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * Copyright (C) 2006 Mirko Stocker <me...@mi...>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the CPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the CPL, the GPL or the LGPL.
- ***** END LICENSE BLOCK *****/
-
-package org.rubypeople.rdt.refactoring.core.renamelocal;
-
-import org.rubypeople.rdt.refactoring.core.RubyRefactoring;
-import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
-import org.rubypeople.rdt.refactoring.ui.pages.RenamePage;
-
-public class RenameLocalVariableRefactoring extends RubyRefactoring {
-
- public static final String NAME = Messages.RenameLocalVariableRefactoring_Name;
-
- public RenameLocalVariableRefactoring(TextSelectionProvider selectionProvider) {
- super(NAME);
-
- DocumentProvider docProvider = getDocumentProvider();
-
- RenameLocalConfig config = new RenameLocalConfig(docProvider, selectionProvider.getCarretPosition());
- RenameLocalConditionChecker checker = new RenameLocalConditionChecker(config);
- setRefactoringConditionChecker(checker);
-
- if(checker.shouldPerform()) {
- LocalVariablesEditProvider editProvider = new LocalVariablesEditProvider(config);
- setEditProvider(editProvider);
-
- String name = config.getSelectedNodeName();
- editProvider.setSelectedVariableName(name);
- editProvider.setNewVariableName(name);
-
- VariableNameProvider nameProvider = new VariableNameProvider(name);
- pages.add(new RenamePage(name, nameProvider));
- nameProvider.addObserver(editProvider);
- }
- }
-}
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java 2007-03-09 16:43:33 UTC (rev 2118)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java 2007-03-09 16:49:52 UTC (rev 2119)
@@ -32,7 +32,7 @@
import java.io.IOException;
import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.renamelocal.LocalVariablesEditProvider;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalEditProvider;
import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConditionChecker;
import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConfig;
import org.rubypeople.rdt.refactoring.tests.FileTestCase;
@@ -56,7 +56,7 @@
if(!checker.shouldPerform()) {
fail();
}
- new LocalVariablesEditProvider(config);
+ new RenameLocalEditProvider(config);
config.getRenameEditProvider().setSelectedVariableName(config.getSelectedNodeName());
config.getRenameEditProvider().setNewVariableName(testData.getProperty("name"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-09 16:43:41
|
Revision: 2118
http://svn.sourceforge.net/rubyeclipse/?rev=2118&view=rev
Author: mirkostocker
Date: 2007-03-09 08:43:33 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
rename 'renamelocalvariable' to 'renamelocal'
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/DynamicVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/IAbortCondition.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/SingleLocalVariableEdit.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/VariableNameProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/VariableRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplittedVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/RenameLocalConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TC_SplittedVariableRenamer.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/
Modified: trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/META-INF/MANIFEST.MF 2007-03-09 16:43:33 UTC (rev 2118)
@@ -29,7 +29,7 @@
org.rubypeople.rdt.refactoring.core.renameclass,
org.rubypeople.rdt.refactoring.core.renamefield,
org.rubypeople.rdt.refactoring.core.renamefield.fielditems,
- org.rubypeople.rdt.refactoring.core.renamelocalvariable,
+ org.rubypeople.rdt.refactoring.core.renamelocal,
org.rubypeople.rdt.refactoring.core.renamemethod,
org.rubypeople.rdt.refactoring.core.renamemethod.methoditems,
org.rubypeople.rdt.refactoring.core.splittemp,
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -42,7 +42,7 @@
import org.jruby.ast.types.INameNode;
import org.jruby.ast.visitor.rewriter.ReWriteVisitor;
import org.jruby.lexer.yacc.SourcePosition;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.LocalVariableRenamer;
+import org.rubypeople.rdt.refactoring.core.renamelocal.LocalVariableRenamer;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -29,7 +29,7 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
import org.jruby.ast.RootNode;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.LocalVariableRenamer;
+import org.rubypeople.rdt.refactoring.core.renamelocal.LocalVariableRenamer;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
import org.rubypeople.rdt.refactoring.util.NameHelper;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -35,8 +35,8 @@
import org.rubypeople.rdt.refactoring.core.renameclass.RenameClassConfig;
import org.rubypeople.rdt.refactoring.core.renamefield.RenameFieldConditionChecker;
import org.rubypeople.rdt.refactoring.core.renamefield.RenameFieldConfig;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalConfig;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConfig;
import org.rubypeople.rdt.refactoring.core.renamemethod.RenameMethodConditionChecker;
import org.rubypeople.rdt.refactoring.core.renamemethod.RenameMethodConfig;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -34,7 +34,7 @@
import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
import org.rubypeople.rdt.refactoring.core.renameclass.RenameClassRefactoring;
import org.rubypeople.rdt.refactoring.core.renamefield.RenameFieldRefactoring;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalVariableRefactoring;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalVariableRefactoring;
import org.rubypeople.rdt.refactoring.core.renamemethod.RenameMethodRefactoring;
public class RenameRefactoring extends RubyRefactoring {
Copied: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal (from rev 2117, trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable)
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/DynamicVariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/DynamicVariableRenamer.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/DynamicVariableRenamer.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import java.util.ArrayList;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/IAbortCondition.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/IAbortCondition.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/IAbortCondition.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import org.jruby.ast.Node;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariableRenamer.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariableRenamer.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariablesEditProvider.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/LocalVariablesEditProvider.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import java.util.ArrayList;
import java.util.Collection;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/Messages.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/Messages.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -1,4 +1,4 @@
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import org.eclipse.osgi.util.NLS;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConditionChecker.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConditionChecker.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import java.util.Collection;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConfig.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalConfig.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/RenameLocalVariableRefactoring.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import org.rubypeople.rdt.refactoring.core.RubyRefactoring;
import org.rubypeople.rdt.refactoring.core.TextSelectionProvider;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/SingleLocalVariableEdit.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/SingleLocalVariableEdit.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/SingleLocalVariableEdit.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import org.jruby.ast.ArgsNode;
import org.jruby.ast.Node;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/VariableNameProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/VariableNameProvider.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/VariableNameProvider.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import java.util.Observable;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/VariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/VariableRenamer.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocal/VariableRenamer.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -26,7 +26,7 @@
* the terms of any one of the CPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****/
-package org.rubypeople.rdt.refactoring.core.renamelocalvariable;
+package org.rubypeople.rdt.refactoring.core.renamelocal;
import java.util.ArrayList;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplittedVariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplittedVariableRenamer.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplittedVariableRenamer.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -36,10 +36,10 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.NewlineNode;
import org.jruby.ast.Node;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.DynamicVariableRenamer;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.IAbortCondition;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.SingleLocalVariableEdit;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.VariableRenamer;
+import org.rubypeople.rdt.refactoring.core.renamelocal.DynamicVariableRenamer;
+import org.rubypeople.rdt.refactoring.core.renamelocal.IAbortCondition;
+import org.rubypeople.rdt.refactoring.core.renamelocal.SingleLocalVariableEdit;
+import org.rubypeople.rdt.refactoring.core.renamelocal.VariableRenamer;
import org.rubypeople.rdt.refactoring.editprovider.EditProvider;
import org.rubypeople.rdt.refactoring.util.NodeUtil;
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/RenameLocalTester.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -32,9 +32,9 @@
import java.io.IOException;
import org.eclipse.jface.text.BadLocationException;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.LocalVariablesEditProvider;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalConfig;
+import org.rubypeople.rdt.refactoring.core.renamelocal.LocalVariablesEditProvider;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConfig;
import org.rubypeople.rdt.refactoring.tests.FileTestCase;
import org.rubypeople.rdt.refactoring.tests.FileTestData;
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/RenameLocalConditionTester.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/RenameLocalConditionTester.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/renamelocalvariable/conditionchecks/RenameLocalConditionTester.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -33,8 +33,8 @@
import java.io.FileNotFoundException;
import java.io.IOException;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalConditionChecker;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.RenameLocalConfig;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConditionChecker;
+import org.rubypeople.rdt.refactoring.core.renamelocal.RenameLocalConfig;
import org.rubypeople.rdt.refactoring.tests.FilePropertyData;
import org.rubypeople.rdt.refactoring.tests.FileTestData;
import org.rubypeople.rdt.refactoring.tests.RefactoringConditionTestCase;
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TC_SplittedVariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TC_SplittedVariableRenamer.java 2007-03-09 16:27:28 UTC (rev 2117)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/splittemp/TC_SplittedVariableRenamer.java 2007-03-09 16:43:33 UTC (rev 2118)
@@ -38,7 +38,7 @@
import org.jruby.ast.DVarNode;
import org.jruby.ast.LocalAsgnNode;
import org.jruby.ast.LocalVarNode;
-import org.rubypeople.rdt.refactoring.core.renamelocalvariable.SingleLocalVariableEdit;
+import org.rubypeople.rdt.refactoring.core.renamelocal.SingleLocalVariableEdit;
import org.rubypeople.rdt.refactoring.core.splittemp.LocalVarFinder;
import org.rubypeople.rdt.refactoring.core.splittemp.LocalVarUsage;
import org.rubypeople.rdt.refactoring.core.splittemp.SplittedVariableRenamer;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-09 16:27:34
|
Revision: 2117
http://svn.sourceforge.net/rubyeclipse/?rev=2117&view=rev
Author: mirkostocker
Date: 2007-03-09 08:27:28 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
sort the members of the occurences selection page by line
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java 2007-03-09 16:17:30 UTC (rev 2116)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java 2007-03-09 16:27:28 UTC (rev 2117)
@@ -41,7 +41,7 @@
super(NAME);
DocumentProvider docProvider = getDocumentProvider();
- //docprovider vom checker erstellen lassen und dann einfach neu setzen in der config? cache invalidieren!
+
RenameLocalConfig config = new RenameLocalConfig(docProvider, selectionProvider.getCarretPosition());
RenameLocalConditionChecker checker = new RenameLocalConditionChecker(config);
setRefactoringConditionChecker(checker);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java 2007-03-09 16:17:30 UTC (rev 2116)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java 2007-03-09 16:27:28 UTC (rev 2117)
@@ -31,6 +31,8 @@
package org.rubypeople.rdt.refactoring.ui.pages;
import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.TreeSet;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
@@ -114,7 +116,16 @@
private void initPossibilityTable(Composite control) {
possibilityTable = new Table(control, SWT.BORDER | SWT.CHECK);
- for(INodeWrapper currentCall : selector.getPossibleCalls()){
+
+ TreeSet<INodeWrapper> possibleCalls = new TreeSet<INodeWrapper>(new Comparator<INodeWrapper>(){
+
+ public int compare(INodeWrapper left, INodeWrapper right) {
+ return left.getWrappedNode().getPosition().getStartOffset() - right.getWrappedNode().getPosition().getStartOffset();
+ }});
+
+ possibleCalls.addAll(selector.getPossibleCalls());
+
+ for(INodeWrapper currentCall : possibleCalls){
TableItem currentItem = new TableItem(possibilityTable, SWT.NONE);
currentItem.setText(getTableCaption(currentCall));
if(probableCall(currentCall)){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-09 16:17:35
|
Revision: 2116
http://svn.sourceforge.net/rubyeclipse/?rev=2116&view=rev
Author: cawilliams
Date: 2007-03-09 08:17:30 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
Property Changed:
----------------
trunk/org.rubypeople.rdt.launching/ruby/
Property changes on: trunk/org.rubypeople.rdt.launching/ruby
___________________________________________________________________
Name: svn:ignore
- 1169734631473
1169734607958
1171920590095
fake
InterpreterOne
InterpreterTwo
vm_id
+ 1169734631473
1169734607958
1171920590095
fake
InterpreterOne
InterpreterTwo
vm_id
1173384296213
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-09 16:09:56
|
Revision: 2115
http://svn.sourceforge.net/rubyeclipse/?rev=2115&view=rev
Author: mirkostocker
Date: 2007-03-09 08:09:51 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
Fix the backbutton behavior, should work with all refactorings except rename method. What we do: Whenever the refactoring wizard page is loaded (from the back button), the initial documentprovider is discarded and replaced with a new one and reinitialized with the conditionchecker, so all previous changes on nodes are thrown away and we start with a fresh document. We still have some overhead on the initial creation of the page, need to fix that.. but for now the backbutton should be safe to use.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RenameAction.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/AllFilesClassNodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FormatWithParenthesis.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConverter.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormatSourceConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/TempInliner.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/mergeclasspartsinfile/MergeClassPartInFileConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/mergewithexternalclassparts/MergeWithExternalClassPartConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/GenerateAccessorAtSource.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MethodMover.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/rename/RenameRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/FieldRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariablesEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalVariableRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodRefactoring.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/ILocalVarFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/LocalVarFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/LocalVarUsage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplitTempConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/SplitTempEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/editprovider/ITreeClass.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/IncludedClassesSelectionDialog.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/RubyRefactoringWizard.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/AccessorSelectionPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ConstructorSelectionPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ConvertTempToFieldPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/EncapsulateFieldPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/FormatSourcePage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineClassPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineMethodPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/InlineTempPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/MergeClassPartsInFilePage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/MergeWithExternalClassPartsPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/MethodDownPusherSelectionPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/MoveFieldPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OccurenceReplaceSelectionPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/OverrideMethodSelectionPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/RenamePage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/SplitTempPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/inlinemethod/TargetClassFinderUI.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/util/AbstractSelectionListener.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/util/SwtUtils.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NodeUtil.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_RefactoringConditionChecker.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/IRefactoringConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/RefactoringWizardPage.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/ClassVarNameProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/InstVarNameProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/IRenameConfig.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RenameAction.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RenameAction.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RenameAction.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -1,3 +1,31 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Lukas Felber <lf...@hs...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
package org.rubypeople.rdt.refactoring.action;
import org.rubypeople.rdt.refactoring.core.rename.RenameRefactoring;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/AllFilesClassNodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/AllFilesClassNodeProvider.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/AllFilesClassNodeProvider.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -28,12 +28,12 @@
package org.rubypeople.rdt.refactoring.classnodeprovider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
public class AllFilesClassNodeProvider extends ClassNodeProvider
{
- public AllFilesClassNodeProvider(DocumentProvider docProvider) {
+ public AllFilesClassNodeProvider(IDocumentProvider docProvider) {
super(docProvider, false);
for(String fileName : docProvider.getFileNames()) {
addSource(fileName);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -39,7 +39,7 @@
import org.jruby.ast.SClassNode;
import org.jruby.lexer.yacc.ISourcePosition;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
@@ -49,13 +49,13 @@
private Map<String, ClassNodeWrapper> classNodeWrappers;
- protected DocumentProvider documentProvider;
+ protected IDocumentProvider documentProvider;
- public ClassNodeProvider(DocumentProvider docProvider) {
+ public ClassNodeProvider(IDocumentProvider docProvider) {
this(docProvider, true);
}
- public ClassNodeProvider(DocumentProvider docProvider, boolean addActiveFile) {
+ public ClassNodeProvider(IDocumentProvider docProvider, boolean addActiveFile) {
classNodeWrappers = new LinkedHashMap<String, ClassNodeWrapper>();
this.documentProvider = docProvider;
if(addActiveFile) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -38,14 +38,14 @@
import org.jruby.ast.Node;
import org.jruby.ast.StrNode;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
public class IncludedClassesProvider extends ClassNodeProvider {
private String includingFileName;
private ArrayList<IPath> includeFilePaths;
- public IncludedClassesProvider(DocumentProvider documentProvider) {
+ public IncludedClassesProvider(IDocumentProvider documentProvider) {
super(documentProvider);
this.includingFileName = documentProvider.getActiveFileName();
prepareIncludedFileNames();
@@ -101,7 +101,7 @@
}
- public DocumentProvider getDocumentProvider() {
+ public IDocumentProvider getDocumentProvider() {
return documentProvider;
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FormatWithParenthesis.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FormatWithParenthesis.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/FormatWithParenthesis.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -1,6 +1,31 @@
-/**
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
*
- */
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
package org.rubypeople.rdt.refactoring.core;
import org.jruby.ast.visitor.rewriter.DefaultFormatHelper;
Copied: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/IRefactoringConfig.java (from rev 2105, trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/IRenameConfig.java)
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/IRefactoringConfig.java (rev 0)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/IRefactoringConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -0,0 +1,38 @@
+/***** BEGIN LICENSE BLOCK *****
+ * Version: CPL 1.0/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Common Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Software distributed under the License is distributed on an "AS
+ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * Copyright (C) 2006 Mirko Stocker <me...@mi...>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the CPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the CPL, the GPL or the LGPL.
+ ***** END LICENSE BLOCK *****/
+
+package org.rubypeople.rdt.refactoring.core;
+
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
+
+
+public interface IRefactoringConfig {
+ IDocumentProvider getDocumentProvider();
+
+ void setDocumentProvider(IDocumentProvider doc);
+}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -42,9 +42,11 @@
private Map<String, Collection<String>> messages;
private IDocumentProvider docProvider;
+ private final IRefactoringConfig config;
- public RefactoringConditionChecker(IDocumentProvider docProvider, Object config) {
+ public RefactoringConditionChecker(IDocumentProvider docProvider, IRefactoringConfig config) {
this.docProvider = docProvider;
+ this.config = config;
initMessages();
addLocalInitialErrors();
if(shouldPerform(true)) {
@@ -141,5 +143,9 @@
protected void checkFinalConditions() {
}
- protected abstract void init(Object configObj);
+ public abstract void init(Object configObj);
+
+ public IRefactoringConfig getConfig() {
+ return config;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RubyRefactoring.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -184,12 +184,4 @@
public IMultiFileEditProvider getMultiFileEditProvider() {
return multiFileEditProvider;
}
-
-// protected RubyEditor getEditor() {
-// return editor;
-// }
-//
-// protected int getCarretPosition() {
-// return getEditor().getCaretPosition().getOffset();
-// }
}
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/ClassVarNameProvider.java
===================================================================
Deleted: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/InstVarNameProvider.java
===================================================================
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -55,12 +55,12 @@
private RootNode rootNode;
public TempToFieldConditionChecker(TempToFieldConfig config) {
- super(config.getDocProvider(), config);
+ super(config.getDocumentProvider(), config);
}
public void init(Object configObj) {
config = (TempToFieldConfig) configObj;
- rootNode = config.getDocProvider().getActiveFileRootNode();
+ rootNode = config.getDocumentProvider().getActiveFileRootNode();
Node selectedNode = findSelectedNode(LocalAsgnNode.class, LocalVarNode.class, DVarNode.class, DAsgnNode.class);
if (selectedNode != null) {
config.setSelectedNode(new LocalNodeWrapper(selectedNode));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -31,13 +31,14 @@
package org.rubypeople.rdt.refactoring.core.converttemptofield;
import org.jruby.ast.MethodDefNode;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.LocalNodeWrapper;
-public class TempToFieldConfig {
+public class TempToFieldConfig implements IRefactoringConfig {
- private DocumentProvider docProvider;
+ private IDocumentProvider docProvider;
private int caretPosition;
private LocalNodeWrapper selectedNode;
private ClassNodeWrapper enclosingClassNode;
@@ -45,7 +46,7 @@
private boolean classField;
private String newName;
- public TempToFieldConfig(DocumentProvider docProvider, int caretPosition) {
+ public TempToFieldConfig(IDocumentProvider docProvider, int caretPosition) {
this.docProvider = docProvider;
this.caretPosition = caretPosition;
}
@@ -94,7 +95,11 @@
this.selectedNode = selectedItem;
}
- public DocumentProvider getDocProvider() {
+ public IDocumentProvider getDocumentProvider() {
return docProvider;
}
+
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.docProvider = doc;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConverter.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConverter.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConverter.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -149,7 +149,7 @@
}
private Node findSelectedNode(Class<?>... filterNodes) {
- return SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), filterNodes);
+ return SelectionNodeProvider.getSelectedNodeOfType(config.getDocumentProvider().getActiveFileRootNode(), config.getCaretPosition(), filterNodes);
}
boolean isInitializationExternalizable() {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -48,12 +48,12 @@
private Node rootNode;
public EncapsulateFieldConditionChecker(EncapsulateFieldConfig config) {
- super(config.getDocProvider(), config);
+ super(config.getDocumentProvider(), config);
}
public void init(Object configObj) {
config = (EncapsulateFieldConfig) configObj;
- rootNode = config.getDocProvider().getActiveFileRootNode();
+ rootNode = config.getDocumentProvider().getActiveFileRootNode();
config.setSelectedInstNode(findSelectedInstNode(config.getCaretPosition()));
if (!config.hasSelectedInstNode()) {
return;
@@ -101,11 +101,11 @@
}
private boolean selectedNodeIsInstVarNodeAndNotInMethod() {
- Node selectedVarNode = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), InstVarNode.class, InstAsgnNode.class);
+ Node selectedVarNode = SelectionNodeProvider.getSelectedNodeOfType(config.getDocumentProvider().getActiveFileRootNode(), config.getCaretPosition(), InstVarNode.class, InstAsgnNode.class);
if (selectedVarNode == null) {
return false;
}
- Node enclosingMethod = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), DefnNode.class);
+ Node enclosingMethod = SelectionNodeProvider.getSelectedNodeOfType(config.getDocumentProvider().getActiveFileRootNode(), config.getCaretPosition(), DefnNode.class);
return enclosingMethod == null;
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -31,11 +31,12 @@
package org.rubypeople.rdt.refactoring.core.encapsulatefield;
import org.jruby.ast.types.INameNode;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.AttrAccessorNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
-public class EncapsulateFieldConfig {
+public class EncapsulateFieldConfig implements IRefactoringConfig {
private IDocumentProvider docProvider;
private int caretPosition;
@@ -54,7 +55,7 @@
return caretPosition;
}
- public IDocumentProvider getDocProvider() {
+ public IDocumentProvider getDocumentProvider() {
return docProvider;
}
@@ -125,4 +126,8 @@
}
return null;
}
+
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.docProvider = doc;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -32,13 +32,14 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
import org.rubypeople.rdt.refactoring.core.SelectionInformation;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.PartialClassNodeWrapper;
-public class ExtractMethodConfig {
+public class ExtractMethodConfig implements IRefactoringConfig {
- private DocumentProvider docProvider;
+ private IDocumentProvider docProvider;
private SelectionInformation selectionInfo;
private ExtractedMethodHelper extractMethodHelper;
private Node selectedNodes;
@@ -47,7 +48,7 @@
private PartialClassNodeWrapper enclosingClassNode;
private Node rootNode;
- public ExtractMethodConfig(DocumentProvider docProvider, SelectionInformation selectionInfo) {
+ public ExtractMethodConfig(IDocumentProvider docProvider, SelectionInformation selectionInfo) {
this.docProvider = docProvider;
this.selectionInfo = optimizeSelection(selectionInfo);
}
@@ -62,7 +63,7 @@
return new SelectionInformation(start, end, selectionInfo.getSource());
}
- public DocumentProvider getDocumentProvider() {
+ public IDocumentProvider getDocumentProvider() {
return docProvider;
}
@@ -126,4 +127,8 @@
return rootNode;
}
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.docProvider = doc;
+ }
+
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormatSourceConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormatSourceConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormatSourceConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -28,17 +28,23 @@
package org.rubypeople.rdt.refactoring.core.formatsource;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
-public class FormatSourceConfig {
+public class FormatSourceConfig implements IRefactoringConfig {
- private DocumentProvider documentProvider;
+ private IDocumentProvider documentProvider;
public FormatSourceConfig(DocumentProvider documentProvider) {
this.documentProvider = documentProvider;
}
- public DocumentProvider getDocumentProvider() {
+ public IDocumentProvider getDocumentProvider() {
return documentProvider;
}
+
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.documentProvider = doc;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -45,7 +45,7 @@
import org.rubypeople.rdt.refactoring.core.NodeFactory;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
import org.rubypeople.rdt.refactoring.editprovider.DeleteEditProvider;
import org.rubypeople.rdt.refactoring.editprovider.FileEditProvider;
@@ -293,12 +293,12 @@
private void addClassDeleteProvider(MultiFileEditProvider editProvider) {
DeleteEditProvider classPartDeleter = new DeleteEditProvider(inlinedClassPart.getWrappedNode());
- editProvider.addEditProvider(new FileEditProvider(config.getDocProvider().getActiveFileName(), classPartDeleter));
+ editProvider.addEditProvider(new FileEditProvider(config.getDocumentProvider().getActiveFileName(), classPartDeleter));
}
public PartialClassNodeWrapper getInlinedClassPart(){
- DocumentProvider docProvider = config.getDocProvider();
+ IDocumentProvider docProvider = config.getDocumentProvider();
Node rootNode = docProvider.getActiveFileRootNode();
try {
return SelectionNodeProvider.getSelectedClassNode(rootNode, config.getCaretPosition()).getFirstPartialClassNode();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -39,27 +39,27 @@
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.PartialClassNodeWrapper;
import org.rubypeople.rdt.refactoring.util.Constants;
-public class InlineClassConditionChecker extends RefactoringConditionChecker{
+public class InlineClassConditionChecker extends RefactoringConditionChecker {
private InlineClassConfig config;
- private DocumentProvider docProvider;
+ private IDocumentProvider docProvider;
private ClassNodeWrapper selectedClass;
public InlineClassConditionChecker(InlineClassConfig config) {
- super(config.getDocProvider(), config);
+ super(config.getDocumentProvider(), config);
}
public void init(Object configObj) {
this.config = (InlineClassConfig) configObj;
- docProvider = config.getDocProvider();
+ docProvider = config.getDocumentProvider();
intiSourceClass();
initPossibleTargetClasses();
}
@@ -111,12 +111,12 @@
}
public void initPossibleTargetClasses(){
- ClassNodeProvider classesProvider = config.getDocProvider().getIncludedClassNodeProvider();
+ ClassNodeProvider classesProvider = config.getDocumentProvider().getIncludedClassNodeProvider();
Collection<ClassNodeWrapper> classNodes = classesProvider.getAllClassNodes();
ArrayList<ClassNodeWrapper> possibleClassNodes = new ArrayList<ClassNodeWrapper>();
- Node rootNode = config.getDocProvider().getActiveFileRootNode();
+ Node rootNode = config.getDocumentProvider().getActiveFileRootNode();
try {
ClassNodeWrapper selectedClass = SelectionNodeProvider.getSelectedClassNode(rootNode, config.getCaretPosition());
for(ClassNodeWrapper currentClass : classNodes){
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -40,18 +40,20 @@
import org.jruby.ast.LocalAsgnNode;
import org.jruby.ast.Node;
import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.PartialClassNodeWrapper;
-public class InlineClassConfig {
+public class InlineClassConfig implements IRefactoringConfig {
private int caretPosition;
- private DocumentProvider docProvider;
+ private IDocumentProvider docProvider;
private PartialClassNodeWrapper targetClassPart;
private Collection<ClassNodeWrapper> possibleTargetClasses;
private ClassNodeWrapper sourceClass;
@@ -65,7 +67,7 @@
public int getCaretPosition() {
return caretPosition;
}
- public DocumentProvider getDocProvider() {
+ public IDocumentProvider getDocumentProvider() {
return docProvider;
}
@@ -122,4 +124,8 @@
}
return assignmentsFound;
}
+
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.docProvider = doc;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -198,9 +198,9 @@
private StringDocumentProvider getDocumentProviderForClassPart(PartialClassNodeWrapper inlinedClassPart) {
ISourcePosition classPartPosition = inlinedClassPart.getWrappedNode().getPosition();
- String activeFileContent = config.getDocProvider().getActiveFileContent();
+ String activeFileContent = config.getDocumentProvider().getActiveFileContent();
String inlinedClassDocument = activeFileContent.substring(classPartPosition.getStartOffset(), classPartPosition.getEndOffset());
- String fileName = "part_of_" + config.getDocProvider().getActiveFileName(); //$NON-NLS-1$
+ String fileName = "part_of_" + config.getDocumentProvider().getActiveFileName(); //$NON-NLS-1$
StringDocumentProvider inlinedClassDocumentProvider = new StringDocumentProvider(fileName, inlinedClassDocument);
return inlinedClassDocumentProvider;
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodFinder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/IMethodFinder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -29,12 +29,12 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
import org.jruby.ast.MethodDefNode;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
/**
* Searches for the given method name in the class name in the provided document. Returns the
* found node.
*/
public interface IMethodFinder {
- MethodDefNode find(String className, String methodName, DocumentProvider doc);
+ MethodDefNode find(String className, String methodName, IDocumentProvider doc);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ISelectedCallFinder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -28,9 +28,9 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
public interface ISelectedCallFinder {
- MethodCallNodeWrapper findSelectedCall(int pos, DocumentProvider doc);
+ MethodCallNodeWrapper findSelectedCall(int pos, IDocumentProvider doc);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ITargetClassFinder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -28,7 +28,7 @@
package org.rubypeople.rdt.refactoring.core.inlinemethod;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
@@ -36,5 +36,5 @@
/**
* Try to find the receiver's type from a call.
*/
- String findTargetClass(MethodCallNodeWrapper call, DocumentProvider doc);
+ String findTargetClass(MethodCallNodeWrapper call, IDocumentProvider doc);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -41,7 +41,7 @@
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
import org.rubypeople.rdt.refactoring.util.NodeUtil;
@@ -72,7 +72,7 @@
renameDuplicates(config.getDocumentProvider());
}
- private void renameDuplicates(DocumentProvider doc) {
+ private void renameDuplicates(IDocumentProvider doc) {
StaticScope parent = NodeUtil.getScope(SelectionNodeProvider.getEnclosingScope(doc.getActiveFileRootNode(), config.getSelectedCall().getWrappedNode()));
ArrayList<String> localNames = new ArrayList<String>();
@@ -115,7 +115,7 @@
config.setMethodDefDoc(new ParameterReplacer().replace(config.getDocumentProvider(), config.getSelectedCall(), config.getMethodDefinitionNode()));
}
- private void createInlinedMethodBody(DocumentProvider doc) {
+ private void createInlinedMethodBody(IDocumentProvider doc) {
MethodBodyStatementReplacer bodyReplacer = new MethodBodyStatementReplacer();
if(config.getSelectedCall().getReceiverNode() != null) {
final String name = ((INameNode)config.getSelectedCall().getReceiverNode()).getName();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -32,24 +32,25 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
-public class InlineMethodConfig {
+public class InlineMethodConfig implements IRefactoringConfig {
private Boolean singleReturnStatement;
private MethodCallNodeWrapper selectedCall;
private String className;
private MethodDefNode methodDefinitionNode;
private DocumentProvider methodDefDoc;
- private final DocumentProvider originalDocument;
+ private IDocumentProvider originalDocument;
private int pos;
private ITargetClassFinder targetClassFinder;
private Collection<String> usedMembers;
private Node callParent;
public InlineMethodConfig(DocumentProvider doc, int pos, ITargetClassFinder targetClassFinder) {
-
originalDocument = doc;
this.pos = pos;
this.targetClassFinder = targetClassFinder;
@@ -91,7 +92,7 @@
return targetClassFinder;
}
- public DocumentProvider getDocumentProvider() {
+ public IDocumentProvider getDocumentProvider() {
return originalDocument;
}
@@ -122,4 +123,8 @@
public Collection<String> getUsedMembers() {
return usedMembers;
}
+
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.originalDocument = doc;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFinder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodFinder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -30,12 +30,12 @@
import org.jruby.ast.MethodDefNode;
import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
public class MethodFinder implements IMethodFinder {
- public MethodDefNode find(String className, String methodName, DocumentProvider doc) {
+ public MethodDefNode find(String className, String methodName, IDocumentProvider doc) {
for(MethodNodeWrapper method : new IncludedClassesProvider(doc).getAllMethodsFor(className)) {
if(method.getName().equals(methodName)) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/SelectedCallFinder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -33,12 +33,12 @@
import org.jruby.ast.Node;
import org.jruby.ast.VCallNode;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
public class SelectedCallFinder implements ISelectedCallFinder {
- public MethodCallNodeWrapper findSelectedCall(final int pos, final DocumentProvider doc) {
+ public MethodCallNodeWrapper findSelectedCall(final int pos, final IDocumentProvider doc) {
final Node selectedNode = SelectionNodeProvider.getSelectedNodeOfType(doc.getActiveFileRootNode(), pos, CallNode.class, FCallNode.class, VCallNode.class);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -43,7 +43,7 @@
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.FieldNodeWrapper;
@@ -53,7 +53,7 @@
public class TargetClassFinder implements ITargetClassFinder {
- public String findTargetClass(final MethodCallNodeWrapper call, final DocumentProvider doc) {
+ public String findTargetClass(final MethodCallNodeWrapper call, final IDocumentProvider doc) {
String name = ""; //$NON-NLS-1$
@@ -71,7 +71,7 @@
return name;
}
- private String getSurroundingClass(final MethodCallNodeWrapper call, final DocumentProvider doc) {
+ private String getSurroundingClass(final MethodCallNodeWrapper call, final IDocumentProvider doc) {
ClassNode classNode = ((ClassNode) NodeProvider.getEnclosingNodeOfType(doc.getActiveFileRootNode(), call.getWrappedNode(), ClassNode.class));
if(classNode != null) {
return classNode.getCPath().getName();
@@ -79,7 +79,7 @@
return ""; //$NON-NLS-1$
}
- private AssignableNode getAssignableNode(final MethodCallNodeWrapper call, final DocumentProvider doc) {
+ private AssignableNode getAssignableNode(final MethodCallNodeWrapper call, final IDocumentProvider doc) {
AssignableNode receiverType = null;
if(call.getReceiverNode() instanceof LocalVarNode) {
@@ -99,7 +99,7 @@
/**
* Finds the corresponding InstAsgnNode node to the supplied InstVarNode
*/
- public InstAsgnNode instVarFromCall(final InstVarNode node, final DocumentProvider doc) {
+ public InstAsgnNode instVarFromCall(final InstVarNode node, final IDocumentProvider doc) {
InstAsgnNode decoratedNode = null;
try {
@@ -122,7 +122,7 @@
return decoratedNode;
}
- private InstAsgnNode findInstVarInScope(final InstVarNode node, final DocumentProvider doc, InstAsgnNode decoratedNode) {
+ private InstAsgnNode findInstVarInScope(final InstVarNode node, final IDocumentProvider doc, InstAsgnNode decoratedNode) {
Collection<Node> assignments = NodeProvider.getSubNodes(doc.getActiveFileRootNode(), InstAsgnNode.class);
for (Node assignment : assignments) {
if(((InstAsgnNode) assignment).getName().equals(node.getName()) && assignment.getPosition().getStartOffset() < node.getPosition().getStartOffset()) {
@@ -135,7 +135,7 @@
/**
* Finds the corresponding LocalAsgnNode node to the supplied LocalVarNode
*/
- public LocalAsgnNode localAsgnFromLocalVar(final LocalVarNode node, final DocumentProvider doc) {
+ public LocalAsgnNode localAsgnFromLocalVar(final LocalVarNode node, final IDocumentProvider doc) {
Node enclosingScope = SelectionNodeProvider.getEnclosingScope(doc.getActiveFileRootNode(), node);
LocalAsgnNode asgnNode = findLastAssignmentToVar(node, NodeUtil.getBody(enclosingScope));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -53,12 +53,12 @@
private RootNode rootNode;
public InlineTempConditionChecker(InlineTempConfig config) {
- super(config.getDocProvider(), config);
+ super(config.getDocumentProvider(), config);
}
public void init(Object configObj) {
this.config = (InlineTempConfig) configObj;
- rootNode = config.getDocProvider().getActiveFileRootNode();
+ rootNode = config.getDocumentProvider().getActiveFileRootNode();
int caretPosition = config.getCaretPosition();
config.setEnclosingMethod((MethodDefNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, caretPosition, MethodDefNode.class));
@@ -149,7 +149,7 @@
private boolean isNewMethodNameUnique() {
- Node environment = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), ClassNode.class, RootNode.class);
+ Node environment = SelectionNodeProvider.getSelectedNodeOfType(config.getDocumentProvider().getActiveFileRootNode(), config.getCaretPosition(), ClassNode.class, RootNode.class);
Collection<MethodDefNode> methodNodes = NodeProvider.gatherMethodDefinitionNodes(NodeUtil.getBody(environment));
for (MethodDefNode currentDefnNode : methodNodes) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConfig.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConfig.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -34,16 +34,18 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.Node;
+import org.rubypeople.rdt.refactoring.core.IRefactoringConfig;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
+import org.rubypeople.rdt.refactoring.documentprovider.IDocumentProvider;
import org.rubypeople.rdt.refactoring.nodewrapper.LocalNodeWrapper;
-public class InlineTempConfig {
+public class InlineTempConfig implements IRefactoringConfig {
private boolean replaceTempWithQuery;
private String newMethodName = "extractedMethod"; //$NON-NLS-1$
- private DocumentProvider docProvider;
+ private IDocumentProvider docProvider;
private int caretPosition;
@@ -80,7 +82,7 @@
this.newMethodName = newMethodName;
}
- public DocumentProvider getDocProvider() {
+ public IDocumentProvider getDocumentProvider() {
return docProvider;
}
@@ -140,4 +142,8 @@
public void setEnclosingMethod(MethodDefNode enclosingMethod) {
this.enclosingMethod = enclosingMethod;
}
+
+ public void setDocumentProvider(IDocumentProvider doc) {
+ this.docProvider = doc;
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/TempInliner.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/TempInliner.java 2007-03-09 15:23:56 UTC (rev 2114)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/TempInliner.java 2007-03-09 16:09:51 UTC (rev 2115)
@@ -86,7 +86,7 @@
int startPos = config.getDefinitionNode().getValueNode().getPosition().getStartOffset();
int endPos = config.getDefinitionNode().getValueNode().getPosition().getEndOffset();
- extractConfig = new ExtractMethodConfig(config.getDocProvider(), new SelectionInformation(startPos, endPos, "")); //$NON-NLS-1$
+ extractConfig = new ExtractMethodConfig(config.getDocumentProvider(), new SelectionInformation(sta...
[truncated message content] |
|
From: <caw...@us...> - 2007-03-09 15:24:01
|
Revision: 2114
http://svn.sourceforge.net/rubyeclipse/?rev=2114&view=rev
Author: cawilliams
Date: 2007-03-09 07:23:56 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
add getFullyQualifiedName on IType - use it in setting declaring type of method suggestions.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IType.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IType.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IType.java 2007-03-09 14:58:55 UTC (rev 2113)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IType.java 2007-03-09 15:23:56 UTC (rev 2114)
@@ -53,6 +53,8 @@
* @return
*/
boolean isClass();
+
+ String getFullyQualifiedName();
/**
* @return
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 14:58:55 UTC (rev 2113)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 15:23:56 UTC (rev 2114)
@@ -214,7 +214,7 @@
IType declaringType = method.getDeclaringType();
String declaringName = typeName;
if (declaringType != null)
- declaringName = declaringType.getElementName();
+ declaringName = declaringType.getFullyQualifiedName();
proposal.setDeclaringType(declaringName);
return proposal;
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-03-09 14:58:55 UTC (rev 2113)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-03-09 15:23:56 UTC (rev 2114)
@@ -205,4 +205,12 @@
return null;
}
+ public String getFullyQualifiedName() {
+ IType declaring = getDeclaringType();
+ if (declaring != null) {
+ return declaring.getFullyQualifiedName() + "::" + getElementName();
+ }
+ return getElementName();
+ }
+
}
\ 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-03-09 14:59:07
|
Revision: 2113
http://svn.sourceforge.net/rubyeclipse/?rev=2113&view=rev
Author: cawilliams
Date: 2007-03-09 06:58:55 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 14:46:19 UTC (rev 2112)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 14:58:55 UTC (rev 2113)
@@ -195,7 +195,7 @@
if (fContext.hasReceiver()) return null; // can't invoke a private method on a receiver
break;
case IMethod.PUBLIC:
- flags |= Flags.AccPublic;
+ flags |= Flags.AccPublic; // FIXME Check if receiver is of same class as method's declaring type, if not, skip this method. (so we can invoke with no receiver inside same class, with explicit self as receiver, or with receiver who has same class).
break;
case IMethod.PROTECTED:
flags |= Flags.AccProtected;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-09 14:46:30
|
Revision: 2112
http://svn.sourceforge.net/rubyeclipse/?rev=2112&view=rev
Author: cawilliams
Date: 2007-03-09 06:46:19 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
avoid an index out of range on an empty full prefix (checking if prefix is constant)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 14:33:27 UTC (rev 2111)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 14:46:19 UTC (rev 2112)
@@ -3,6 +3,8 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.RubyModelException;
+import com.sun.org.apache.xpath.internal.operations.Gte;
+
public class CompletionContext {
private IRubyScript script;
@@ -129,6 +131,7 @@
}
public boolean fullPrefixIsConstant() {
+ if (getFullPrefix() == null || getFullPrefix().length() == 0) return false;
return Character.isUpperCase(getFullPrefix().charAt(0));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-09 14:33:31
|
Revision: 2111
http://svn.sourceforge.net/rubyeclipse/?rev=2111&view=rev
Author: cawilliams
Date: 2007-03-09 06:33:27 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
handle external files...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/ViewContentProvider.java
Modified: trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/ViewContentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/ViewContentProvider.java 2007-03-09 14:31:01 UTC (rev 2110)
+++ trunk/org.rubypeople.rdt.astviewer/src/org/rubypeople/rdt/astviewer/views/ViewContentProvider.java 2007-03-09 14:33:27 UTC (rev 2111)
@@ -28,6 +28,7 @@
package org.rubypeople.rdt.astviewer.views;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Iterator;
@@ -36,7 +37,9 @@
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
@@ -77,9 +80,12 @@
RubyParserPool.getInstance().returnParser(parser);
}
- protected IFile getFile()
- {
- return ((IFileEditorInput) editor.getEditorInput()).getFile();
+ protected IFile getFile() {
+ IEditorInput input = editor.getEditorInput();
+ if (input instanceof IFileEditorInput) {
+ return ((IFileEditorInput) input).getFile();
+ }
+ return null;
}
public Object[] getElements(Object parent) {
@@ -114,13 +120,35 @@
public Node getRootNode() {
LexerSource lexerSource;
try {
- lexerSource = new LexerSource(getFile().getName(), new InputStreamReader(getFile().getContents()));
+ lexerSource = new LexerSource(getName(), new InputStreamReader(getContents()));
return parser.parse(new RubyParserConfiguration(), lexerSource).getAST();
} catch (CoreException e) {
return null;
}
}
+ private String getName() throws CoreException {
+ IFile file = getFile();
+ if (file != null) return file.getName();
+ IEditorInput input = editor.getEditorInput();
+ if (input instanceof IStorageEditorInput) {
+ IStorageEditorInput storageInput = (IStorageEditorInput) input;
+ return storageInput.getStorage().getName();
+ }
+ return "";
+ }
+
+ private InputStream getContents() throws CoreException {
+ IFile file = getFile();
+ if (file != null) return file.getContents();
+ IEditorInput input = editor.getEditorInput();
+ if (input instanceof IStorageEditorInput) {
+ IStorageEditorInput storageInput = (IStorageEditorInput) input;
+ return storageInput.getStorage().getContents();
+ }
+ return null;
+ }
+
private void initialize() {
updateContent();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-09 14:31:04
|
Revision: 2110
http://svn.sourceforge.net/rubyeclipse/?rev=2110&view=rev
Author: cawilliams
Date: 2007-03-09 06:31:01 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
do some more tweaking of code completion
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-08 20:43:03 UTC (rev 2109)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionContext.java 2007-03-09 14:31:01 UTC (rev 2110)
@@ -84,6 +84,10 @@
return correctedSource;
}
+ public boolean hasReceiver() {
+ return getFullPrefix().indexOf('.') > 1;
+ }
+
/**
* The original source
* @return
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-08 20:43:03 UTC (rev 2109)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-03-09 14:31:01 UTC (rev 2110)
@@ -192,6 +192,7 @@
switch (method.getVisibility()) {
case IMethod.PRIVATE:
flags |= Flags.AccPrivate;
+ if (fContext.hasReceiver()) return null; // can't invoke a private method on a receiver
break;
case IMethod.PUBLIC:
flags |= Flags.AccPublic;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java 2007-03-08 20:43:03 UTC (rev 2109)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/DefaultTypeInferrer.java 2007-03-09 14:31:01 UTC (rev 2110)
@@ -68,8 +68,14 @@
tryGlobalVarNode(node, guesses);
tryWellKnownMethodCalls(node, guesses);
+ if (node instanceof Colon2Node) { // if this is a constant, it may be the type name!
+ Colon2Node colonNode = (Colon2Node)node;
+ String name = ASTUtil.getFullyQualifiedName(colonNode);
+ guesses.add(new BasicTypeGuess(name, 100));
+ }
if (node instanceof ConstNode) { // if this is a constant, it may be the type name!
- guesses.add(new BasicTypeGuess(((ConstNode)node).getName(), 100));
+ ConstNode constNode = (ConstNode)node;
+ guesses.add(new BasicTypeGuess(constNode.getName(), 100));
}
if (guesses.isEmpty()) { // if we have no guesses..
if (node instanceof CallNode) { // and it's a method call, try inferring receiver type
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java 2007-03-08 20:43:03 UTC (rev 2109)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/util/OffsetNodeLocator.java 2007-03-09 14:31:01 UTC (rev 2110)
@@ -4,6 +4,8 @@
import org.jruby.ast.ArgsNode;
import org.jruby.ast.ArgumentNode;
+import org.jruby.ast.Colon2Node;
+import org.jruby.ast.ConstNode;
import org.jruby.ast.NewlineNode;
import org.jruby.ast.Node;
import org.jruby.evaluator.Instruction;
@@ -85,7 +87,9 @@
//note: careful... should this be <=? I think so; since it traverses in-order, this should find the "most specific" closest node. i.e.
//def foo;x;end offset at 'x' is a 1-char ScopingNode and 1-char LocalVarNode; it should identify the LocalVarNode, which <= does.
if (locatedNode == null || ( nodeSpanLength(iVisited) <= nodeSpanLength(locatedNode))) {
+ if (!((locatedNode instanceof Colon2Node) && (iVisited instanceof ConstNode))) {
locatedNode = iVisited;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-08 20:43:07
|
Revision: 2109
http://svn.sourceforge.net/rubyeclipse/?rev=2109&view=rev
Author: cawilliams
Date: 2007-03-08 12:43:03 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
begin handling "class << self" idiom for defining class level/singleton methods
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-03-08 20:23:13 UTC (rev 2108)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-03-08 20:43:03 UTC (rev 2109)
@@ -159,6 +159,7 @@
private Map newElements;
private RubyElementInfo importContainerInfo;
private boolean DEBUG = false;
+ private boolean inSingletonClass;
/**
*
@@ -750,7 +751,7 @@
RubyElement type = getCurrentType();
String[] parameterNames = ASTUtil.getArgs(iVisited.getArgsNode(), iVisited.getScope());
- RubyMethod method = new RubyMethod(type, name, parameterNames);
+ RubyMethod method = createMethod(name, type, parameterNames);
modelStack.push(method);
RubyElementInfo parentInfo = infoStack.peek();
@@ -774,6 +775,12 @@
return null;
}
+ private RubyMethod createMethod(String name, RubyElement type, String[] parameterNames) {
+ if (inSingletonClass)
+ return new RubySingletonMethod(type, name, parameterNames);
+ return new RubyMethod(type, name, parameterNames);
+ }
+
/**
* @param visibility
* @return
@@ -1558,9 +1565,15 @@
* @see org.jruby.ast.visitor.NodeVisitor#visitSClassNode(org.jruby.ast.SClassNode)
*/
public Instruction visitSClassNode(SClassNode iVisited) {
- handleNode(iVisited);
- visitNode(iVisited.getReceiverNode());
- visitNode(iVisited.getBodyNode());
+ handleNode(iVisited);
+
+ Node receiver = iVisited.getReceiverNode();
+ if (receiver instanceof SelfNode) {
+// TODO We need to mark that we're in the singlteon class - this means all instance methods are actually singleton methods on the class we're in...
+ inSingletonClass = true;
+ visitNode(iVisited.getBodyNode());
+ inSingletonClass = false;
+ }
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-08 20:23:18
|
Revision: 2108
http://svn.sourceforge.net/rubyeclipse/?rev=2108&view=rev
Author: cawilliams
Date: 2007-03-08 12:23:13 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
nest ast view prefs under ruby category
Modified Paths:
--------------
trunk/org.rubypeople.rdt.astviewer/plugin.xml
Modified: trunk/org.rubypeople.rdt.astviewer/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.astviewer/plugin.xml 2007-03-08 16:52:44 UTC (rev 2107)
+++ trunk/org.rubypeople.rdt.astviewer/plugin.xml 2007-03-08 20:23:13 UTC (rev 2108)
@@ -25,14 +25,14 @@
</perspectiveExtension>
</extension>
<extension point="org.eclipse.ui.preferencePages">
- <page class="org.rubypeople.rdt.astviewer.preferences.AstViewerPreferencePage"
+ <page
+ category="org.rubypeople.rdt.ui.preferences.PreferencePageRubyBase"
+ class="org.rubypeople.rdt.astviewer.preferences.AstViewerPreferencePage"
id="org.rubypeople.rdt.astviewer.preferences.AstViewerPreferencePage"
name="AST View"/>
</extension>
<extension point="org.eclipse.core.runtime.preferences">
<initializer class="org.rubypeople.rdt.astviewer.preferences.PreferenceInitializer"/>
</extension>
- <extension point="org.eclipse.ui.preferencePages">
- </extension>
</plugin>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-08 17:06:02
|
Revision: 2107
http://svn.sourceforge.net/rubyeclipse/?rev=2107&view=rev
Author: cawilliams
Date: 2007-03-08 08:52:44 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
Property Changed:
----------------
trunk/org.rubypeople.rdt.launching/ruby/
Property changes on: trunk/org.rubypeople.rdt.launching/ruby
___________________________________________________________________
Name: svn:ignore
+ 1169734631473
1169734607958
1171920590095
fake
InterpreterOne
InterpreterTwo
vm_id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-08 16:30:04
|
Revision: 2106
http://svn.sourceforge.net/rubyeclipse/?rev=2106&view=rev
Author: cawilliams
Date: 2007-03-08 08:30:02 -0800 (Thu, 08 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ISourceFolderRoot.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java 2007-03-07 21:40:23 UTC (rev 2105)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java 2007-03-08 16:30:02 UTC (rev 2106)
@@ -146,4 +146,24 @@
public abstract ISourceFolderRoot getSourceFolderRoot(String rootPath);
public abstract ISourceFolderRoot findSourceFolderRoot(IPath path) throws RubyModelException;
+
+ /**
+ * Returns the existing package fragment roots identified by the given entry.
+ * Note that a classpath entry that refers to another project may
+ * have more than one root (if that project has more than on root
+ * containing source), and classpath entries within the current
+ * project identify a single root.
+ * <p>
+ * If the classpath entry denotes a variable, it will be resolved and return
+ * the roots of the target entry (empty if not resolvable).
+ * <p>
+ * If the classpath entry denotes a container, it will be resolved and return
+ * the roots corresponding to the set of container entries (empty if not resolvable).
+ *
+ * @param entry the given entry
+ * @return the existing package fragment roots identified by the given entry
+ * @see ILoadpathContainer
+ * @since 1.0.0
+ */
+ ISourceFolderRoot[] findSourceFolderRoots(ILoadpathEntry entry);
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ISourceFolderRoot.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ISourceFolderRoot.java 2007-03-07 21:40:23 UTC (rev 2105)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ISourceFolderRoot.java 2007-03-08 16:30:02 UTC (rev 2106)
@@ -109,5 +109,18 @@
Object[] getNonRubyResources() throws RubyModelException;
ISourceFolder getSourceFolder(String packName);
+
+ /**
+ * Returns the first raw loadpath entry that corresponds to this package
+ * fragment root.
+ * A raw loadpath entry corresponds to a package fragment root if once resolved
+ * this entry's path is equal to the root's path.
+ *
+ * @exception RubyModelException if this element does not exist or if an
+ * exception occurs while accessing its corresponding resource.
+ * @return the first raw classpath entry that corresponds to this package fragment root
+ * @since 1.0.0
+ */
+ ILoadpathEntry getRawLoadpathEntry() throws RubyModelException;
}
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-07 21:40:23 UTC (rev 2105)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-03-08 16:30:02 UTC (rev 2106)
@@ -2382,6 +2382,27 @@
/**
* @see IRubyProject
*/
+ public ISourceFolderRoot[] findSourceFolderRoots(ILoadpathEntry entry) {
+ try {
+ ILoadpathEntry[] classpath = this.getRawLoadpath();
+ for (int i = 0, length = classpath.length; i < length; i++) {
+ if (classpath[i].equals(entry)) { // entry may need to be resolved
+ return
+ computeSourceFolderRoots(
+ getResolvedLoadpath(new ILoadpathEntry[] {entry}, null, true, false, null/*no reverse map*/),
+ false, // don't retrieve exported roots
+ null); /*no reverse map*/
+ }
+ }
+ } catch (RubyModelException e) {
+ // project doesn't exist: return an empty array
+ }
+ return new ISourceFolderRoot[] {};
+ }
+
+ /**
+ * @see IRubyProject
+ */
public ISourceFolderRoot[] getAllSourceFolderRoots()
throws RubyModelException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-07 21:40:26
|
Revision: 2105
http://svn.sourceforge.net/rubyeclipse/?rev=2105&view=rev
Author: cawilliams
Date: 2007-03-07 13:40:23 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathEntry.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyConventions.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathEntry.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathAttribute.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathAttribute.java
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathAttribute.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathAttribute.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathAttribute.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 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.core;
+
+/**
+ * A classpath attribute defines a name/value pair that can be persisted with a classpath entry. Such an attribute
+ * can be created using the factory method {@link JavaCore#newClasspathAttribute(String, String) newClasspathAttribute(String name, String value)}.
+ * <p>
+ * This interface is not intended to be implemented by clients.
+ * </p>
+ *
+ * @see JavaCore#newContainerEntry(
+ * org.eclipse.core.runtime.IPath containerPath,
+ * IAccessRule[] accessRules,
+ * IClasspathAttribute[] extraAttributes,
+ * boolean isExported)
+ * @see JavaCore#newLibraryEntry(
+ * org.eclipse.core.runtime.IPath path,
+ * org.eclipse.core.runtime.IPath sourceAttachmentPath,
+ * org.eclipse.core.runtime.IPath sourceAttachmentRootPath,
+ * IAccessRule[] accessRules,
+ * IClasspathAttribute[] extraAttributes,
+ * boolean isExported)
+ * @see JavaCore#newProjectEntry(
+ * org.eclipse.core.runtime.IPath path,
+ * IAccessRule[] accessRules,
+ * boolean combineAccessRestrictions,
+ * IClasspathAttribute[] extraAttributes,
+ * boolean isExported)
+ * @see JavaCore#newSourceEntry(
+ * org.eclipse.core.runtime.IPath path,
+ * org.eclipse.core.runtime.IPath[] inclusionPatterns,
+ * org.eclipse.core.runtime.IPath[] exclusionPatterns,
+ * org.eclipse.core.runtime.IPath specificOutputLocation,
+ * IClasspathAttribute[] extraAttributes)
+ * @see JavaCore#newVariableEntry(
+ * org.eclipse.core.runtime.IPath variablePath,
+ * org.eclipse.core.runtime.IPath variableSourceAttachmentPath,
+ * org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath,
+ * IAccessRule[] accessRules,
+ * IClasspathAttribute[] extraAttributes,
+ * boolean isExported)
+ * @since 3.1
+ */
+public interface ILoadpathAttribute {
+
+ /**
+ * Constant for the name of the optional attribute. The possible values
+ * for this attribute are <code>"true"</code> or <code>"false"</code>.
+ * When not present, <code>"false"</code> is assumed.
+ * If the value of this attribute is <code>"true"</code>, the classpath entry
+ * is optional. If the underlying resource or jar file doesn't exist, no error
+ * is reported and the classpath entry is ignored.
+ *
+ * @since 3.2
+ */
+ String OPTIONAL = "optional"; //$NON-NLS-1$
+
+ /**
+ * Returns the name of this classpath attribute.
+ *
+ * @return the name of this classpath attribute.
+ * @since 3.1
+ */
+ String getName();
+
+ /**
+ * Returns the value of this classpath attribute.
+ *
+ * @return the value of this classpath attribute.
+ * @since 3.1
+ */
+ String getValue();
+
+}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathEntry.java 2007-03-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/ILoadpathEntry.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -359,4 +359,12 @@
*/
boolean isExported();
+ /**
+ * Returns the extra classpath attributes for this classpath entry. Returns an empty array if this entry
+ * has no extra attributes.
+ *
+ * @return the possibly empty list of extra classpath attributes for this classpath entry
+ * @since 1.0.0
+ */
+ ILoadpathAttribute[] getExtraAttributes();
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java 2007-03-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/IRubyProject.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -41,6 +41,8 @@
public abstract IProject getProject();
public String[] getRequiredProjectNames() throws RubyModelException;
+
+ public ILoadpathEntry[] readRawLoadpath();
/**
* Returns the first type found following this project's classpath with the
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyConventions.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyConventions.java 2007-03-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyConventions.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -5,8 +5,10 @@
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.Status;
+import org.rubypeople.rdt.internal.core.LoadpathEntry;
import org.rubypeople.rdt.internal.core.RubyModelStatus;
import org.rubypeople.rdt.internal.core.util.Messages;
@@ -106,4 +108,8 @@
// TODO Actually do some validation
return RubyModelStatus.VERIFIED_OK;
}
+
+ public static IRubyModelStatus validateLoadpath(IRubyProject rubyProject, ILoadpathEntry[] rawCLoadpath, IPath projectOutputLocation) {
+ return LoadpathEntry.validateLoadpath(rubyProject, rawCLoadpath, projectOutputLocation);
+ }
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-03-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/RubyCore.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -43,6 +43,7 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.rubypeople.rdt.internal.core.BatchOperation;
+import org.rubypeople.rdt.internal.core.LoadpathAttribute;
import org.rubypeople.rdt.internal.core.LoadpathEntry;
import org.rubypeople.rdt.internal.core.RubyCorePreferenceInitializer;
import org.rubypeople.rdt.internal.core.RubyModel;
@@ -306,10 +307,15 @@
*/
public static final String CORE_CIRCULAR_CLASSPATH = PLUGIN_ID + ".circularClasspath"; //$NON-NLS-1$
+ /**
+ * Name of the User Library Container id.
+ * @since 1.0.0
+ */
+ public static final String USER_LIBRARY_CONTAINER_ID= "org.rubypeople.rdt.USER_LIBRARY"; //$NON-NLS-1$
+
+
private static final boolean VERBOSE = false;
-
-
private SymbolIndex symbolIndex;
private ISymbolFinder symbolFinder;
@@ -724,8 +730,7 @@
* @see #newSourceEntry(IPath, IPath[], IPath[])
*/
public static ILoadpathEntry newSourceEntry(IPath path) {
-
- return newSourceEntry(path, LoadpathEntry.INCLUDE_ALL, LoadpathEntry.EXCLUDE_NONE);
+ return newSourceEntry(path, LoadpathEntry.INCLUDE_ALL, LoadpathEntry.EXCLUDE_NONE, LoadpathEntry.NO_EXTRA_ATTRIBUTES);
}
/**
@@ -749,7 +754,7 @@
* @return a new source classpath entry
* @since 3.0
*/
- public static ILoadpathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns) {
+ public static ILoadpathEntry newSourceEntry(IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, ILoadpathAttribute[] extraAttributes) {
if (path == null) Assert.isTrue(false, "Source path cannot be null"); //$NON-NLS-1$
if (!path.isAbsolute()) Assert.isTrue(false, "Path for ILoadpathEntry must be absolute"); //$NON-NLS-1$
if (exclusionPatterns == null) Assert.isTrue(false, "Exclusion pattern set cannot be null"); //$NON-NLS-1$
@@ -760,10 +765,11 @@
path,
inclusionPatterns,
exclusionPatterns,
+ extraAttributes,
false);
}
- public static ILoadpathEntry newLibraryEntry(IPath path, boolean isExported) {
+ public static ILoadpathEntry newLibraryEntry(IPath path, ILoadpathAttribute[] extraAttributes, boolean isExported) {
if (path == null) Assert.isTrue(false, "Library path cannot be null"); //$NON-NLS-1$
if (!path.isAbsolute()) Assert.isTrue(false, "Path for ILoadpathEntry must be absolute"); //$NON-NLS-1$
@@ -773,11 +779,12 @@
RubyProject.canonicalizedPath(path),
LoadpathEntry.INCLUDE_ALL, // inclusion patterns
LoadpathEntry.EXCLUDE_NONE, // exclusion patterns
+ extraAttributes,
isExported);
}
- public static ILoadpathEntry newProjectEntry(IPath path, boolean isExported) {
+ public static ILoadpathEntry newProjectEntry(IPath path, ILoadpathAttribute[] extraAttributes, boolean isExported) {
if (!path.isAbsolute()) Assert.isTrue(false, "Path for ILoadpathEntry must be absolute"); //$NON-NLS-1$
return new LoadpathEntry(
@@ -785,10 +792,11 @@
path,
LoadpathEntry.INCLUDE_ALL, // inclusion patterns
LoadpathEntry.EXCLUDE_NONE, // exclusion patterns
+ extraAttributes,
isExported);
}
- public static ILoadpathEntry newVariableEntry(IPath variablePath, boolean isExported) {
+ public static ILoadpathEntry newVariableEntry(IPath variablePath, ILoadpathAttribute[] extraAttributes, boolean isExported) {
if (variablePath == null) Assert.isTrue(false, "Variable path cannot be null"); //$NON-NLS-1$
if (variablePath.segmentCount() < 1) {
Assert.isTrue(
@@ -801,10 +809,11 @@
variablePath,
LoadpathEntry.INCLUDE_ALL, // inclusion patterns
LoadpathEntry.EXCLUDE_NONE, // exclusion patterns
+ extraAttributes,
isExported);
}
- public static ILoadpathEntry newContainerEntry(IPath containerPath,
+ public static ILoadpathEntry newContainerEntry(IPath containerPath, ILoadpathAttribute[] extraAttributes,
boolean isExported) {
if (containerPath == null) {
Assert.isTrue(false, "Container path cannot be null"); //$NON-NLS-1$
@@ -818,6 +827,7 @@
containerPath,
LoadpathEntry.INCLUDE_ALL, // inclusion patterns
LoadpathEntry.EXCLUDE_NONE, // exclusion patterns
+ extraAttributes,
isExported);
}
@@ -845,11 +855,13 @@
// internal project
return RubyCore.newProjectEntry(
resolvedPath,
+ entry.getExtraAttributes(),
entry.isExported());
case IResource.FOLDER :
// internal binary folder
return RubyCore.newLibraryEntry(
resolvedPath,
+ entry.getExtraAttributes(),
entry.isExported());
}
}
@@ -858,10 +870,10 @@
if (target instanceof File) {
File externalFile = RubyModel.getFolder(target);
if (externalFile != null) {
- return RubyCore.newLibraryEntry(resolvedPath, entry.isExported());
+ return RubyCore.newLibraryEntry(resolvedPath, entry.getExtraAttributes(), entry.isExported());
} else { // external binary folder
if (resolvedPath.isAbsolute()){
- return RubyCore.newLibraryEntry(resolvedPath, entry.isExported());
+ return RubyCore.newLibraryEntry(resolvedPath, entry.getExtraAttributes(), entry.isExported());
}
}
}
@@ -1317,19 +1329,45 @@
}
public static ILoadpathEntry newProjectEntry(IPath fullPath) {
- return newProjectEntry(fullPath, false);
+ return newProjectEntry(fullPath, LoadpathEntry.NO_EXTRA_ATTRIBUTES, false);
}
public static ILoadpathEntry newVariableEntry(IPath path) {
- return newVariableEntry(path, false);
+ return newVariableEntry(path, LoadpathEntry.NO_EXTRA_ATTRIBUTES, false);
}
public static ILoadpathEntry newContainerEntry(IPath path) {
- return newContainerEntry(path, false);
+ return newContainerEntry(path, LoadpathEntry.NO_EXTRA_ATTRIBUTES, false);
}
public static ILoadpathEntry newLibraryEntry(IPath p) {
- return newLibraryEntry(p, false);
+ return newLibraryEntry(p, LoadpathEntry.NO_EXTRA_ATTRIBUTES, false);
}
+ /**
+ * Creates and returns a new loadpath attribute with the given name and the given value.
+ *
+ * @return a new loadpath attribute
+ * @since 0.9.0
+ */
+ public static ILoadpathAttribute newLoadpathAttribute(String name, String value) {
+ return new LoadpathAttribute(name, value);
+ }
+
+ public static ILoadpathEntry newLibraryEntry(IPath path, boolean isExported) {
+ return newLibraryEntry(path, LoadpathEntry.NO_EXTRA_ATTRIBUTES, isExported);
+ }
+
+ public static ILoadpathEntry newVariableEntry(IPath path, boolean isExported) {
+ return newVariableEntry(path, LoadpathEntry.NO_EXTRA_ATTRIBUTES, isExported);
+ }
+
+ public static ILoadpathEntry newProjectEntry(IPath path, boolean isExported) {
+ return newProjectEntry(path, LoadpathEntry.NO_EXTRA_ATTRIBUTES, isExported);
+ }
+
+ public static ILoadpathEntry newContainerEntry(IPath path, boolean isExported) {
+ return newContainerEntry(path, LoadpathEntry.NO_EXTRA_ATTRIBUTES, isExported);
+ }
+
}
\ No newline at end of file
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathAttribute.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathAttribute.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathAttribute.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -0,0 +1,38 @@
+package org.rubypeople.rdt.internal.core;
+
+import org.rubypeople.rdt.core.ILoadpathAttribute;
+import org.rubypeople.rdt.internal.core.util.Util;
+
+public class LoadpathAttribute implements ILoadpathAttribute {
+
+ private String name;
+ private String value;
+
+ public LoadpathAttribute(String name, String value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public boolean equals(Object obj) {
+ if (!(obj instanceof LoadpathAttribute)) return false;
+ LoadpathAttribute other = (LoadpathAttribute) obj;
+ return this.name.equals(other.name) && this.value.equals(other.value);
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ public int hashCode() {
+ return Util.combineHashCodes(this.name.hashCode(), this.value.hashCode());
+ }
+
+ public String toString() {
+ return this.name + "=" + this.value; //$NON-NLS-1$
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathEntry.java 2007-03-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/LoadpathEntry.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -11,6 +11,7 @@
import org.eclipse.core.runtime.AssertionFailedException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.rubypeople.rdt.core.ILoadpathAttribute;
import org.rubypeople.rdt.core.ILoadpathEntry;
import org.rubypeople.rdt.core.IRubyModelStatus;
import org.rubypeople.rdt.core.IRubyProject;
@@ -33,6 +34,10 @@
public static final String TAG_EXPORTED = "exported"; //$NON-NLS-1$
public static final String TAG_INCLUDING = "including"; //$NON-NLS-1$
public static final String TAG_EXCLUDING = "excluding"; //$NON-NLS-1$
+ public static final String TAG_ATTRIBUTES = "attributes"; //$NON-NLS-1$
+ public static final String TAG_ATTRIBUTE = "attribute"; //$NON-NLS-1$
+ public static final String TAG_ATTRIBUTE_NAME = "name"; //$NON-NLS-1$
+ public static final String TAG_ATTRIBUTE_VALUE = "value"; //$NON-NLS-1$
static class UnknownXmlElements {
String[] attributes;
@@ -55,6 +60,10 @@
private final static char[][] UNINIT_PATTERNS = new char[][] { "Non-initialized yet".toCharArray()}; //$NON-NLS-1$
/*
+ * Default extra attributes
+ */
+ public final static ILoadpathAttribute[] NO_EXTRA_ATTRIBUTES = {};
+ /*
* Default inclusion pattern set
*/
public final static IPath[] INCLUDE_ALL = {};
@@ -70,18 +79,23 @@
* The export flag
*/
private boolean isExported;
+
+ /*
+ * The extra attributes
+ */
+ ILoadpathAttribute[] extraAttributes;
public LoadpathEntry(IProject project) {
- this(ILoadpathEntry.CPE_PROJECT, project.getFullPath(), INCLUDE_ALL, EXCLUDE_NONE, true);
+ this(ILoadpathEntry.CPE_PROJECT, project.getFullPath(), INCLUDE_ALL, EXCLUDE_NONE, NO_EXTRA_ATTRIBUTES, true);
this.project = project;
}
- public LoadpathEntry(int entryKind, IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, boolean isExported) {
+ public LoadpathEntry(int entryKind, IPath path, IPath[] inclusionPatterns, IPath[] exclusionPatterns, ILoadpathAttribute[] extraAttributes, boolean isExported) {
this.path = path;
this.entryKind = entryKind;
this.inclusionPatterns = inclusionPatterns;
this.exclusionPatterns = exclusionPatterns;
-
+ this.extraAttributes = extraAttributes;
if (inclusionPatterns != INCLUDE_ALL && inclusionPatterns.length > 0) {
this.fullInclusionPatternChars = UNINIT_PATTERNS;
}
@@ -223,6 +237,7 @@
getPath(),
this.inclusionPatterns,
this.exclusionPatterns,
+ this.extraAttributes,
referringEntry.isExported() || this.isExported); // duplicate container entry for tagging it as exported
}
// no need to clone
@@ -256,6 +271,10 @@
IPath[] exclusionPatterns = decodePatterns(attributes, TAG_EXCLUDING);
if (exclusionPatterns == null) exclusionPatterns = EXCLUDE_NONE;
+// extra attributes (optional)
+ NodeList attributeList = getChildAttributes(TAG_ATTRIBUTES, children, foundChildren);
+ ILoadpathAttribute[] extraAttributes = decodeExtraAttributes(attributeList);
+
String[] unknownAttributes = null;
ArrayList unknownChildren = null;
@@ -295,38 +314,43 @@
path,
LoadpathEntry.INCLUDE_ALL, // inclusion patterns
LoadpathEntry.EXCLUDE_NONE, // exclusion patterns
+ extraAttributes,
isExported);
break;
case ILoadpathEntry.CPE_LIBRARY :
entry = RubyCore.newLibraryEntry(
path,
+ extraAttributes,
isExported);
break;
case ILoadpathEntry.CPE_SOURCE :
// must be an entry in this project or specify another project
String projSegment = path.segment(0);
if (projSegment != null && projSegment.equals(project.getElementName())) { // this project
- entry = RubyCore.newSourceEntry(path, inclusionPatterns, exclusionPatterns);
+ entry = RubyCore.newSourceEntry(path, inclusionPatterns, exclusionPatterns, extraAttributes);
} else {
if (path.segmentCount() == 1) {
// another project
entry = RubyCore.newProjectEntry(
path,
+ extraAttributes,
isExported);
} else {
// an invalid source folder
- entry = RubyCore.newSourceEntry(path, inclusionPatterns, exclusionPatterns);
+ entry = RubyCore.newSourceEntry(path, inclusionPatterns, exclusionPatterns, extraAttributes);
}
}
break;
case ILoadpathEntry.CPE_VARIABLE :
entry = RubyCore.newVariableEntry(
path,
+ extraAttributes,
isExported);
break;
case ILoadpathEntry.CPE_CONTAINER :
entry = RubyCore.newContainerEntry(
path,
+ extraAttributes,
isExported);
break;
default :
@@ -343,6 +367,39 @@
return entry;
}
+ public static NodeList getChildAttributes(String childName, NodeList children, boolean[] foundChildren) {
+ for (int i = 0, length = foundChildren.length; i < length; i++) {
+ Node node = children.item(i);
+ if (childName.equals(node.getNodeName())) {
+ foundChildren[i] = true;
+ return node.getChildNodes();
+ }
+ }
+ return null;
+ }
+
+ static ILoadpathAttribute[] decodeExtraAttributes(NodeList attributes) {
+ if (attributes == null) return NO_EXTRA_ATTRIBUTES;
+ int length = attributes.getLength();
+ if (length == 0) return NO_EXTRA_ATTRIBUTES;
+ ILoadpathAttribute[] result = new ILoadpathAttribute[length];
+ int index = 0;
+ for (int i = 0; i < length; ++i) {
+ Node node = attributes.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE) {
+ Element attribute = (Element)node;
+ String name = attribute.getAttribute(TAG_ATTRIBUTE_NAME);
+ if (name == null) continue;
+ String value = attribute.getAttribute(TAG_ATTRIBUTE_VALUE);
+ if (value == null) continue;
+ result[index++] = new LoadpathAttribute(name, value);
+ }
+ }
+ if (index != length)
+ System.arraycopy(result, 0, result = new ILoadpathAttribute[index], 0, index);
+ return result;
+ }
+
private static void decodeUnknownNode(Node node, StringBuffer buffer, IRubyProject project) {
ByteArrayOutputStream s = new ByteArrayOutputStream();
OutputStreamWriter writer;
@@ -451,17 +508,21 @@
}
public boolean isOptional() {
- // TODO Actually take in extra attributes that specifies whether this could be optional
+ for (int i = 0, length = this.extraAttributes.length; i < length; i++) {
+ ILoadpathAttribute attribute = this.extraAttributes[i];
+ if (ILoadpathAttribute.OPTIONAL.equals(attribute.getName()) && "true".equals(attribute.getValue())) //$NON-NLS-1$
+ return true;
+ }
return false;
}
- public static IRubyModelStatus validateLoadpathEntry(RubyProject project2,
+ public static IRubyModelStatus validateLoadpathEntry(IRubyProject project,
ILoadpathEntry rawEntry, boolean b, boolean c) {
// TODO Actually do some checking of the entry
return RubyModelStatus.VERIFIED_OK;
}
- public static IRubyModelStatus validateLoadpath(RubyProject project2,
+ public static IRubyModelStatus validateLoadpath(IRubyProject project,
ILoadpathEntry[] resolvedPath, IPath projectOutputLocation) {
// FIXME Remove outputLocation
// TODO Actually do some checking of the loadpath
@@ -508,7 +569,7 @@
parameters.put(tagName, tagValue);
}
- boolean hasExtraAttributes = false;
+ boolean hasExtraAttributes = this.extraAttributes.length != 0;
ArrayList unknownChildren = unknownXmlElements != null ? unknownXmlElements.children : null;
boolean hasUnknownChildren = unknownChildren != null;
writer.printTag(
@@ -517,14 +578,28 @@
indent,
newLine,
!hasUnknownChildren/*close tag if no unknown children*/);
-
+ if (hasExtraAttributes)
+ encodeExtraAttributes(writer, indent, newLine);
if (hasUnknownChildren) {
encodeUnknownChildren(writer, indent, newLine, unknownChildren);
+ if (hasExtraAttributes || hasUnknownChildren)
writer.endTag(TAG_LOADPATHENTRY, indent, true/*insert new line*/);
}
}
+ void encodeExtraAttributes(XMLWriter writer, boolean indent, boolean newLine) {
+ writer.startTag(TAG_ATTRIBUTES, indent);
+ for (int i = 0; i < this.extraAttributes.length; i++) {
+ ILoadpathAttribute attribute = this.extraAttributes[i];
+ HashMap parameters = new HashMap();
+ parameters.put(TAG_ATTRIBUTE_NAME, attribute.getName());
+ parameters.put(TAG_ATTRIBUTE_VALUE, attribute.getValue());
+ writer.printTag(TAG_ATTRIBUTE, parameters, indent, newLine, true);
+ }
+ writer.endTag(TAG_ATTRIBUTES, indent, true/*insert new line*/);
+ }
+
/**
* Encode some patterns into XML parameter tag
*/
@@ -545,4 +620,8 @@
writer.printString(child, indent, false/*don't insert new line*/);
}
}
+
+ public ILoadpathAttribute[] getExtraAttributes() {
+ return extraAttributes;
+ }
}
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-03-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -62,6 +62,7 @@
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.osgi.service.prefs.BackingStoreException;
+import org.rubypeople.rdt.core.ILoadpathAttribute;
import org.rubypeople.rdt.core.ILoadpathContainer;
import org.rubypeople.rdt.core.ILoadpathEntry;
import org.rubypeople.rdt.core.IParent;
@@ -2255,9 +2256,10 @@
IPath[] inclusionPatterns = loadPaths();
IPath[] exclusionPatterns = loadPaths();
boolean isExported = loadBoolean();
+ ILoadpathAttribute[] extraAttributes = loadAttributes();
ILoadpathEntry entry = new LoadpathEntry(entryKind,
- path, inclusionPatterns, exclusionPatterns, isExported);
+ path, inclusionPatterns, exclusionPatterns, extraAttributes, isExported);
ILoadpathEntry[] array = this.allLoadpathEntries;
@@ -2275,7 +2277,28 @@
return entry;
}
+
+ private ILoadpathAttribute[] loadAttributes() throws IOException {
+ int count = loadInt();
+ if (count == 0)
+ return LoadpathEntry.NO_EXTRA_ATTRIBUTES;
+
+ ILoadpathAttribute[] attributes = new ILoadpathAttribute[count];
+
+ for (int i = 0; i < count; ++i)
+ attributes[i] = loadAttribute();
+
+ return attributes;
+ }
+
+ private ILoadpathAttribute loadAttribute() throws IOException {
+ String name = loadString();
+ String value = loadString();
+
+ return new LoadpathAttribute(name, value);
+ }
+
private void loadContainers(IRubyProject project) throws IOException {
boolean projectIsAccessible = project.getProject().isAccessible();
int count = loadInt();
@@ -2475,9 +2498,23 @@
savePaths(entry.getInclusionPatterns());
savePaths(entry.getExclusionPatterns());
this.out.writeBoolean(entry.isExported());
+ saveAttributes(entry.getExtraAttributes());
}
}
+
+ private void saveAttribute(ILoadpathAttribute attribute) throws IOException {
+ saveString(attribute.getName());
+ saveString(attribute.getValue());
+ }
+ private void saveAttributes(ILoadpathAttribute[] attributes) throws IOException {
+ int count = attributes == null ? 0 : attributes.length;
+
+ saveInt(count);
+ for (int i = 0; i < count; ++i)
+ saveAttribute(attributes[i]);
+ }
+
private void saveContainers(IRubyProject project, Map containerMap)
throws IOException {
saveInt(containerMap.size());
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-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -947,6 +947,14 @@
return new ILoadpathEntry[] { RubyCore.newSourceEntry(this.project.getFullPath()) };
}
+
+ /**
+ * @see IRubyProject
+ */
+ public ILoadpathEntry[] readRawLoadpath() {
+ // Read loadpath file without creating markers nor logging problems
+ return this.readLoadpathFile(false, false);
+ }
/**
* Reads the .classpath file from disk and returns the list of entries it
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-07 21:40:13 UTC (rev 2104)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/util/Messages.java 2007-03-07 21:40:23 UTC (rev 2105)
@@ -201,4 +201,12 @@
public static String bind(String message, Object[] bindings) {
return MessageFormat.format(message, bindings);
}
+
+ public static String format(String message, String[] bindings) {
+ return bind(message, bindings);
+ }
+
+ public static String format(String message, String binding) {
+ return bind(message, binding);
+ }
}
\ 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-03-07 21:40:14
|
Revision: 2104
http://svn.sourceforge.net/rubyeclipse/?rev=2104&view=rev
Author: cawilliams
Date: 2007-03-07 13:40:13 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-03-07 16:40:53 UTC (rev 2103)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/core/tests/AbstractRubyModelTest.java 2007-03-07 21:40:13 UTC (rev 2104)
@@ -34,6 +34,7 @@
import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.core.LoadpathEntry;
import org.rubypeople.rdt.internal.core.util.CharOperation;
import org.rubypeople.rdt.internal.core.util.Util;
@@ -430,7 +431,8 @@
RubyCore.newSourceEntry(
projectPath.append(sourcePath),
inclusionPaths,
- exclusionPaths);
+ exclusionPaths,
+ LoadpathEntry.NO_EXTRA_ATTRIBUTES);
}
for (int i= 0; i < libLength; i++) {
String lib = libraries[i];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-07 16:40:54
|
Revision: 2103
http://svn.sourceforge.net/rubyeclipse/?rev=2103&view=rev
Author: cawilliams
Date: 2007-03-07 08:40:53 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
try to fix format action...
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.properties
trunk/org.rubypeople.rdt.ui/plugin.xml
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorActionContributor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RubyActionIds.java
Modified: trunk/org.rubypeople.rdt.ui/plugin.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.properties 2007-03-07 13:36:17 UTC (rev 2102)
+++ trunk/org.rubypeople.rdt.ui/plugin.properties 2007-03-07 16:40:53 UTC (rev 2103)
@@ -85,6 +85,7 @@
UncommentAction.label=&Uncomment@Ctrl+\\
CommentAction.label=&Comment@Ctrl+/
ToggleCommentAction.label=&Toggle Comment@Ctrl+Shift+C
+FormatAction.label=Format@Ctrl+Shift+f
category.source.name=Ruby Source
category.source.description=Ruby Source Actions
@@ -113,8 +114,8 @@
ActionDefinition.gotoMatchingBracket.name= Go to Matching Bracket
ActionDefinition.gotoMatchingBracket.description= Moves the cursor to the matching bracket
-ActionDefinition.gotoMatchingBracket.name= Surround with begin/rescue Block
-ActionDefinition.gotoMatchingBracket.description= Surround the selected text with a begin/rescue block
+ActionDefinition.surroundWith.beginRescue.name= Surround with begin/rescue Block
+ActionDefinition.surroundWith.beginRescue.description= Surround the selected text with a begin/rescue block
#--- commands not assigned to a menu
ActionDefinition.foldingCollapseMembers.name= Collapse Members
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-03-07 13:36:17 UTC (rev 2102)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-03-07 16:40:53 UTC (rev 2103)
@@ -389,7 +389,7 @@
symbolicFontName="org.rubypeople.rdt.ui.editors.textfont"
id="org.rubypeople.rdt.ui.ExternalRubyEditor">
</editor>
- </extension>
+ </extension>
<extension
point="org.eclipse.ui.contexts">
@@ -620,6 +620,13 @@
id="org.rubypeople.rdt.ui.actions.ToggleComment">
</action>
<action
+ definitionId="org.rubypeople.rdt.ui.edit.text.ruby.format"
+ label="%FormatAction.label"
+ retarget="true"
+ menubarPath="org.rubypeople.rdt.ui.ruby.menu/editGroup"
+ id="org.rubypeople.rdt.ui.actions.Format">
+ </action>
+ <action
definitionId="org.rubypeople.rdt.ui.edit.text.ruby.surround.with.begin.rescue"
label="%SurroundWithBeginRescueAction.label"
retarget="true"
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorActionContributor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorActionContributor.java 2007-03-07 13:36:17 UTC (rev 2102)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditorActionContributor.java 2007-03-07 16:40:53 UTC (rev 2103)
@@ -72,6 +72,8 @@
actionBars.setGlobalActionHandler(RubyActionIds.COMMENT, getAction(textEditor, "Comment"));
actionBars.setGlobalActionHandler(RubyActionIds.UNCOMMENT, getAction(textEditor,
"Uncomment"));
+ actionBars.setGlobalActionHandler(RubyActionIds.TOGGLE_COMMENT, getAction(textEditor, "ToggleComment")); //$NON-NLS-1$
+ actionBars.setGlobalActionHandler(RubyActionIds.FORMAT, getAction(textEditor, "Format")); //$NON-NLS-1$
/** The global actions to be connected with editor actions */
IAction action = getAction(textEditor, ITextEditorActionConstants.NEXT);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RubyActionIds.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RubyActionIds.java 2007-03-07 13:36:17 UTC (rev 2102)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RubyActionIds.java 2007-03-07 16:40:53 UTC (rev 2103)
@@ -11,4 +11,7 @@
* (value <code>"org.rubypeople.rdt.ui.actions.Uncomment"</code>).
*/
public static final String UNCOMMENT = "org.rubypeople.rdt.ui.actions.Uncomment";
+
+ public static final String TOGGLE_COMMENT = "org.rubypeople.rdt.ui.actions.ToggleComment";
+ public static final String FORMAT = "org.rubypeople.rdt.ui.actions.Format";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-03-07 13:36:36
|
Revision: 2102
http://svn.sourceforge.net/rubyeclipse/?rev=2102&view=rev
Author: mirkostocker
Date: 2007-03-07 05:36:17 -0800 (Wed, 07 Mar 2007)
Log Message:
-----------
Fix for a test I broke while externalizing strings and fix a bug in the docprovider
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/messages.properties
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java
trunk/org.rubypeople.rdt.refactoring.tests/resources/core/movemethod/conditionchecks/move_method_checker_test_1.test_properties
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/MultipleDocumentsInOneProvider.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/messages.properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/messages.properties 2007-03-06 23:45:56 UTC (rev 2101)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/messages.properties 2007-03-07 13:36:17 UTC (rev 2102)
@@ -14,8 +14,8 @@
MoveMethodConditionChecker_CannotMoveConstructor=The selected method is a constructor and thus cannot be moved.
MoveMethodConditionChecker_NoTarget=There is no target class where you could move to.
MoveMethodConditionChecker_NoFieldOfTargetType=There is no possible field of the type of the target class.
-MoveMethodConditionChecker_TheMethod=The method
-MoveMethodConditionChecker_CanBeCalledFromOutside=\ can be called from outside of the class
+MoveMethodConditionChecker_TheMethod=The method \"
+MoveMethodConditionChecker_CanBeCalledFromOutside=\" can be called from outside of the class
MoveMethodConditionChecker_MightNotGetReplaced=. Since Ruby is dynamically typed, calls from outside the class definition might not get replaced with calls to the class
MoveMethodConditionChecker_ContainsClassField=" contains the class field "
MoveMethodConditionChecker_MovingMightAffectTheFunctionality=". Moving it might affect the functionality of the class "
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java 2007-03-06 23:45:56 UTC (rev 2101)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java 2007-03-07 13:36:17 UTC (rev 2102)
@@ -62,14 +62,12 @@
for(String actFileName : candidates) {
String fileName = getFileNameWithoutPath(actFileName);
if(includedFiles.contains(fileName)) {
- addFile(fileName, docProvider.getFileContent(fileName));
- markedForRemoval.add(actFileName);
+ addAndRemove(markedForRemoval, actFileName, fileName);
continue;
}
for (FCallNode node : getRequires(actFileName)) {
if(nodeRequiresMe(node)) {
- addFile(fileName, docProvider.getFileContent(fileName));
- markedForRemoval.add(actFileName);
+ addAndRemove(markedForRemoval, actFileName, fileName);
}
}
}
@@ -78,6 +76,11 @@
} while(markedForRemoval.size() > 0);
}
+ private void addAndRemove(ArrayList<String> markedForRemoval, String actFileName, String fileName) {
+ addFile(fileName, docProvider.getFileContent(actFileName));
+ markedForRemoval.add(actFileName);
+ }
+
private String cutProjectPath(String fileName) {
return fileName.substring(fileName.lastIndexOf('/') + 1);
Modified: trunk/org.rubypeople.rdt.refactoring.tests/resources/core/movemethod/conditionchecks/move_method_checker_test_1.test_properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/resources/core/movemethod/conditionchecks/move_method_checker_test_1.test_properties 2007-03-06 23:45:56 UTC (rev 2101)
+++ trunk/org.rubypeople.rdt.refactoring.tests/resources/core/movemethod/conditionchecks/move_method_checker_test_1.test_properties 2007-03-07 13:36:17 UTC (rev 2102)
@@ -5,7 +5,7 @@
# Optional value
selectedField=@myB
finalWarning0=An attr_reader for the field x will be generated.
-finalWarning1=The method moveMethod can be called from outside of the class A. Since Ruby is dynamically typed, calls from outside the class definition might not get replaced with calls to the class B.
+finalWarning1=The method "moveMethod" can be called from outside of the class A. Since Ruby is dynamically typed, calls from outside the class definition might not get replaced with calls to the class B.
finalWarning2=The method "moveMethod" contains the class field "@@a". Moving it might affect the functionality of the class "A".
finalWarning3=The visibility of method method1 will be changed to public.
finalWarning4=The visibility of method method2 will be changed to public.
Modified: trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/MultipleDocumentsInOneProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/MultipleDocumentsInOneProvider.java 2007-03-06 23:45:56 UTC (rev 2101)
+++ trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/MultipleDocumentsInOneProvider.java 2007-03-07 13:36:17 UTC (rev 2102)
@@ -88,7 +88,6 @@
}
public String getFileContent(String currentFileName) {
- assert "".equals(currentFileName) : "Should always equal getActiveFileName()";
return getActiveFileContent();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-06 23:45:59
|
Revision: 2101
http://svn.sourceforge.net/rubyeclipse/?rev=2101&view=rev
Author: cawilliams
Date: 2007-03-06 15:45:56 -0800 (Tue, 06 Mar 2007)
Log Message:
-----------
fix swapped names
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java 2007-03-06 23:34:22 UTC (rev 2100)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/action/RefactoringActionGroup.java 2007-03-06 23:45:56 UTC (rev 2101)
@@ -63,7 +63,7 @@
}
private IMenuManager getRefactorMenu(TextSelectionProvider selectionProvider) {
- IMenuManager submenu = new MenuManager(Messages.SourceActionGroup);
+ IMenuManager submenu = new MenuManager(Messages.RefactoringActionGroup);
submenu.add(new RefactoringAction(ConvertTempToFieldRefactoring.class, ConvertTempToFieldRefactoring.NAME, selectionProvider));
submenu.add(new RefactoringAction(EncapsulateFieldRefactoring.class, EncapsulateFieldRefactoring.NAME, selectionProvider));
submenu.add(new RefactoringAction(ExtractMethodRefactoring.class, ExtractMethodRefactoring.NAME, selectionProvider));
@@ -81,7 +81,7 @@
}
private IMenuManager getSourceMenu(TextSelectionProvider selectionProvider) {
- IMenuManager submenu = new MenuManager(Messages.RefactoringActionGroup);
+ IMenuManager submenu = new MenuManager(Messages.SourceActionGroup);
submenu.add(new RefactoringAction(GenerateAccessorsRefactoring.class, GenerateAccessorsRefactoring.NAME, selectionProvider));
submenu.add(new RefactoringAction(GenerateConstructorRefactoring.class, GenerateConstructorRefactoring.NAME, selectionProvider));
submenu.add(new RefactoringAction(OverrideMethodRefactoring.class, OverrideMethodRefactoring.NAME, selectionProvider));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-06 23:34:26
|
Revision: 2100
http://svn.sourceforge.net/rubyeclipse/?rev=2100&view=rev
Author: cawilliams
Date: 2007-03-06 15:34:22 -0800 (Tue, 06 Mar 2007)
Log Message:
-----------
more tweaking to the stdout/stderr sync stuff - need to set $0 to the first argument in addition to 'load'ing it (otherwise common idiom of "if __FILE__ == $0" doesn't work)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
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-03-06 23:33:26 UTC (rev 2099)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-03-06 23:34:22 UTC (rev 2100)
@@ -201,7 +201,7 @@
arguments.add("-e");
arguments.add("STDERR.sync=true");
arguments.add("-e");
- arguments.add("load(ARGV.shift)");
+ arguments.add("load($0=ARGV.shift)");
String[] lp= config.getLoadPath();
if (lp.length > 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-06 23:33:28
|
Revision: 2099
http://svn.sourceforge.net/rubyeclipse/?rev=2099&view=rev
Author: cawilliams
Date: 2007-03-06 15:33:26 -0800 (Tue, 06 Mar 2007)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java 2007-03-06 21:00:52 UTC (rev 2098)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java 2007-03-06 23:33:26 UTC (rev 2099)
@@ -53,7 +53,7 @@
"data for latest matche for regexp",
"whether or not case-sensitive in string matching",
"input record separator", "output record separator",
- "the name of the ruby scpript file",
+ "the name of the ruby script file",
"command line arguments for the ruby scpript",
"PID for ruby interpreter",
"status of the latest executed child process",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-03-06 21:00:54
|
Revision: 2098
http://svn.sourceforge.net/rubyeclipse/?rev=2098&view=rev
Author: mbarchfe
Date: 2007-03-06 13:00:52 -0800 (Tue, 06 Mar 2007)
Log Message:
-----------
fix path to gem
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-03-06 19:42:25 UTC (rev 2097)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-03-06 21:00:52 UTC (rev 2098)
@@ -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.\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.
+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}.\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.
|