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

Unified Diff: editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxPopup.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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxPopup.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxPopup.java (revision 7702)
+++ editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniBoxPopup.java (working copy)
@@ -459,6 +459,9 @@
} else {
boldStyle = null;
}
+ final TextStyle grayStyle = new TextStyle(table.getFont(),
+ OmniBoxColors.SEARCH_ENTRY_ITEM_TEXT, null);
+
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
@@ -469,8 +472,7 @@
entry.measure(event, textLayout, resourceManager, boldStyle);
break;
case SWT.PaintItem:
- entry.paint(event, textLayout, resourceManager, boldStyle,
- OmniBoxColors.SEARCH_ENTRY_ITEM_TEXT);
+ entry.paint(event, textLayout, resourceManager, boldStyle, grayStyle);
break;
case SWT.EraseItem:
entry.erase(event);
@@ -798,6 +800,25 @@
return false;
}
+ private void markDuplicates(List<OmniEntry>[] entries) {
+
+ final HashMap<String, OmniElement> seen = new HashMap<String, OmniElement>();
+ OmniElement current;
+
+ for (List<OmniEntry> entrySets : entries) {
+ for (OmniEntry entry : entrySets) {
+ current = entry.element;
+ OmniElement previous = seen.get(current.getLabel());
+ if (previous != null) {
+ previous.setIsDuplicate(true);
+ current.setIsDuplicate(true);
+ } else {
+ seen.put(current.getLabel(), current);
+ }
+ }
+ }
+ }
+
private void refreshInternal(final String filter) {
//an empty filter indicates a new query, meaning we need to clear caches
if (filter.length() == 0) {
@@ -880,6 +901,9 @@
//}
table.removeAll();
+ //elements flagged as duplicates get rendered with disambiguating details
+ markDuplicates(entries);
+
TableItem[] items = table.getItems();
int selectionIndex = -1;
int index = 0;
@@ -913,6 +937,7 @@
item.setData(entry);
item.setText(0, entry.provider.getName());
item.setText(1, entry.element.getLabel());
+
if (Util.isWpf()) {
item.setImage(1, entry.getImage(entry.element, resourceManager));
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.deploy/src/com/google/dart/tools/ui/omni/OmniElement.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698