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 165554 Details for
Bug 309815
Polish Resource Filter properties UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
New patch
patch.txt (text/plain), 33.44 KB, created by
Serge Beauchamp
on 2010-04-21 07:21:16 EDT
(
hide
)
Description:
New patch
Filename:
MIME Type:
Creator:
Serge Beauchamp
Created:
2010-04-21 07:21:16 EDT
Size:
33.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.resources >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.resources/plugin.properties,v >retrieving revision 1.25 >diff -u -r1.25 plugin.properties >--- plugin.properties 25 Jan 2010 14:08:44 -0000 1.25 >+++ plugin.properties 21 Apr 2010 11:12:58 -0000 >@@ -34,5 +34,5 @@ > compatibilityFragmentName = Core Resource Management Compatibility Fragment > win32MonitorFactoryName = Windows Auto-refresh monitor > >-regexFilterProvider.description = Matches objects based on a regular expression >+regexFilterProvider.description = Matches file and folder names with a regular expression > regexFilterProvider.name = Regular Expression >\ No newline at end of file >#P org.eclipse.ui.ide >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.85 >diff -u -r1.85 IDEWorkbenchMessages.java >--- src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 21 Apr 2010 09:48:44 -0000 1.85 >+++ src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java 21 Apr 2010 11:13:02 -0000 >@@ -61,7 +61,7 @@ > public static String ResourceFilterPage_columnFilterTarget; > public static String ResourceFilterPage_columnFilterPattern; > public static String ResourceFilterPage_applyRecursivelyToFolderStructure; >- public static String ResourceFilterPage_condition; >+ public static String ResourceFilterPage_details; > public static String ResourceFilterPage_caseSensitive; > public static String ResourceFilterPage_regularExpression; > public static String ResourceFilterPage_multiMatcher_Matcher; >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.203 >diff -u -r1.203 messages.properties >--- src/org/eclipse/ui/internal/ide/messages.properties 21 Apr 2010 09:48:44 -0000 1.203 >+++ src/org/eclipse/ui/internal/ide/messages.properties 21 Apr 2010 11:13:03 -0000 >@@ -580,12 +580,12 @@ > ResourceFilterPage_addGroupButtonLabel=Add &Group... > ResourceFilterPage_editButtonLabel=&Edit... > ResourceFilterPage_removeButtonLabel=&Remove >-ResourceFilterPage_columnFilterMode=Operation >+ResourceFilterPage_columnFilterMode=Filter type > ResourceFilterPage_columnFilterDescription=Description > ResourceFilterPage_columnFilterTarget=Applies to > ResourceFilterPage_columnFilterPattern=&Pattern > ResourceFilterPage_applyRecursivelyToFolderStructure=Apply &recursively to folder structure >-ResourceFilterPage_condition=Con&dition: >+ResourceFilterPage_details=Filter Details > ResourceFilterPage_caseSensitive=&Case sensitive > ResourceFilterPage_regularExpression=Re&gular expression > ResourceFilterPage_multiMatcher_Matcher=(* = any string, ? = any character, \ = escape for literals: * ? \\) >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.22 >diff -u -r1.22 ResourceFilterGroup.java >--- src/org/eclipse/ui/internal/ide/dialogs/ResourceFilterGroup.java 14 Apr 2010 14:32:05 -0000 1.22 >+++ src/org/eclipse/ui/internal/ide/dialogs/ResourceFilterGroup.java 21 Apr 2010 11:13:04 -0000 >@@ -39,10 +39,8 @@ > import org.eclipse.core.runtime.Assert; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; >-import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.core.runtime.Platform; >-import org.eclipse.core.runtime.Status; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.MenuManager; > import org.eclipse.jface.action.Separator; >@@ -124,6 +122,7 @@ > import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; > import org.eclipse.ui.internal.ide.IIDEHelpContextIds; > import org.eclipse.ui.internal.ide.misc.FileInfoAttributesMatcher; >+import org.eclipse.ui.internal.ide.misc.StringFileInfoMatcher; > import org.eclipse.ui.plugin.AbstractUIPlugin; > > /** >@@ -304,8 +303,11 @@ > try { > IResourceFilterDescription[] tmp = resource.getFilters(); > children = new LinkedList(); >- for (int i = 0; i < tmp.length; i++) >- addChild(new FilterCopy(UIResourceFilterDescription.wrap(tmp[i]))); >+ for (int i = 0; i < tmp.length; i++) { >+ FilterCopy copy = new FilterCopy(UIResourceFilterDescription.wrap(tmp[i])); >+ copy = convertLegacyMatchers(copy); >+ addChild(copy); >+ } > } catch (CoreException e) { > ErrorDialog.openError(shell, NLS.bind( > IDEWorkbenchMessages.InternalError, null), e >@@ -420,8 +422,11 @@ > class TreeContentProvider implements ITreeContentProvider { > > public Object[] getChildren(Object parentElement) { >- if (parentElement == filters) >- return new Object[] {includeOnlyGroup, excludeAllGroup}; >+ if (parentElement == filters) { >+ if (filters.getChildren().length > 0) >+ return new Object[] {includeOnlyGroup, excludeAllGroup}; >+ return new Object[0]; >+ } > if (parentElement instanceof String) { > ArrayList list = new ArrayList(); > int mask = parentElement.equals(includeOnlyGroup) ? IResourceFilterDescription.INCLUDE_ONLY: >@@ -487,9 +492,9 @@ > textStyle.font= plainFont; > } > }; >- ICustomFilterArgumentUI ui = new MultiMatcherCustomFilterArgumentUI(null, null); >+ ICustomFilterArgumentUI ui = new MultiMatcherCustomFilterArgumentUI(null, null, null); > customfilterArgumentMap.put(ui.getID(), ui); >- ui = new DefaultCustomFilterArgumentUI(null, null); >+ ui = new DefaultCustomFilterArgumentUI(null, null, null); > customfilterArgumentMap.put(ui.getID(), ui); > } > >@@ -905,7 +910,16 @@ > } > > private void handleAdd(Object selection, boolean createGroupOnly) { >- if (selection instanceof FilterCopy) { >+ if (selection == null) { >+ FilterCopy newFilter = new FilterCopy(); >+ FilterEditDialog dialog = new FilterEditDialog(resource, ResourceFilterGroup.this, shell, >+ newFilter, createGroupOnly, true); >+ if (dialog.open() == Window.OK) { >+ addToTopLevelFilters(newFilter); >+ refreshAndSelect(newFilter); >+ } >+ } >+ else if (selection instanceof FilterCopy) { > FilterCopy filter = (FilterCopy) selection; > if (filter.getChildrenLimit() > 0) { > FilterCopy newFilter = new FilterCopy(); >@@ -919,7 +933,7 @@ > } > } > } >- if (selection instanceof String) { >+ else if (selection instanceof String) { > FilterCopy newFilter = new FilterCopy(); > FilterTypeUtil.setValue(newFilter, FilterTypeUtil.MODE, > new Integer(selection.equals(includeOnlyGroup) ? 0:1)); >@@ -939,7 +953,7 @@ > > private boolean isAddEnabled(Object selection) { > if (selection == null) >- return false; >+ return true; > if (selection instanceof FilterCopy) { > FilterCopy filter = (FilterCopy) selection; > return filter.getChildrenLimit() > 0; >@@ -1162,6 +1176,8 @@ > IStructuredSelection structuredSelection = ((IStructuredSelection) selection); > if (!structuredSelection.isEmpty()) > handleAdd(structuredSelection.getFirstElement(), createGroupOnly); >+ else >+ handleAdd(null, createGroupOnly); > } > } > >@@ -1553,6 +1569,12 @@ > sortDescriptors(descriptors); > LinkedList names = new LinkedList(); > for (int i = 0; i < descriptors.length; i++) { >+ // remove legacy filters >+ if (descriptors[i].getId().equals(DefaultCustomFilterArgumentUI.REGEX_FILTER_ID)) >+ continue; >+ if (descriptors[i].getId().equals(StringFileInfoMatcher.ID)) >+ continue; >+ > boolean isGroup = descriptors[i].getArgumentType().equals( > IFilterMatcherDescriptor.ARGUMENT_TYPE_FILTER_MATCHER) > || descriptors[i].getArgumentType().equals( >@@ -1625,6 +1647,22 @@ > original = filter; > } > >+ protected FilterCopy convertLegacyMatchers(FilterCopy copy) { >+ if (copy.getId().equals(DefaultCustomFilterArgumentUI.REGEX_FILTER_ID) || >+ copy.getId().equals(StringFileInfoMatcher.ID)) { >+ String pattern = (String) copy.getArguments(); >+ FileInfoAttributesMatcher.Argument argument = new FileInfoAttributesMatcher.Argument(); >+ argument.key = FileInfoAttributesMatcher.KEY_NAME; >+ argument.operator = FileInfoAttributesMatcher.OPERATOR_MATCHES; >+ argument.pattern = pattern; >+ argument.regularExpression = copy.getId().equals(DefaultCustomFilterArgumentUI.REGEX_FILTER_ID); >+ String encodedArgument = FileInfoAttributesMatcher.encodeArguments(argument); >+ FilterTypeUtil.setValue(copy, FilterTypeUtil.ID, FileInfoAttributesMatcher.ID); >+ FilterTypeUtil.setValue(copy, FilterTypeUtil.ARGUMENTS, encodedArgument); >+ } >+ return copy; >+ } >+ > public void removeAll() { > initializeChildren(); > Iterator it = children.iterator(); >@@ -1917,7 +1955,8 @@ > protected Button filesAndFoldersButton; > protected Combo idCombo; > protected Composite idComposite; >- protected Button idButton; >+ protected Button includeButton; >+ protected Button excludeButton; > protected Composite argumentComposite; > protected Button inherited; > protected FilterTypeUtil util; >@@ -1932,7 +1971,7 @@ > public void create(Composite argumentComposite, Font font) {} > public void dispose() {} > public void selectionChanged() {} >- public void validate() {} >+ public String validate() {return null;} > public StyledString formatStyledText(FilterCopy filter, > Styler fPlainStyler, Styler fBoldStyler) {return null;} > }; >@@ -1944,6 +1983,7 @@ > * @param parentShell > * @param filter > * @param createGroupOnly >+ * @param creatingNewFilter > */ > public FilterEditDialog(IResource resource, ResourceFilterGroup filterGroup, Shell parentShell, FilterCopy filter, boolean createGroupOnly, boolean creatingNewFilter) { > super(parentShell); >@@ -1953,9 +1993,9 @@ > this.filter = filter; > this.createGroupOnly = createGroupOnly; > util = new FilterTypeUtil(); >- ICustomFilterArgumentUI ui = new MultiMatcherCustomFilterArgumentUI(parentShell, filter); >+ ICustomFilterArgumentUI ui = new MultiMatcherCustomFilterArgumentUI(this, parentShell, filter); > customfilterArgumentMap.put(ui.getID(), ui); >- ui = new DefaultCustomFilterArgumentUI(parentShell, filter); >+ ui = new DefaultCustomFilterArgumentUI(this, parentShell, filter); > customfilterArgumentMap.put(ui.getID(), ui); > } > >@@ -2001,10 +2041,11 @@ > topComposite.setLayoutData(data); > topComposite.setFont(font); > >+ createModeArea(font, topComposite); >+ > createTargetArea(font, topComposite); > > createIdArea(font, topComposite); >- createInheritableArea(font, topComposite); > } > else { > layout.marginHeight = convertHorizontalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); >@@ -2101,10 +2142,42 @@ > FilterTypeUtil.INHERITABLE)).booleanValue())); > } > >- /** >- * @param font >- * @param composite >- */ >+ private void createModeArea(Font font, Composite composite) { >+ GridData data; >+ Composite modeComposite = createGroup(font, composite, NLS.bind( >+ IDEWorkbenchMessages.ResourceFilterPage_columnFilterMode, >+ null), true, true, 1); >+ String[] modes = FilterTypeUtil.getModes(); >+ includeButton = new Button(modeComposite, SWT.RADIO); >+ includeButton.setText(modes[0]); >+ includeButton.setImage(filterGroup.getImage(FilterTypeUtil.MODE, 0)); >+ data = new GridData(SWT.FILL, SWT.CENTER, true, false); >+ includeButton.setLayoutData(data); >+ includeButton.setFont(font); >+ includeButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ FilterTypeUtil.setValue(filter, FilterTypeUtil.MODE, >+ new Integer(0)); >+ } >+ }); >+ includeButton.setSelection(((Integer) FilterTypeUtil.getValue( >+ filter, FilterTypeUtil.MODE)).intValue() == 0); >+ excludeButton = new Button(modeComposite, SWT.RADIO); >+ excludeButton.setText(modes[1]); >+ excludeButton.setImage(filterGroup.getImage(FilterTypeUtil.MODE, 1)); >+ data = new GridData(SWT.FILL, SWT.CENTER, true, false); >+ excludeButton.setLayoutData(data); >+ excludeButton.setFont(font); >+ excludeButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ FilterTypeUtil.setValue(filter, FilterTypeUtil.MODE, >+ new Integer(1)); >+ } >+ }); >+ excludeButton.setSelection(((Integer) FilterTypeUtil.getValue( >+ filter, FilterTypeUtil.MODE)).intValue() == 1); >+ } >+ > private void createIdArea(Font font, Composite composite) { > if (createGroupOnly) { > idComposite = createGroup(font, composite, new String(), >@@ -2114,39 +2187,20 @@ > idCombo.setLayoutData(data); > } > else { >- Composite superIdComposite = createGroup(font, composite, new String(), >- true, false, 1); >- GridLayout layout = (GridLayout) superIdComposite.getLayout(); >- layout.marginBottom = 0; >- layout.marginTop = 0; >- layout.marginHeight = 0; >- layout.marginWidth = 0; >- layout.verticalSpacing = 0; >- layout.marginLeft = 0; >- superIdComposite.setLayout(layout); >- >- Composite labelComposite = createGroup(font, superIdComposite, new String(), >- true, false, 2); >- >- layout = (GridLayout) labelComposite.getLayout(); >- layout.marginBottom = 0; >- layout.marginLeft = 0; >- layout.marginTop = 0; >- layout.marginHeight = 0; >- layout.marginWidth = 0; >- layout.verticalSpacing = 0; >- labelComposite.setLayout(layout); >- >- Label label = new Label(labelComposite, SWT.NONE); >- label.setText(NLS.bind(IDEWorkbenchMessages.ResourceFilterPage_condition, null)); >- label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); >- label.setFont(font); >+ String [] matchers = FilterTypeUtil.getFilterNames(createGroupOnly); >+ boolean hasMoreThanOneMatcher = matchers.length > 1; > >- createMatcherCombo(labelComposite, font); >+ if (hasMoreThanOneMatcher) { >+ createMatcherCombo(composite, font); >+ GridData data = new GridData(SWT.LEFT, SWT.CENTER, false, false); >+ idCombo.setLayoutData(data); >+ } > >- idComposite = createGroup(font, superIdComposite, new String(), >+ idComposite = createGroup(font, composite, >+ hasMoreThanOneMatcher ? IDEWorkbenchMessages.ResourceFilterPage_details: matchers[0], > true, true, 1); >- layout = (GridLayout) idComposite.getLayout(); >+ >+ GridLayout layout = (GridLayout) idComposite.getLayout(); > layout.marginBottom = 0; > layout.marginTop = 0; > layout.marginWidth = 0; >@@ -2173,6 +2227,13 @@ > filter.setArguments(new String()); > setupPatternLine(); > currentCustomFilterArgumentUI.selectionChanged(); >+ getShell().layout(true); >+ Point size = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); >+ Point shellSize = getShell().getSize(); >+ size.x = Math.max(size.x, shellSize.x); >+ size.y = Math.max(size.y, shellSize.y); >+ getShell().setSize(size); >+ getShell().redraw(); > } > }); > idCombo.select(0); >@@ -2203,8 +2264,6 @@ > currentCustomFilterArgumentUI.dispose(); > currentCustomFilterArgumentUI = customFilterArgumentUI; > currentCustomFilterArgumentUI.create(argumentComposite, font); >- getShell().layout(true); >- getShell().redraw(); > } > } > >@@ -2261,26 +2320,23 @@ > private void createTargetArea(Font font, Composite composite) { > GridData data; > Composite targetComposite = createGroup(font, composite, >- NLS.bind(IDEWorkbenchMessages.ResourceFilterPage_columnFilterTarget, null), false, true, 3); >+ NLS.bind(IDEWorkbenchMessages.ResourceFilterPage_columnFilterTarget, null), false, true, 1); > > String[] targets = FilterTypeUtil.getTargets(); > filesButton = new Button(targetComposite, SWT.RADIO); > filesButton.setText(targets[0]); >- filesButton.setImage(filterGroup.getImage(FilterTypeUtil.TARGET, 0)); > data = new GridData(SWT.LEFT, SWT.CENTER, false, false); > filesButton.setLayoutData(data); > filesButton.setFont(font); > > foldersButton = new Button(targetComposite, SWT.RADIO); > foldersButton.setText(targets[1]); >- foldersButton.setImage(filterGroup.getImage(FilterTypeUtil.TARGET, 1)); > data = new GridData(SWT.LEFT, SWT.CENTER, false, false); > foldersButton.setLayoutData(data); > foldersButton.setFont(font); > > filesAndFoldersButton = new Button(targetComposite, SWT.RADIO); > filesAndFoldersButton.setText(targets[2]); >- filesAndFoldersButton.setImage(filterGroup.getImage(FilterTypeUtil.TARGET, 2)); > data = new GridData(SWT.LEFT, SWT.CENTER, false, false); > filesAndFoldersButton.setLayoutData(data); > filesAndFoldersButton.setFont(font); >@@ -2309,6 +2365,7 @@ > FilterTypeUtil.TARGET)).intValue() == 1); > filesAndFoldersButton.setSelection(((Integer) FilterTypeUtil.getValue( > filter, FilterTypeUtil.TARGET)).intValue() == 2); >+ createInheritableArea(font, targetComposite); > } > > protected Control createContents(Composite parent) { >@@ -2318,6 +2375,14 @@ > return control; > } > >+ public void updateFinishControls() { >+ if (getButton(OK) != null) { >+ if (currentCustomFilterArgumentUI != null) >+ getButton(OK).setEnabled(currentCustomFilterArgumentUI.validate() == null); >+ else >+ getButton(OK).setEnabled(true); >+ } >+ } > /* > * (non-Javadoc) > * >@@ -2372,6 +2437,14 @@ > > super.okPressed(); > } >+ >+ public int getVerticalDLUsToPixel(int flag) { >+ return convertVerticalDLUsToPixels(flag); >+ } >+ >+ public IResource getResource() { >+ return resource; >+ } > } > > interface ICustomFilterArgumentUI { >@@ -2391,10 +2464,10 @@ > Styler fBoldStyler); > > /** >- * @throws CoreException >+ * @return null if there's no issue > * > */ >- void validate() throws CoreException; >+ String validate(); > > /** > * >@@ -2430,18 +2503,21 @@ > protected Combo multiOperator; > protected Composite multiArgumentComposite; > protected Composite stringArgumentComposite; >+ protected Composite stringTextArgumentComposite; > protected Composite attributeStringArgumentComposite; > protected Class intiantiatedKeyOperatorType = null; > protected TreeMap/* <String, String>*/ valueCache = new TreeMap(); > protected boolean initializationComplete = false; >- >+ protected FilterEditDialog dialog; > /** >+ * @param dialog > * @param parentShell > * @param filter > */ >- public MultiMatcherCustomFilterArgumentUI(Shell parentShell, >+ public MultiMatcherCustomFilterArgumentUI(FilterEditDialog dialog, Shell parentShell, > FilterCopy filter) { > this.shell = parentShell; >+ this.dialog = dialog; > this.filter = filter; > } > >@@ -2456,7 +2532,7 @@ > * @see org.eclipse.ui.internal.ide.dialogs.ICustomFilterArgumentUI#dispose() > */ > public void dispose() { >- Widget list[] = new Widget[] {multiKey, multiOperator, multiArgumentComposite, stringArgumentComposite, arguments, argumentsLabel, argumentsCaseSensitive, argumentsRegularExpresion, attributeStringArgumentComposite, description}; >+ Widget list[] = new Widget[] {multiKey, multiOperator, multiArgumentComposite, stringArgumentComposite, stringTextArgumentComposite, arguments, argumentsLabel, argumentsCaseSensitive, argumentsRegularExpresion, attributeStringArgumentComposite, description}; > for (int i = 0; i < list.length; i++) { > if (list[i] != null) { > list[i].dispose(); >@@ -2470,6 +2546,7 @@ > fContentAssistField = null; > intiantiatedKeyOperatorType = null; > stringArgumentComposite = null; >+ stringTextArgumentComposite = null; > argumentsCaseSensitive = null; > argumentsRegularExpresion = null; > attributeStringArgumentComposite = null; >@@ -2484,7 +2561,8 @@ > shell = argumentComposite.getShell(); > GridLayout layout = new GridLayout(); > layout.numColumns = 3; >- layout.marginWidth = 0; >+ layout.marginWidth = dialog.getVerticalDLUsToPixel(IDialogConstants.HORIZONTAL_MARGIN); >+ layout.horizontalSpacing = dialog.getVerticalDLUsToPixel(IDialogConstants.HORIZONTAL_SPACING); > argumentComposite.setLayout(layout); > GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); > argumentComposite.setLayoutData(data); >@@ -2508,27 +2586,33 @@ > data.horizontalSpan = 3; > description.setLayoutData(data); > description.setFont(font); >- setupDescriptionText(); >+ setupDescriptionText(null); > } > >- private void setupDescriptionText() { >+ private void setupDescriptionText(String errorString) { > if (description != null) { >- String selectedKey = MultiMatcherLocalization.getMultiMatcherKey(multiKey.getText()); >- String selectedOperator = MultiMatcherLocalization.getMultiMatcherKey(multiOperator.getText()); >- Class selectedKeyOperatorType = FileInfoAttributesMatcher.getTypeForKey(selectedKey, selectedOperator); >- description.setText(new String()); >- if (selectedKeyOperatorType.equals(String.class)) { >- if (!argumentsRegularExpresion.getSelection()) >- description.setText(NLS.bind( >- IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_Matcher, null)); >- } >- if (selectedKeyOperatorType.equals(Integer.class)) { >- if (selectedKey.equals(FileInfoAttributesMatcher.KEY_LAST_MODIFIED) || selectedKey.equals(FileInfoAttributesMatcher.KEY_CREATED)) >+ if (errorString != null) { >+ description.setForeground(shell.getDisplay().getSystemColor(SWT.COLOR_RED)); >+ description.setText(errorString); >+ } else { >+ description.setForeground(shell.getDisplay().getSystemColor(SWT.COLOR_BLACK)); >+ String selectedKey = MultiMatcherLocalization.getMultiMatcherKey(multiKey.getText()); >+ String selectedOperator = MultiMatcherLocalization.getMultiMatcherKey(multiOperator.getText()); >+ Class selectedKeyOperatorType = FileInfoAttributesMatcher.getTypeForKey(selectedKey, selectedOperator); >+ description.setText(new String()); >+ if (selectedKeyOperatorType.equals(String.class)) { >+ if (!argumentsRegularExpresion.getSelection()) >+ description.setText(NLS.bind( >+ IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_Matcher, null)); >+ } >+ if (selectedKeyOperatorType.equals(Integer.class)) { >+ if (selectedKey.equals(FileInfoAttributesMatcher.KEY_LAST_MODIFIED) || selectedKey.equals(FileInfoAttributesMatcher.KEY_CREATED)) >+ description.setText(NLS.bind( >+ IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_TimeInterval, null)); >+ else > description.setText(NLS.bind( >- IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_TimeInterval, null)); >- else >- description.setText(NLS.bind( >- IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_FileLength, null)); >+ IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_FileLength, null)); >+ } > } > } > } >@@ -2648,35 +2732,26 @@ > layout.numColumns = 2; > layout.marginWidth = 4; > layout.horizontalSpacing = 4; >- layout.verticalSpacing = 0; >+ layout.verticalSpacing = dialog.getVerticalDLUsToPixel(IDialogConstants.VERTICAL_SPACING); > layout.marginBottom = 0; > layout.marginHeight = 0; > stringArgumentComposite.setLayout(layout); >- data = new GridData(SWT.FILL, SWT.TOP, true, true); >+ data = new GridData(SWT.FILL, SWT.CENTER, true, true); > stringArgumentComposite.setLayoutData(data); > stringArgumentComposite.setFont(multiArgumentComposite.getFont()); > > arguments = new Text(stringArgumentComposite, SWT.SINGLE | SWT.BORDER); >- data = new GridData(SWT.FILL, SWT.TOP, true, false); >+ data = new GridData(SWT.FILL, SWT.CENTER, true, false); > data.minimumWidth = 100; > arguments.setLayoutData(data); > arguments.setFont(stringArgumentComposite.getFont()); >+ arguments.addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ validateInputText(); >+ } >+ }); > >- attributeStringArgumentComposite = new Composite(stringArgumentComposite, SWT.NONE); >- >- layout = new GridLayout(); >- layout.numColumns = 1; >- layout.marginWidth = 0; >- layout.horizontalSpacing = 4; >- layout.verticalSpacing = 0; >- layout.marginBottom = 0; >- layout.marginHeight = 0; >- attributeStringArgumentComposite.setLayout(layout); >- data = new GridData(SWT.FILL, SWT.TOP, false, true); >- attributeStringArgumentComposite.setLayoutData(data); >- attributeStringArgumentComposite.setFont(stringArgumentComposite.getFont()); >- >- argumentsCaseSensitive = new Button(attributeStringArgumentComposite, SWT.CHECK); >+ argumentsCaseSensitive = new Button(stringArgumentComposite, SWT.CHECK); > argumentsCaseSensitive.setText(NLS.bind( > IDEWorkbenchMessages.ResourceFilterPage_caseSensitive, null)); > data = new GridData(SWT.FILL, SWT.CENTER, false, false); >@@ -2684,7 +2759,11 @@ > argumentsCaseSensitive.setLayoutData(data); > argumentsCaseSensitive.setFont(stringArgumentComposite.getFont()); > >- argumentsRegularExpresion = new Button(attributeStringArgumentComposite, SWT.CHECK); >+ Label emptyLabel = new Label(stringArgumentComposite, SWT.NONE); >+ data = new GridData(SWT.FILL, SWT.CENTER, true, false); >+ emptyLabel.setLayoutData(data); >+ >+ argumentsRegularExpresion = new Button(stringArgumentComposite, SWT.CHECK); > argumentsRegularExpresion.setText(NLS.bind( > IDEWorkbenchMessages.ResourceFilterPage_regularExpression, null)); > data = new GridData(SWT.FILL, SWT.CENTER, false, false); >@@ -2707,7 +2786,7 @@ > }); > argumentsRegularExpresion.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { >- setupDescriptionText(); >+ setupDescriptionText(null); > storeMultiSelection(); > if (fContentAssistField != null) > fContentAssistField.setEnabled(argumentsRegularExpresion.getSelection()); >@@ -2736,6 +2815,11 @@ > data.minimumWidth = 100; > arguments.setLayoutData(data); > arguments.setFont(multiArgumentComposite.getFont()); >+ arguments.addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ validateInputText(); >+ } >+ }); > > if (filter.hasStringArguments()) { > FileInfoAttributesMatcher.Argument argument = FileInfoAttributesMatcher.decodeArguments((String) filter.getArguments()); >@@ -2754,7 +2838,7 @@ > if (selectedKeyOperatorType.equals(Date.class)) { > GridData data; > argumentsDate = new DateTime(multiArgumentComposite, SWT.DATE | SWT.MEDIUM); >- data = new GridData(SWT.FILL, SWT.TOP, true, false); >+ data = new GridData(SWT.FILL, SWT.CENTER, true, false); > argumentsDate.setLayoutData(data); > argumentsDate.setFont(multiArgumentComposite.getFont()); > argumentsDate.addSelectionListener(new SelectionAdapter() { >@@ -2808,10 +2892,13 @@ > shell.layout(true); > if (initializationComplete) { > Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT); >+ Point shellSize = shell.getSize(); >+ size.x = Math.max(size.x, shellSize.x); >+ size.y = Math.max(size.y, shellSize.y); > shell.setSize(size); > } > shell.redraw(); >- setupDescriptionText(); >+ setupDescriptionText(null); > } > > private String[] timeIntervalPrefixes = {"s", "m", "h", "d"}; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ >@@ -2957,13 +3044,13 @@ > public void selectionChanged() { > } > >- /** >- * @throws CoreException >- */ >- /* (non-Javadoc) >- * @see org.eclipse.ui.internal.ide.dialogs.ICustomFilterArgumentUI#verifyData() >- */ >- public void validate() throws CoreException { >+ void validateInputText() { >+ setupDescriptionText(validate()); >+ dialog.updateFinishControls(); >+ } >+ >+ public String validate() { >+ String message = null; > if (intiantiatedKeyOperatorType != null) { > String selectedKey = MultiMatcherLocalization.getMultiMatcherKey(multiKey.getText()); > String selectedOperator = MultiMatcherLocalization.getMultiMatcherKey(multiOperator.getText()); >@@ -2975,22 +3062,40 @@ > if (intiantiatedKeyOperatorType.equals(Date.class) && argumentsDate != null) { > } > if (intiantiatedKeyOperatorType.equals(String.class) && arguments != null) { >+ argument.pattern = arguments.getText(); >+ if (argumentsRegularExpresion != null) >+ argument.regularExpression = argumentsRegularExpresion.getSelection(); >+ if (argumentsCaseSensitive != null) >+ argument.caseSensitive = argumentsCaseSensitive.getSelection(); >+ String encodedArgument = FileInfoAttributesMatcher.encodeArguments(argument); >+ FilterCopy copy = new FilterCopy(filter); >+ FilterTypeUtil.setValue(copy, FilterTypeUtil.ARGUMENTS, encodedArgument); >+ >+ IFilterMatcherDescriptor desc = dialog.getResource().getWorkspace().getFilterMatcherDescriptor(copy.getId()); >+ if (desc != null) { >+ try { >+ AbstractFileInfoMatcher matcher = ((FilterDescriptor) desc).createFilter(); >+ matcher.initialize(dialog.getResource().getProject(), copy.getArguments()); >+ } catch (CoreException e) { >+ message = e.getMessage(); >+ } >+ } > } > if (intiantiatedKeyOperatorType.equals(Integer.class) && arguments != null) { > if (selectedKey.equals(FileInfoAttributesMatcher.KEY_LAST_MODIFIED) || selectedKey.equals(FileInfoAttributesMatcher.KEY_CREATED)) { > try { > convertFromEditableTimeInterval(arguments.getText()); > } catch (NumberFormatException e) { >- throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, Platform.PLUGIN_ERROR, NLS.bind( >- IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_InvalidTimeInterval, arguments.getText()), e)); >+ message = NLS.bind( >+ IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_InvalidTimeInterval, arguments.getText()); > } > } > else { > try { > convertFromEditableLength(arguments.getText()); > } catch (NumberFormatException e) { >- throw new CoreException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, Platform.PLUGIN_ERROR, NLS.bind( >- IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_InvalidFileLength, arguments.getText()), e)); >+ message = NLS.bind( >+ IDEWorkbenchMessages.ResourceFilterPage_multiMatcher_InvalidFileLength, arguments.getText()); > } > } > } >@@ -2998,6 +3103,7 @@ > > } > } >+ return message; > } > > /* (non-Javadoc) >@@ -3037,21 +3143,24 @@ > > class DefaultCustomFilterArgumentUI implements ICustomFilterArgumentUI { > >- Shell shell; >- FilterCopy filter; >+ protected Shell shell; >+ protected FilterCopy filter; > protected Text arguments; > protected Label argumentsLabel; > protected Label description; > protected ContentAssistCommandAdapter fContentAssistField; >+ protected FilterEditDialog dialog; > >- private static final String REGEX_FILTER_ID = "org.eclipse.core.resources.regexFilterMatcher"; //$NON-NLS-1$ >+ public static final String REGEX_FILTER_ID = "org.eclipse.core.resources.regexFilterMatcher"; //$NON-NLS-1$ > > /** >+ * @param dialog > * @param parentShell > * @param filter > */ >- public DefaultCustomFilterArgumentUI(Shell parentShell, FilterCopy filter) { >+ public DefaultCustomFilterArgumentUI(FilterEditDialog dialog, Shell parentShell, FilterCopy filter) { > this.shell = parentShell; >+ this.dialog = dialog; > this.filter = filter; > } > >@@ -3085,7 +3194,7 @@ > shell = argumentComposite.getShell(); > GridLayout layout = new GridLayout(); > layout.numColumns = 2; >- layout.marginWidth = 0; >+ layout.marginWidth = dialog.getVerticalDLUsToPixel(IDialogConstants.HORIZONTAL_MARGIN); > argumentComposite.setLayout(layout); > GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); > argumentComposite.setLayoutData(data); >@@ -3182,14 +3291,8 @@ > description.setFont(font); > } > >- /** >- * @throws CoreException >- */ >- /* (non-Javadoc) >- * @see org.eclipse.ui.internal.ide.dialogs.ICustomFilterArgumentUI#verifyData() >- */ >- public void validate() throws CoreException { >- // nothing >+ public String validate(){ >+ return null; > } > > /* (non-Javadoc) >Index: src/org/eclipse/ui/internal/ide/misc/StringFileInfoMatcher.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/misc/StringFileInfoMatcher.java,v >retrieving revision 1.4 >diff -u -r1.4 StringFileInfoMatcher.java >--- src/org/eclipse/ui/internal/ide/misc/StringFileInfoMatcher.java 17 Mar 2010 14:30:16 -0000 1.4 >+++ src/org/eclipse/ui/internal/ide/misc/StringFileInfoMatcher.java 21 Apr 2010 11:13:04 -0000 >@@ -23,6 +23,10 @@ > */ > public class StringFileInfoMatcher extends AbstractFileInfoMatcher { > >+ /** >+ */ >+ public static String ID = "org.eclipse.ui.ide.patternFilterMatcher"; //$NON-NLS-1$ >+ > StringMatcher matcher = null; > /** > * Creates a new factory for this filter type. >Index: src/org/eclipse/ui/wizards/datatransfer/ImportOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/wizards/datatransfer/ImportOperation.java,v >retrieving revision 1.23 >diff -u -r1.23 ImportOperation.java >--- src/org/eclipse/ui/wizards/datatransfer/ImportOperation.java 19 Apr 2010 14:50:32 -0000 1.23 >+++ src/org/eclipse/ui/wizards/datatransfer/ImportOperation.java 21 Apr 2010 11:13:05 -0000 >@@ -968,7 +968,9 @@ > } > > /** >- * Set Whether links will be created instead of files >+ * Set whether link files will be created instead of regular files. >+ * If the value setCreateLinks(boolean) is already set to true, >+ * this flag has no effect. > * > * @param linkFilesOnly > * @since 3.6
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 309815
:
165486
|
165487
|
165488
|
165490
|
165550
|
165554
|
165555
|
165574
|
165575
|
165580
|
165661
|
165662
|
165744
|
165759
|
165760
|
165893