Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2015-03-18 22:54:02 -0400
committerGerrit Code Review @ Eclipse.org2015-03-23 15:47:04 -0400
commit535f49a7db11a4a7f7fb3a5cc7431d5b5cd1ad66 (patch)
tree8501289ef14ae38bfe7d110dcbdae06243ba4c10 /codan/org.eclipse.cdt.codan.ui
parent862705bb45d13bcb45e860b9a97b358db9f1b92f (diff)
downloadorg.eclipse.cdt-535f49a7db11a4a7f7fb3a5cc7431d5b5cd1ad66.tar.gz
org.eclipse.cdt-535f49a7db11a4a7f7fb3a5cc7431d5b5cd1ad66.tar.xz
org.eclipse.cdt-535f49a7db11a4a7f7fb3a5cc7431d5b5cd1ad66.zip
codan: added filter field in the problem configuration page
tree is getting very big. Added tree filter. Change-Id: I49a0b059c794486178b2ba35bbe42b6131c34888
Diffstat (limited to 'codan/org.eclipse.cdt.codan.ui')
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java6
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java2
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java18
3 files changed, 24 insertions, 2 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
index fce68275b6..7fc1d6ad4d 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CheckedTreeEditor.java
@@ -212,7 +212,7 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
Tree table = (Tree) getTreeControl();
if (table == null) {
listParent = parent;
- treeViewer = new CheckboxTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
+ treeViewer = doCreateTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
table = treeViewer.getTree();
table.setFont(parent.getFont());
treeViewer.setComparator(new ViewerComparator());
@@ -223,6 +223,10 @@ public abstract class CheckedTreeEditor extends FieldEditor implements ICheckSta
return table;
}
+ protected CheckboxTreeViewer doCreateTreeViewer(Composite parent, int style) {
+ return new CheckboxTreeViewer(parent, style);
+ }
+
public StructuredViewer getViewer() {
return treeViewer;
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
index ed194213d8..1abbd53851 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
@@ -153,7 +153,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
profile = getRegistry().getWorkspaceProfile();
}
Composite comp = (Composite) super.createContents(parent);
- createInfoControl(comp);
+ createInfoControl(parent);
return comp;
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
index fc044a9cf4..11d1d31dc9 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/ProblemsTreeEditor.java
@@ -32,6 +32,7 @@ import org.eclipse.cdt.codan.internal.ui.ImageConstants;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.ComboBoxCellEditor;
@@ -39,12 +40,15 @@ import org.eclipse.jface.viewers.EditingSupport;
import org.eclipse.jface.viewers.ICheckStateProvider;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.TreeViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.ToolTip;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
public class ProblemsTreeEditor extends CheckedTreeEditor {
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
@@ -382,4 +386,18 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
}
return message;
}
+
+ @Override
+ protected CheckboxTreeViewer doCreateTreeViewer(Composite parent, int style) {
+ PatternFilter filter = new PatternFilter();
+ filter.setIncludeLeadingWildcard(true);
+ FilteredTree filteredTree = new FilteredTree(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION,
+ filter, true) {
+ @Override
+ protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
+ return new CheckboxTreeViewer(parent, style);
+ }
+ };
+ return (CheckboxTreeViewer) filteredTree.getViewer();
+ }
}

Back to the top