diff options
-rw-r--r-- | ddms/libs/ddmuilib/src/com/android/ddmuilib/AbstractBufferFindTarget.java (renamed from ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/RollingBufferFindTarget.java) | 8 | ||||
-rw-r--r-- | ddms/libs/ddmuilib/src/com/android/ddmuilib/FindDialog.java (renamed from ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/FindDialog.java) | 5 | ||||
-rw-r--r-- | ddms/libs/ddmuilib/src/com/android/ddmuilib/IFindTarget.java (renamed from ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/IFindTarget.java) | 2 | ||||
-rw-r--r-- | ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java | 4 | ||||
-rw-r--r-- | ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java | 4 |
5 files changed, 15 insertions, 8 deletions
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/RollingBufferFindTarget.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/AbstractBufferFindTarget.java index b353a13..13a787a 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/RollingBufferFindTarget.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/AbstractBufferFindTarget.java @@ -14,14 +14,16 @@ * limitations under the License. */ -package com.android.ddmuilib.logcat; +package com.android.ddmuilib; import java.util.regex.Pattern; /** - * {@link RollingBufferFindTarget} implements methods to find items inside a circular buffer. + * {@link AbstractBufferFindTarget} implements methods to find items inside a buffer. It takes + * care of the logic to search backwards/forwards in the buffer, wrapping around when necessary. + * The actual contents of the buffer should be provided by the classes that extend this. */ -public abstract class RollingBufferFindTarget implements IFindTarget { +public abstract class AbstractBufferFindTarget implements IFindTarget { private int mCurrentSearchIndex; // Single element cache of the last search regex diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/FindDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/FindDialog.java index cfd1ee8..6370be4 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/FindDialog.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/FindDialog.java @@ -14,7 +14,8 @@ * limitations under the License. */ -package com.android.ddmuilib.logcat; +package com.android.ddmuilib; + import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; @@ -32,7 +33,7 @@ import org.eclipse.swt.widgets.Text; /** * {@link FindDialog} provides a text box where users can enter text that should be - * searched for in the list of logcat messages. The buttons "Find Previous" and "Find Next" + * searched for in the target editor/view. The buttons "Find Previous" and "Find Next" * allow users to search forwards/backwards. This dialog simply provides a front end for the user * and the actual task of searching is delegated to the {@link IFindTarget}. */ diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/IFindTarget.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/IFindTarget.java index f27c53e..9aa6943 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/IFindTarget.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/IFindTarget.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.ddmuilib.logcat; +package com.android.ddmuilib; public interface IFindTarget { boolean findAndSelect(String text, boolean isNewSearch, boolean searchForward); diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java index 06952f9..e7dcec9 100644 --- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java +++ b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java @@ -21,9 +21,11 @@ import com.android.ddmlib.IDevice; import com.android.ddmlib.Log.LogLevel; import com.android.ddmuilib.ITableFocusListener; import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator; +import com.android.ddmuilib.FindDialog; import com.android.ddmuilib.ImageLoader; import com.android.ddmuilib.SelectionDependentPanel; import com.android.ddmuilib.TableHelper; +import com.android.ddmuilib.AbstractBufferFindTarget; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.MenuManager; @@ -1443,7 +1445,7 @@ public final class LogCatPanel extends SelectionDependentPanel mAssertColor.dispose(); } - private class LogcatFindTarget extends RollingBufferFindTarget { + private class LogcatFindTarget extends AbstractBufferFindTarget { @Override public void selectAndReveal(int index) { mTable.deselectAll(); diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java index 7afac24..32a36c4 100644 --- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java +++ b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java @@ -16,13 +16,15 @@ package com.android.ddmuilib.logcat; +import com.android.ddmuilib.AbstractBufferFindTarget; + import junit.framework.TestCase; import java.util.Arrays; import java.util.List; public class RollingBufferFindTest extends TestCase { - public class FindTarget extends RollingBufferFindTarget { + public class FindTarget extends AbstractBufferFindTarget { private int mSelectedItem = -1; private int mItemReadCount = 0; private List<String> mItems = Arrays.asList( |