diff options
author | Frank Becker | 2015-09-20 06:33:46 +0000 |
---|---|---|
committer | Frank Becker | 2015-09-20 16:57:29 +0000 |
commit | 64285d788a66ba031608a46ebb560743afb1cf8d (patch) | |
tree | e66f3b12f99a1061778eeb08b233271297fd3de0 | |
parent | fd1e6a0718ba7df86df78f364db338e306ebaa01 (diff) | |
download | org.eclipse.mylyn.commons-64285d788a66ba031608a46ebb560743afb1cf8d.tar.gz org.eclipse.mylyn.commons-64285d788a66ba031608a46ebb560743afb1cf8d.tar.xz org.eclipse.mylyn.commons-64285d788a66ba031608a46ebb560743afb1cf8d.zip |
442340: make UI legend easily discoverable (new protected method
createAdditionalControls)
Change-Id: I31cc3eba46ae63e783e5b82c07ff4002885d4da5
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=442340
-rw-r--r-- | org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java index 06f11e27..15303f0c 100644 --- a/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java +++ b/org.eclipse.mylyn.commons.workbench/src/org/eclipse/mylyn/commons/workbench/AbstractFilteredTree.java @@ -32,7 +32,7 @@ import org.eclipse.ui.progress.WorkbenchJob; /** * A filtered tree with additional controls below the filter text field. - * + * * @author Mik Kersten * @since 3.7 */ @@ -61,7 +61,7 @@ public abstract class AbstractFilteredTree extends EnhancedFilteredTree { /** * XXX: using reflection to gain access - * + * * @param parent * @param treeStyle * @param filter @@ -73,9 +73,8 @@ public abstract class AbstractFilteredTree extends EnhancedFilteredTree { refreshPolicy = new AdaptiveRefreshPolicy(refreshJob); } catch (Exception e) { - CommonsWorkbenchPlugin.getDefault() - .getLog() - .log(new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, "Could not get refresh job", e)); //$NON-NLS-1$ + CommonsWorkbenchPlugin.getDefault().getLog().log( + new Status(IStatus.ERROR, CommonsWorkbenchPlugin.ID_PLUGIN, "Could not get refresh job", e)); //$NON-NLS-1$ } setInitialText(LABEL_FIND); } @@ -186,6 +185,14 @@ public abstract class AbstractFilteredTree extends EnhancedFilteredTree { .applyTo(activeTaskComposite); } + Composite additionalComposite = createAdditionalControls(filterComposite); + if (additionalComposite != null) { + GridDataFactory.fillDefaults() + .align(SWT.BEGINNING, SWT.CENTER) + .grab(true, false) + .applyTo(additionalComposite); + } + gridLayout.numColumns = filterComposite.getChildren().length; return parent; } @@ -200,11 +207,18 @@ public abstract class AbstractFilteredTree extends EnhancedFilteredTree { return null; } + /** + * @since 3.18 + */ + protected Composite createAdditionalControls(Composite container) { + return null; + } + @Override protected void textChanged() { // this call allows the filtered tree to preserve the selection when the clear button is used. - // It is necessary to correctly set the private narrowingDown flag in the super class. - // Note that the scheduling of the refresh job that is done in the super class will be overridden + // It is necessary to correctly set the private narrowingDown flag in the super class. + // Note that the scheduling of the refresh job that is done in the super class will be overridden // by the call to refreshPolicy.textChanged(). String text = getFilterString(); if (text == null || text.equals(previousFilterText)) { |