|
From: <caw...@us...> - 2006-07-02 13:12:23
|
Revision: 1505 Author: cawilliams Date: 2006-07-02 06:12:17 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/rubyeclipse/?rev=1505&view=rev Log Message: ----------- add the interace that occurence finders shoudl implement - stolen from JDT Added Paths: ----------- branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java Added: branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java =================================================================== --- branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java (rev 0) +++ branches/type_inferrence/trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/search/IOccurrencesFinder.java 2006-07-02 13:12:17 UTC (rev 1505) @@ -0,0 +1,77 @@ +/******************************************************************************* + * 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.jruby.ast.Node; +import org.rubypeople.rdt.core.IRubyElement; + +public interface IOccurrencesFinder { + + /** + * + * @param root + * root AST 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 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 lement 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); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |