Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 79631 Details for
Bug 190794
[QuickAccess] multiple view categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
patch-190794.txt (text/plain), 8.41 KB, created by
Boris Bokowski
on 2007-10-03 09:34:02 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Boris Bokowski
Created:
2007-10-03 09:34:02 EDT
Size:
8.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessDialog.java,v >retrieving revision 1.14 >diff -u -r1.14 QuickAccessDialog.java >--- Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessDialog.java 30 May 2007 20:04:52 -0000 1.14 >+++ Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessDialog.java 3 Oct 2007 13:32:51 -0000 >@@ -342,7 +342,10 @@ > // italicsFont = resourceManager.createFont(FontDescriptor.createFrom( > // table.getFont()).setStyle(SWT.ITALIC)); > grayColor = resourceManager.createColor(ColorUtil.blend(table >- .getBackground().getRGB(), table.getForeground().getRGB())); >+ .getBackground().getRGB(), table.getForeground().getRGB(), 70)); >+ final Color lightGrayColor = resourceManager.createColor(ColorUtil.blend(table >+ .getBackground().getRGB(), table.getForeground().getRGB(), 50)); >+ final TextStyle grayBoldStyle = new TextStyle(boldFont, lightGrayColor, null); > final TextStyle boldStyle = new TextStyle(boldFont, null, null); > Listener listener = new Listener() { > public void handleEvent(Event event) { >@@ -356,7 +359,7 @@ > break; > case SWT.PaintItem: > entry.paint(event, textLayout, resourceManager, >- boldStyle, grayColor); >+ boldStyle, grayBoldStyle, grayColor); > break; > case SWT.EraseItem: > entry.erase(event); >Index: Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java,v >retrieving revision 1.5 >diff -u -r1.5 QuickAccessEntry.java >--- Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java 9 May 2007 17:40:41 -0000 1.5 >+++ Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessEntry.java 3 Oct 2007 13:32:51 -0000 >@@ -110,9 +110,10 @@ > * @param textLayout > * @param resourceManager > * @param boldStyle >+ * @param grayBoldStyle > */ > public void paint(Event event, TextLayout textLayout, >- ResourceManager resourceManager, TextStyle boldStyle, Color grayColor) { >+ ResourceManager resourceManager, TextStyle boldStyle, TextStyle grayBoldStyle, Color grayColor) { > final Table table = ((TableItem) event.item).getParent(); > textLayout.setFont(table.getFont()); > switch (event.index) { >@@ -121,8 +122,13 @@ > textLayout.setText(provider.getName()); > for (int i = 0; i < providerMatchRegions.length; i++) { > int[] matchRegion = providerMatchRegions[i]; >- textLayout.setStyle(boldStyle, matchRegion[0], >- matchRegion[1]); >+ if (firstInCategory) { >+ textLayout.setStyle(boldStyle, matchRegion[0], >+ matchRegion[1]); >+ } else { >+ textLayout.setStyle(grayBoldStyle, matchRegion[0], >+ matchRegion[1]); >+ } > } > if (providerMatchRegions.length > 0 && !firstInCategory) { > event.gc.setForeground(grayColor); >Index: Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessElement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessElement.java,v >retrieving revision 1.3 >diff -u -r1.3 QuickAccessElement.java >--- Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessElement.java 22 May 2007 19:22:04 -0000 1.3 >+++ Eclipse UI/org/eclipse/ui/internal/quickaccess/QuickAccessElement.java 3 Oct 2007 13:32:51 -0000 >@@ -81,52 +81,75 @@ > public QuickAccessEntry match(String filter, > QuickAccessProvider providerForMatching) { > String sortLabel = getLabel(); >- int index = sortLabel.toLowerCase().indexOf(filter); >- if (index != -1) { >- return new QuickAccessEntry(this, providerForMatching, >- new int[][] { { index, index + filter.length() - 1 } }, >- EMPTY_INDICES); >- } >+ int index; > String combinedLabel = (providerForMatching.getName() + " " + getLabel()); //$NON-NLS-1$ >- index = combinedLabel.toLowerCase().indexOf(filter); >- if (index != -1) { >- int lengthOfElementMatch = index + filter.length() >- - providerForMatching.getName().length() - 1; >- if (lengthOfElementMatch > 0) { >+ { >+ index = combinedLabel.toLowerCase().indexOf(filter); >+ if (index != -1) { >+ if (index > providerForMatching.getName().length()) { >+ index -= providerForMatching.getName().length() + 1; >+ return new QuickAccessEntry(this, providerForMatching, >+ new int[][] { { index, index + filter.length() - 1 } }, >+ EMPTY_INDICES); >+ } >+ int lengthOfElementMatch = filter.length() - index >+ - providerForMatching.getName().length() - 1; >+ if (lengthOfElementMatch > 0) { >+ return new QuickAccessEntry(this, providerForMatching, >+ new int[][] { { 0, lengthOfElementMatch - 1 } }, >+ new int[][] { { index, index + filter.length() - 1 } }); >+ } > return new QuickAccessEntry(this, providerForMatching, >- new int[][] { { 0, lengthOfElementMatch - 1 } }, >- new int[][] { { index, index + filter.length() - 1 } }); >+ EMPTY_INDICES, new int[][] { { index, >+ index + filter.length() - 1 } }); > } >- return new QuickAccessEntry(this, providerForMatching, >- EMPTY_INDICES, new int[][] { { index, >- index + filter.length() - 1 } }); > } >- String camelCase = CamelUtil.getCamelCase(sortLabel); >- index = camelCase.indexOf(filter); >- if (index != -1) { >- int[][] indices = CamelUtil.getCamelCaseIndices(sortLabel, index, filter >- .length()); >- return new QuickAccessEntry(this, providerForMatching, indices, >- EMPTY_INDICES); >+ { >+ index = sortLabel.toLowerCase().indexOf(filter); >+ if (index != -1) { >+ return new QuickAccessEntry(this, providerForMatching, >+ new int[][] { { index, index + filter.length() - 1 } }, >+ EMPTY_INDICES); >+ } > } >+ String camelCase = CamelUtil.getCamelCase(sortLabel); > String combinedCamelCase = CamelUtil.getCamelCase(combinedLabel); >- index = combinedCamelCase.indexOf(filter); >- if (index != -1) { >- String providerCamelCase = CamelUtil.getCamelCase(providerForMatching >- .getName()); >- int lengthOfElementMatch = index + filter.length() >- - providerCamelCase.length(); >- if (lengthOfElementMatch > 0) { >- return new QuickAccessEntry( >- this, >- providerForMatching, >- CamelUtil.getCamelCaseIndices(sortLabel, 0, lengthOfElementMatch), >- CamelUtil.getCamelCaseIndices(providerForMatching.getName(), >- index, filter.length() - lengthOfElementMatch)); >+ { >+ index = combinedCamelCase.indexOf(filter); >+ if (index != -1) { >+ String providerCamelCase = CamelUtil.getCamelCase(providerForMatching >+ .getName()); >+ if (index >= providerCamelCase.length()) { >+ int[][] indices = CamelUtil.getCamelCaseIndices(sortLabel, index - providerCamelCase.length(), filter >+ .length()); >+ return new QuickAccessEntry(this, providerForMatching, indices, >+ EMPTY_INDICES); >+ } >+ int lengthOfMatch = filter.length(); >+ int lengthOfProviderMatch = providerCamelCase.length() - index; >+ int lengthOfElementMatch = lengthOfMatch >+ - lengthOfProviderMatch; >+ if (lengthOfElementMatch > 0) { >+ return new QuickAccessEntry( >+ this, >+ providerForMatching, >+ CamelUtil.getCamelCaseIndices(sortLabel, index - providerCamelCase.length(), lengthOfElementMatch), >+ CamelUtil.getCamelCaseIndices(providerForMatching.getName(), >+ index, filter.length() - lengthOfElementMatch)); >+ } >+ return new QuickAccessEntry(this, providerForMatching, >+ EMPTY_INDICES, CamelUtil.getCamelCaseIndices(providerForMatching >+ .getName(), index, filter.length())); >+ } >+ } >+ { >+ index = camelCase.indexOf(filter); >+ if (index != -1) { >+ int[][] indices = CamelUtil.getCamelCaseIndices(sortLabel, index, filter >+ .length()); >+ return new QuickAccessEntry(this, providerForMatching, indices, >+ EMPTY_INDICES); > } >- return new QuickAccessEntry(this, providerForMatching, >- EMPTY_INDICES, CamelUtil.getCamelCaseIndices(providerForMatching >- .getName(), index, filter.length())); > } > return null; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 190794
:
69947
| 79631