|
From: <caw...@us...> - 2007-06-06 14:34:59
|
Revision: 2583
http://svn.sourceforge.net/rubyeclipse/?rev=2583&view=rev
Author: cawilliams
Date: 2007-06-06 07:34:57 -0700 (Wed, 06 Jun 2007)
Log Message:
-----------
move all OccurrencesFinder stuff to UI
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/DefaultOccurrencesFinder.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/FindOccurrencesEngine.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesSearchQuery.java
trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search/MarkOccurrencesTest.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/AbstractOccurencesFinder.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/IOccurrencesFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/AbstractOccurencesFinder.java
Deleted: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/IOccurrencesFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/IOccurrencesFinder.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/IOccurrencesFinder.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.rubypeople.rdt.core.search;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.jruby.ast.Node;
-import org.rubypeople.rdt.core.IRubyElement;
-
-public interface IOccurrencesFinder {
-
- /**
- *
- * @param source
- * Ruby source to search for occurrences
- * @param offset
- * position in source where selection is
- * @param length
- * length of the selection
- * @return
- */
- public String initialize(String source, int offset, int length);
-
- /**
- *
- * @param root
- * the root node
- * @param offset
- * position in source where selection is
- * @param length
- * length of the selection
- * @return
- */
- public String initialize(Node root, int offset, int length);
-
- /**
- * Returns a lit of AST Nodes back (which contain their associated
- * positions).
- *
- * @return List of AST Nodes
- */
- public List<Position> perform();
-
- public String getJobLabel();
-
- /**
- * Returns the plural label for this finder with 3 placeholders:
- * <ul>
- * <li>{0} for the {@link #getElementName() element name}</li>
- * <li>{1} for the number of results found</li>
- * <li>{2} for the scope (name of the compilation unit)</li>
- * </ul>
- *
- * @return the unformatted label
- */
- public String getUnformattedPluralLabel();
-
- /**
- * Returns the singular label for this finder with 2 placeholders:
- * <ul>
- * <li>{0} for the {@link #getElementName() element name}</li>
- * <li>{1} for the scope (name of the compilation unit)</li>
- * </ul>
- *
- * @return the unformatted label
- */
- public String getUnformattedSingularLabel();
-
- /**
- * Returns the name of the element to look for or <code>null</code> if the
- * finder hasn't been initialized yet.
- *
- * @return the name of the element
- */
- public String getElementName();
-
- public void collectOccurrenceMatches(IRubyElement element,
- IDocument document, Collection resultingMatches);
-
- /* Preferences */
- public void setFMarkConstantOccurrences(boolean markConstantOccurrences);
- public void setFMarkFieldOccurrences(boolean markFieldOccurrences);
- public void setFMarkLocalVariableOccurrences(boolean markLocalVariableOccurrences);
- public void setFMarkMethodExitPoints(boolean markMethodExitPoints);
- public void setFMarkMethodOccurrences(boolean markMethodOccurrences);
- public void setFMarkOccurrenceAnnotations(boolean markOccurrenceAnnotations);
- public void setFMarkTypeOccurrences(boolean markTypeOccurrences);
- public void setFStickyOccurrenceAnnotations(boolean stickyOccurrenceAnnotations);
-
-}
Deleted: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/AbstractOccurencesFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/AbstractOccurencesFinder.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/AbstractOccurencesFinder.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -1,48 +0,0 @@
-package org.rubypeople.rdt.internal.ti;
-
-import org.rubypeople.rdt.core.search.IOccurrencesFinder;
-
-public abstract class AbstractOccurencesFinder implements IOccurrencesFinder {
-
- protected boolean fMarkOccurrenceAnnotations;
- protected boolean fStickyOccurrenceAnnotations;
- protected boolean fMarkTypeOccurrences;
- protected boolean fMarkMethodOccurrences;
- protected boolean fMarkConstantOccurrences;
- protected boolean fMarkFieldOccurrences;
- protected boolean fMarkLocalVariableOccurrences;
- protected boolean fMarkMethodExitPoints;
-
- public void setFMarkConstantOccurrences(boolean markConstantOccurrences) {
- fMarkConstantOccurrences = markConstantOccurrences;
- }
-
- public void setFMarkFieldOccurrences(boolean markFieldOccurrences) {
- fMarkFieldOccurrences = markFieldOccurrences;
- }
-
- public void setFMarkLocalVariableOccurrences(boolean markLocalVariableOccurrences) {
- fMarkLocalVariableOccurrences = markLocalVariableOccurrences;
- }
-
- public void setFMarkMethodExitPoints(boolean markMethodExitPoints) {
- fMarkMethodExitPoints = markMethodExitPoints;
- }
-
- public void setFMarkMethodOccurrences(boolean markMethodOccurrences) {
- fMarkMethodOccurrences = markMethodOccurrences;
- }
-
- public void setFMarkOccurrenceAnnotations(boolean markOccurrenceAnnotations) {
- fMarkOccurrenceAnnotations = markOccurrenceAnnotations;
- }
-
- public void setFMarkTypeOccurrences(boolean markTypeOccurrences) {
- fMarkTypeOccurrences = markTypeOccurrences;
- }
-
- public void setFStickyOccurrenceAnnotations(boolean stickyOccurrenceAnnotations) {
- fStickyOccurrenceAnnotations = stickyOccurrenceAnnotations;
- }
-
-}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyAbstractEditor.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -80,10 +80,10 @@
import org.rubypeople.rdt.core.ISourceReference;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.core.search.IOccurrencesFinder;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor.ITextConverter;
import org.rubypeople.rdt.internal.ui.search.DefaultOccurrencesFinder;
+import org.rubypeople.rdt.internal.ui.search.IOccurrencesFinder;
import org.rubypeople.rdt.internal.ui.text.ContentAssistPreference;
import org.rubypeople.rdt.internal.ui.text.IRubyPartitions;
import org.rubypeople.rdt.internal.ui.text.PreferencesAdapter;
Copied: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/AbstractOccurencesFinder.java (from rev 2581, trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/AbstractOccurencesFinder.java)
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/AbstractOccurencesFinder.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/AbstractOccurencesFinder.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -0,0 +1,47 @@
+package org.rubypeople.rdt.internal.ui.search;
+
+
+public abstract class AbstractOccurencesFinder implements IOccurrencesFinder {
+
+ protected boolean fMarkOccurrenceAnnotations;
+ protected boolean fStickyOccurrenceAnnotations;
+ protected boolean fMarkTypeOccurrences;
+ protected boolean fMarkMethodOccurrences;
+ protected boolean fMarkConstantOccurrences;
+ protected boolean fMarkFieldOccurrences;
+ protected boolean fMarkLocalVariableOccurrences;
+ protected boolean fMarkMethodExitPoints;
+
+ public void setFMarkConstantOccurrences(boolean markConstantOccurrences) {
+ fMarkConstantOccurrences = markConstantOccurrences;
+ }
+
+ public void setFMarkFieldOccurrences(boolean markFieldOccurrences) {
+ fMarkFieldOccurrences = markFieldOccurrences;
+ }
+
+ public void setFMarkLocalVariableOccurrences(boolean markLocalVariableOccurrences) {
+ fMarkLocalVariableOccurrences = markLocalVariableOccurrences;
+ }
+
+ public void setFMarkMethodExitPoints(boolean markMethodExitPoints) {
+ fMarkMethodExitPoints = markMethodExitPoints;
+ }
+
+ public void setFMarkMethodOccurrences(boolean markMethodOccurrences) {
+ fMarkMethodOccurrences = markMethodOccurrences;
+ }
+
+ public void setFMarkOccurrenceAnnotations(boolean markOccurrenceAnnotations) {
+ fMarkOccurrenceAnnotations = markOccurrenceAnnotations;
+ }
+
+ public void setFMarkTypeOccurrences(boolean markTypeOccurrences) {
+ fMarkTypeOccurrences = markTypeOccurrences;
+ }
+
+ public void setFStickyOccurrenceAnnotations(boolean stickyOccurrenceAnnotations) {
+ fStickyOccurrenceAnnotations = stickyOccurrenceAnnotations;
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/DefaultOccurrencesFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/DefaultOccurrencesFinder.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/DefaultOccurrencesFinder.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -42,7 +42,6 @@
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.util.ASTUtil;
-import org.rubypeople.rdt.internal.ti.AbstractOccurencesFinder;
import org.rubypeople.rdt.internal.ti.util.FirstPrecursorNodeLocator;
import org.rubypeople.rdt.internal.ti.util.INodeAcceptor;
import org.rubypeople.rdt.internal.ti.util.OffsetNodeLocator;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/FindOccurrencesEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/FindOccurrencesEngine.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/FindOccurrencesEngine.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -18,7 +18,6 @@
import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.ISourceReference;
import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.core.search.IOccurrencesFinder;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
import org.rubypeople.rdt.internal.ui.rubyeditor.ASTProvider;
Copied: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java (from rev 2581, trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/search/IOccurrencesFinder.java)
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.rubypeople.rdt.internal.ui.search;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.jruby.ast.Node;
+import org.rubypeople.rdt.core.IRubyElement;
+
+public interface IOccurrencesFinder {
+
+ /**
+ *
+ * @param source
+ * Ruby source to search for occurrences
+ * @param offset
+ * position in source where selection is
+ * @param length
+ * length of the selection
+ * @return
+ */
+ public String initialize(String source, int offset, int length);
+
+ /**
+ *
+ * @param root
+ * the root node
+ * @param offset
+ * position in source where selection is
+ * @param length
+ * length of the selection
+ * @return
+ */
+ public String initialize(Node root, int offset, int length);
+
+ /**
+ * Returns a lit of AST Nodes back (which contain their associated
+ * positions).
+ *
+ * @return List of AST Nodes
+ */
+ public List<Position> perform();
+
+ public String getJobLabel();
+
+ /**
+ * Returns the plural label for this finder with 3 placeholders:
+ * <ul>
+ * <li>{0} for the {@link #getElementName() element name}</li>
+ * <li>{1} for the number of results found</li>
+ * <li>{2} for the scope (name of the compilation unit)</li>
+ * </ul>
+ *
+ * @return the unformatted label
+ */
+ public String getUnformattedPluralLabel();
+
+ /**
+ * Returns the singular label for this finder with 2 placeholders:
+ * <ul>
+ * <li>{0} for the {@link #getElementName() element name}</li>
+ * <li>{1} for the scope (name of the compilation unit)</li>
+ * </ul>
+ *
+ * @return the unformatted label
+ */
+ public String getUnformattedSingularLabel();
+
+ /**
+ * Returns the name of the element to look for or <code>null</code> if the
+ * finder hasn't been initialized yet.
+ *
+ * @return the name of the element
+ */
+ public String getElementName();
+
+ public void collectOccurrenceMatches(IRubyElement element,
+ IDocument document, Collection resultingMatches);
+
+ /* Preferences */
+ public void setFMarkConstantOccurrences(boolean markConstantOccurrences);
+ public void setFMarkFieldOccurrences(boolean markFieldOccurrences);
+ public void setFMarkLocalVariableOccurrences(boolean markLocalVariableOccurrences);
+ public void setFMarkMethodExitPoints(boolean markMethodExitPoints);
+ public void setFMarkMethodOccurrences(boolean markMethodOccurrences);
+ public void setFMarkOccurrenceAnnotations(boolean markOccurrenceAnnotations);
+ public void setFMarkTypeOccurrences(boolean markTypeOccurrences);
+ public void setFStickyOccurrenceAnnotations(boolean stickyOccurrenceAnnotations);
+
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesSearchQuery.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesSearchQuery.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/OccurrencesSearchQuery.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -21,7 +21,6 @@
import org.eclipse.search.ui.ISearchResult;
import org.eclipse.search.ui.text.Match;
import org.rubypeople.rdt.core.IRubyElement;
-import org.rubypeople.rdt.core.search.IOccurrencesFinder;
import org.rubypeople.rdt.internal.corext.util.Messages;
import org.rubypeople.rdt.internal.ui.dialogs.StatusInfo;
Modified: trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search/MarkOccurrencesTest.java
===================================================================
--- trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search/MarkOccurrencesTest.java 2007-06-06 14:33:07 UTC (rev 2582)
+++ trunk/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/search/MarkOccurrencesTest.java 2007-06-06 14:34:57 UTC (rev 2583)
@@ -5,7 +5,6 @@
import junit.framework.TestCase;
import org.eclipse.jface.text.Position;
-import org.rubypeople.rdt.core.search.IOccurrencesFinder;
import org.rubypeople.rdt.internal.ui.search.DefaultOccurrencesFinder;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|