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 161429 Details for
Bug 301820
Resource Filters UI is not intuitive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
First change: "Add group..."
patch.txt (text/plain), 13.78 KB, created by
Serge Beauchamp
on 2010-03-09 05:05:31 EST
(
hide
)
Description:
First change: "Add group..."
Filename:
MIME Type:
Creator:
Serge Beauchamp
Created:
2010-03-09 05:05:31 EST
Size:
13.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/plugin.properties,v >retrieving revision 1.155 >diff -u -r1.155 plugin.properties >--- plugin.properties 4 Feb 2010 19:44:08 -0000 1.155 >+++ plugin.properties 9 Mar 2010 10:01:33 -0000 >@@ -303,3 +303,5 @@ > notFilterProvider.name = NOT group > notFilterProvider.description = Allows grouping others filters with the NOT logical preposition > installationPage.feature.name = Features >+pathFilterProvider.name = Path Matcher >+pathFilterProvider.description = * = any string, ? = any character, \\ = escape literals: * ? \\ >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/plugin.xml,v >retrieving revision 1.301 >diff -u -r1.301 plugin.xml >--- plugin.xml 16 Feb 2010 20:31:57 -0000 1.301 >+++ plugin.xml 9 Mar 2010 10:01:35 -0000 >@@ -2323,6 +2323,14 @@ > name="%notFilterProvider.name" > ordering="first"> > </filterMatcher> >+ <filterMatcher >+ argumentType="string" >+ class="org.eclipse.ui.internal.ide.misc.StringPathMatcher" >+ description="%pathFilterProvider.description" >+ id="org.eclipse.ui.ide.pathFilter" >+ name="%pathFilterProvider.name" >+ ordering="first"> >+ </filterMatcher> > </extension> > <extension > point="org.eclipse.ui.installationPages"> >Index: src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java,v >retrieving revision 1.81 >diff -u -r1.81 IDEWorkbenchMessages.java >--- src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 3 Mar 2010 12:08:43 -0000 1.81 >+++ src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 9 Mar 2010 10:01:35 -0000 >@@ -53,6 +53,7 @@ > public static String ResourceFilterPage_title; > public static String ResourceFilterPage_noResource; > public static String ResourceFilterPage_addButtonLabel; >+ public static String ResourceFilterPage_addGroupButtonLabel; > public static String ResourceFilterPage_editButtonLabel; > public static String ResourceFilterPage_removeButtonLabel; > public static String ResourceFilterPage_upButtonLabel; >@@ -76,6 +77,9 @@ > public static String ResourceFilterPage_editFilterDialogTitle; > public static String ResourceFilterPage_description; > public static String ResourceFilterPage_addSubFilterActionLabel; >+ public static String ResourceFilterPage_addSubFilterGroupActionLabel; >+ public static String ResourceFilterPage_removeFilterActionLabel; >+ public static String ResourceFilterPage_editFilterActionLabel; > // > // > // Copies from org.eclipse.ui.workbench >Index: src/org/eclipse/ui/internal/ide/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties,v >retrieving revision 1.195 >diff -u -r1.195 messages.properties >--- src/org/eclipse/ui/internal/ide/messages.properties 3 Mar 2010 21:42:53 -0000 1.195 >+++ src/org/eclipse/ui/internal/ide/messages.properties 9 Mar 2010 10:01:36 -0000 >@@ -573,6 +573,7 @@ > ResourceFilterPage_title=Resource filters can be used to hide file system objects from the Eclipse resource tree.\nA file system object will be included if it matches any of the include filters and doesn't match any of the exclude filters. > ResourceFilterPage_noResource=Resource information is not available for the current selection. > ResourceFilterPage_addButtonLabel=&Add... >+ResourceFilterPage_addGroupButtonLabel=Add &Group... > ResourceFilterPage_editButtonLabel=Edi&t... > ResourceFilterPage_removeButtonLabel=&Remove > ResourceFilterPage_upButtonLabel=Up >@@ -595,7 +596,10 @@ > ResourceFilterPage_foldersColumn=Folders > ResourceFilterPage_editFilterDialogTitle=Edit Resource Filter > ResourceFilterPage_description=Description >-ResourceFilterPage_addSubFilterActionLabel=Add Condition... >+ResourceFilterPage_addSubFilterActionLabel=Add &Condition... >+ResourceFilterPage_addSubFilterGroupActionLabel=Add &Group... >+ResourceFilterPage_removeFilterActionLabel=&Remove >+ResourceFilterPage_editFilterActionLabel=&Edit > ResourceInfo_folder = Folder > ResourceInfo_project = Project > ResourceInfo_linkedFile = Linked File >Index: src/org/eclipse/ui/internal/ide/dialogs/ResourceFilterGroup.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/ResourceFilterGroup.java,v >retrieving revision 1.19 >diff -u -r1.19 ResourceFilterGroup.java >--- src/org/eclipse/ui/internal/ide/dialogs/ResourceFilterGroup.java 5 Mar 2010 11:54:00 -0000 1.19 >+++ src/org/eclipse/ui/internal/ide/dialogs/ResourceFilterGroup.java 9 Mar 2010 10:01:37 -0000 >@@ -33,6 +33,7 @@ > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.MenuManager; >+import org.eclipse.jface.action.Separator; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.dialogs.IDialogConstants; >@@ -105,6 +106,7 @@ > public class ResourceFilterGroup { > > private Button addButton = null; >+ private Button addGroupButton = null; > private Button removeButton = null; > private Button upButton = null; > private Button downButton = null; >@@ -595,19 +597,65 @@ > public void menuDetected(MenuDetectEvent e) { > MenuManager mgr = new MenuManager(); > mgr.add(addSubFilterAction); >+ mgr.add(addSubGroupFilterAction); >+ mgr.add(new Separator()); >+ mgr.add(new EditFilterAction()); >+ mgr.add(new RemoveFilterAction()); > filterView.getControl().setMenu( > mgr.createContextMenu(filterView.getControl())); > } > }); > } > >- Action addSubFilterAction = new AddSubFilterAction(); >+ class EditFilterAction extends Action { >+ >+ public EditFilterAction() { >+ setText(NLS >+ .bind(IDEWorkbenchMessages.ResourceFilterPage_editFilterActionLabel, >+ null)); >+ } >+ >+ public void run() { >+ handleEdit(); >+ } >+ public boolean isEnabled() { >+ ISelection selection = filterView.getSelection(); >+ if (selection instanceof IStructuredSelection) { >+ return ((IStructuredSelection) selection).size() > 0; } >+ return false; >+ } >+ } >+ >+ class RemoveFilterAction extends Action { >+ >+ public RemoveFilterAction() { >+ setText(NLS >+ .bind(IDEWorkbenchMessages.ResourceFilterPage_removeFilterActionLabel, >+ null)); >+ } >+ >+ public void run() { >+ handleRemove(); >+ } >+ public boolean isEnabled() { >+ ISelection selection = filterView.getSelection(); >+ if (selection instanceof IStructuredSelection) { >+ return ((IStructuredSelection) selection).size() > 0; } >+ return false; >+ } >+ } >+ >+ Action addSubFilterAction = new AddSubFilterAction(false); > > class AddSubFilterAction extends Action { > >- public AddSubFilterAction() { >+ boolean createGroupOnly; >+ >+ public AddSubFilterAction(boolean createGroupOnly) { >+ this.createGroupOnly = createGroupOnly; > setText(NLS >- .bind( >+ .bind(createGroupOnly ? >+ IDEWorkbenchMessages.ResourceFilterPage_addSubFilterGroupActionLabel: > IDEWorkbenchMessages.ResourceFilterPage_addSubFilterActionLabel, > null)); > } >@@ -626,7 +674,7 @@ > FilterCopy newFilter = new FilterCopy(); > newFilter.setParent(filter); > FilterEditDialog dialog = new FilterEditDialog(shell, >- newFilter); >+ newFilter, createGroupOnly); > if (dialog.open() == Window.OK) { > filter.addChild(newFilter); > filterView.refresh(); >@@ -651,6 +699,8 @@ > } > } > >+ Action addSubGroupFilterAction = new AddSubFilterAction(true); >+ > class FilterCopyDrop extends ViewerDropAdapter { > protected FilterCopyDrop(Viewer viewer) { > super(viewer); >@@ -782,9 +832,25 @@ > } > > public void widgetSelected(SelectionEvent e) { >- handleAdd(); >+ handleAdd(false); > } > }); >+ >+ addGroupButton = new Button(composite, SWT.PUSH); >+ addGroupButton.setText(NLS.bind( >+ IDEWorkbenchMessages.ResourceFilterPage_addGroupButtonLabel, null)); >+ data = new GridData(SWT.FILL, SWT.FILL, false, false); >+ addGroupButton.setLayoutData(data); >+ setButtonDimensionHint(addGroupButton); >+ addGroupButton.addSelectionListener(new SelectionListener() { >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ handleAdd(true); >+ } >+ }); >+ > > editButton = new Button(composite, SWT.PUSH); > editButton.setText(NLS.bind( >@@ -884,9 +950,9 @@ > return filters.isLast((FilterCopy) o); > } > >- private void handleAdd() { >+ private void handleAdd(boolean createGroupOnly) { > FilterCopy newFilter = new FilterCopy(); >- FilterEditDialog dialog = new FilterEditDialog(shell, newFilter); >+ FilterEditDialog dialog = new FilterEditDialog(shell, newFilter, createGroupOnly); > if (dialog.open() == Window.OK) { > filters.add(newFilter); > filterView.refresh(); >@@ -900,7 +966,8 @@ > .getFirstElement(); > FilterCopy copy = new FilterCopy(filter); > copy.setParent(filter.getParent()); >- FilterEditDialog dialog = new FilterEditDialog(shell, copy); >+ boolean isGroup = filter.getChildrenLimit() > 0; >+ FilterEditDialog dialog = new FilterEditDialog(shell, copy, isGroup); > if (dialog.open() == Window.OK) { > if (copy.hasChanged()) { > filter.copy(copy); >@@ -1260,16 +1327,16 @@ > null) }; > } > >- static String[] getFilterNames(boolean childrenOnly) { >+ static String[] getFilterNames(boolean groupOnly) { > IFilterMatcherDescriptor[] descriptors = ResourcesPlugin.getWorkspace() > .getFilterMatcherDescriptors(); > LinkedList names = new LinkedList(); > for (int i = 0; i < descriptors.length; i++) { >- if (!childrenOnly >+ boolean isGroup = descriptors[i].getArgumentType().equals( >+ IFilterMatcherDescriptor.ARGUMENT_TYPE_FILTER_MATCHER) > || descriptors[i].getArgumentType().equals( >- IFilterMatcherDescriptor.ARGUMENT_TYPE_FILTER_MATCHER) >- || descriptors[i].getArgumentType().equals( >- IFilterMatcherDescriptor.ARGUMENT_TYPE_FILTER_MATCHERS)) >+ IFilterMatcherDescriptor.ARGUMENT_TYPE_FILTER_MATCHERS); >+ if (isGroup == groupOnly) > names.add(descriptors[i].getName()); > } > return (String[]) names.toArray(new String[0]); >@@ -1662,6 +1729,7 @@ > protected Label argumentsLabel; > protected Label description; > protected FilterTypeUtil util; >+ protected boolean createGroupOnly; > > private static final String REGEX_FILTER_ID = "org.eclipse.core.resources.regexFilter"; //$NON-NLS-1$ > >@@ -1676,10 +1744,12 @@ > * > * @param parentShell > * @param filter >+ * @param createGroupOnly > */ >- public FilterEditDialog(Shell parentShell, FilterCopy filter) { >+ public FilterEditDialog(Shell parentShell, FilterCopy filter, boolean createGroupOnly) { > super(parentShell); > this.filter = filter; >+ this.createGroupOnly = createGroupOnly; > util = new FilterTypeUtil(); > } > >@@ -1802,9 +1872,11 @@ > * > */ > private void setArgumentLabelEnabled() { >- Color color = argumentsLabel.getDisplay().getSystemColor( >- filter.hasStringArguments() ? SWT.COLOR_BLACK : SWT.COLOR_GRAY); >- argumentsLabel.setForeground(color); >+ if (argumentsLabel != null) { >+ Color color = argumentsLabel.getDisplay().getSystemColor( >+ filter.hasStringArguments() ? SWT.COLOR_BLACK : SWT.COLOR_GRAY); >+ argumentsLabel.setForeground(color); >+ } > } > > /** >@@ -1833,8 +1905,7 @@ > IDEWorkbenchMessages.ResourceFilterPage_columnFilterID, null), > true); > idCombo = new Combo(idComposite, SWT.READ_ONLY); >- idCombo.setItems(FilterTypeUtil.getFilterNames(filter >- .getChildrenLimit() > 0)); >+ idCombo.setItems(FilterTypeUtil.getFilterNames(createGroupOnly)); > data = new GridData(SWT.FILL, SWT.CENTER, true, false); > idCombo.setLayoutData(data); > idCombo.setFont(font); >@@ -1845,26 +1916,38 @@ > public void widgetSelected(SelectionEvent e) { > FilterTypeUtil.setValue(filter, FilterTypeUtil.ID, idCombo > .getItem(idCombo.getSelectionIndex())); >- arguments.setEnabled(filter.hasStringArguments()); >+ if (arguments != null) >+ arguments.setEnabled(filter.hasStringArguments()); > setArgumentLabelEnabled(); > description.setText(FilterTypeUtil > .getDescriptor(filter.getId()).getDescription()); >- fContentAssistField.setEnabled(filter.getId().equals(REGEX_FILTER_ID)); >+ if (fContentAssistField != null) >+ fContentAssistField.setEnabled(filter.getId().equals(REGEX_FILTER_ID)); > } > }); >- selectComboItem(filter.getId()); >- Composite argumentComposite = new Composite(idComposite, SWT.NONE); >- GridLayout layout = new GridLayout(); >- layout.numColumns = 2; >- layout.marginWidth = 0; >- argumentComposite.setLayout(layout); >- data = new GridData(SWT.FILL, SWT.FILL, true, true); >- argumentComposite.setLayoutData(data); >- argumentComposite.setFont(font); >- createArgumentsArea(font, argumentComposite); >+ if (createGroupOnly) { >+ idCombo.select(0); >+ FilterTypeUtil.setValue(filter, FilterTypeUtil.ID, idCombo >+ .getItem(idCombo.getSelectionIndex())); >+ } >+ else >+ selectComboItem(filter.getId()); >+ >+ if (!createGroupOnly) { >+ Composite argumentComposite = new Composite(idComposite, SWT.NONE); >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 2; >+ layout.marginWidth = 0; >+ argumentComposite.setLayout(layout); >+ data = new GridData(SWT.FILL, SWT.FILL, true, true); >+ argumentComposite.setLayoutData(data); >+ argumentComposite.setFont(font); >+ createArgumentsArea(font, argumentComposite); >+ } > > createDescriptionArea(font, idComposite); >- fContentAssistField.setEnabled(filter.getId().equals(REGEX_FILTER_ID)); >+ if (fContentAssistField != null) >+ fContentAssistField.setEnabled(filter.getId().equals(REGEX_FILTER_ID)); > } > > /**
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 301820
:
161429
|
163828
|
163829
|
163830
|
163831
|
163922
|
163923
|
163924
|
163925
|
163927
|
164035
|
164040
|
164141
|
164142
|
164143
|
164211
|
164212
|
164341
|
164343
|
164363
|
164439
|
164567
|
164582
|
164809
|
164836
|
164837