diff options
author | Stefan Nöbauer | 2017-06-02 09:38:27 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-06-21 06:38:55 +0000 |
commit | b8c9d3578a3185e59c019100014a44eeacd2b375 (patch) | |
tree | 40c655a9fbcfea2ec1f1a962ad380abaa2847db4 | |
parent | 0bd6de95a5caa4ebc3f9d05a2453b945ef393621 (diff) | |
download | rt.equinox.p2-b8c9d3578a3185e59c019100014a44eeacd2b375.tar.gz rt.equinox.p2-b8c9d3578a3185e59c019100014a44eeacd2b375.tar.xz rt.equinox.p2-b8c9d3578a3185e59c019100014a44eeacd2b375.zip |
Bug 514476 - Fix filter in Installation Details -> Installed Software
Changed from own Filter implementation to Filtered Tree.
Used default PatternFilter.
Change-Id: I51ffce6c037052c814001aa05342eeeca9d2fbce
Signed-off-by: Stefan Nöbauer <stefan.noebauer@kgu-consulting.com>
2 files changed, 5 insertions, 20 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstalledIUGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstalledIUGroup.java index 23c48fdb2..da6dec0a5 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstalledIUGroup.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/InstalledIUGroup.java @@ -22,6 +22,8 @@ import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.widgets.*; +import org.eclipse.ui.dialogs.FilteredTree; +import org.eclipse.ui.dialogs.PatternFilter; /** * An InstalledIUGroup is a reusable UI component that displays the @@ -54,7 +56,9 @@ public class InstalledIUGroup extends StructuredIUGroup { @Override protected StructuredViewer createViewer(Composite parent) { // Table of installed IU's - TreeViewer installedIUViewer = new TreeViewer(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); + FilteredTree filteredTree = new FilteredTree(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true); + filteredTree.getFilterControl().setFocus(); //Steal focus, consistent with org.eclipse.ui.internal.about.AboutPluginsPage + TreeViewer installedIUViewer = filteredTree.getViewer(); // Filters and sorters before establishing content, so we don't refresh unnecessarily. IUComparator comparator = new IUComparator(IUComparator.IU_NAME); diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/InstalledSoftwarePage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/InstalledSoftwarePage.java index d2df73082..2f41c4f8c 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/InstalledSoftwarePage.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/InstalledSoftwarePage.java @@ -24,15 +24,12 @@ import org.eclipse.equinox.internal.p2.ui.viewers.IUDetailsLabelProvider; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.layout.GridDataFactory; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.viewers.*; import org.eclipse.jface.window.SameShellProvider; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; import org.eclipse.swt.dnd.*; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; @@ -66,7 +63,6 @@ public class InstalledSoftwarePage extends InstallationPage implements ICopyable String profileId; Button updateButton, uninstallButton, propertiesButton; ProvisioningUI ui; - private Text filterText; /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) @@ -98,12 +94,6 @@ public class InstalledSoftwarePage extends InstallationPage implements ICopyable layout.marginHeight = 0; composite.setLayout(layout); - //Let users filter installed softwares - filterText = new Text(composite, SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL); - filterText.setLayoutData(GridDataFactory.fillDefaults().create()); - filterText.setMessage(ProvUIMessages.InstalledSoftwarePage_Filter_Installed_Software); - filterText.setFocus();//Steal focus, consistent with org.eclipse.ui.internal.about.AboutPluginsPage - // Table of installed IU's installedIUGroup = new InstalledIUGroup(getProvisioningUI(), composite, JFaceResources.getDialogFont(), profileId, getColumnConfig()); // we hook selection listeners on the viewer in createPageButtons because we @@ -204,15 +194,6 @@ public class InstalledSoftwarePage extends InstallationPage implements ICopyable }); final IUPatternFilter searchFilter = new IUPatternFilter(getColumnConfig()); - filterText.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - if (filterText != null && !filterText.isDisposed()) { - searchFilter.setPattern(filterText.getText()); - installedIUGroup.getStructuredViewer().refresh(); - } - } - }); installedIUGroup.getStructuredViewer().addFilter(searchFilter); updateEnablement(); |