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

Unified Diff: editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java

Issue 10382207: Searchbox proposal UI facelift to add styled details. (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.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java (revision 7702)
+++ editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.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
@@ -24,6 +24,9 @@
private static final int[][] EMPTY_INDICES = new int[0][0];
private final OmniProposalProvider provider;
+ private boolean duplicate;
+ protected int detailOffset = -1;
+
/**
* Create an element.
*
@@ -36,11 +39,29 @@
/**
* Executes the associated action for this element.
+ *
* @param text the current string in the search box
*/
public abstract void execute(String text);
/**
+ * Returns a detailed label (used for disambiguating duplicate matches)
+ */
+ public String getDetailedLabel() {
+ return getLabel();
+ }
+
+ /**
+ * Get the offset of the detail portion of this element's label (if there is one). The default
+ * value is <code>-1</code>.
+ *
+ * @return the detail offset, or <code>-1</code> if there is none.
+ */
+ public int getDetailOffset() {
+ return detailOffset;
+ }
+
+ /**
* Returns the id for this element. The id has to be unique within the OmniProposalProvider that
* provided this element.
*
@@ -106,6 +127,13 @@
}
/**
+ * Check if this element has been marked a duplicate (requiring disambiguation in the UI).
+ */
+ public boolean isDuplicate() {
+ return duplicate;
+ }
+
+ /**
* @param filter
* @return
*/
@@ -157,4 +185,12 @@
}
return null;
}
+
+ /**
+ * Flag this element as a duplicate requiring disambiguation in the UI.
+ */
+ public void setIsDuplicate(boolean isDuplicate) {
+ this.duplicate = isDuplicate;
+ }
+
}

Powered by Google App Engine
This is Rietveld 408576698