Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Unified Diff: editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/internal/ui/text/LineElement.java

Issue 10387008: External file text search engine support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/internal/ui/text/LineElement.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/internal/ui/text/LineElement.java (revision 7355)
+++ editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/internal/ui/text/LineElement.java (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, the Dart project authors.
+ * Copyright (c) 2012, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -18,51 +18,41 @@
import java.util.ArrayList;
-import org.eclipse.core.resources.IResource;
-
-
/**
* Element representing a line in a file
*/
public class LineElement {
- private final IResource fParent;
+ private final FileResource<?> fParent;
private final int fLineNumber;
private final int fLineStartOffset;
private final String fLineContents;
- public LineElement(IResource parent, int lineNumber, int lineStartOffset, String lineContents) {
+ public LineElement(FileResource<?> parent, int lineNumber, int lineStartOffset,
+ String lineContents) {
fParent = parent;
fLineNumber = lineNumber;
fLineStartOffset = lineStartOffset;
fLineContents = lineContents;
}
- public IResource getParent() {
- return fParent;
+ public boolean contains(int offset) {
+ return fLineStartOffset <= offset && offset < fLineStartOffset + fLineContents.length();
}
- public int getLine() {
- return fLineNumber;
- }
-
public String getContents() {
return fLineContents;
}
- public int getOffset() {
- return fLineStartOffset;
- }
-
- public boolean contains(int offset) {
- return fLineStartOffset <= offset && offset < fLineStartOffset + fLineContents.length();
- }
-
public int getLength() {
return fLineContents.length();
}
+ public int getLine() {
+ return fLineNumber;
+ }
+
public FileMatch[] getMatches(AbstractTextSearchResult result) {
ArrayList<FileMatch> res = new ArrayList<FileMatch>();
Match[] matches = result.getMatches(fParent);
@@ -87,4 +77,12 @@
return count;
}
+ public int getOffset() {
+ return fLineStartOffset;
+ }
+
+ public FileResource<?> getParent() {
+ return fParent;
+ }
+
}

Powered by Google App Engine
This is Rietveld 408576698