aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Perot2014-08-05 16:55:59 (EDT)
committerAlexandre Montplaisir2014-08-07 11:56:22 (EDT)
commit8a0f02310b724c94468254a025f3aafa383b4cc1 (patch)
tree300e5330c5303a7cb190d5d4a14b9b74574709b7
parent441ea5c3339421294ffce1a675230f5dbf73e206 (diff)
downloadorg.eclipse.linuxtools-8a0f02310b724c94468254a025f3aafa383b4cc1.zip
org.eclipse.linuxtools-8a0f02310b724c94468254a025f3aafa383b4cc1.tar.gz
org.eclipse.linuxtools-8a0f02310b724c94468254a025f3aafa383b4cc1.tar.bz2
tmf: add addFilter method to FilterViewrefs/changes/63/31063/5
This is used by tmf.pcap when extracting a filter from a stream. Change-Id: I4f44924a769b79cef8bf68b80a11cde407628b50 Signed-off-by: Vincent Perot <vincent.perot@ericsson.com> Reviewed-on: https://git.eclipse.org/r/31063 Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Hudson CI Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterView.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterView.java
index 5d410b5..3bd9d8b 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterView.java
@@ -10,7 +10,7 @@
* Yuriy Vashchuk - Initial API and implementation
* Xavier Raynaud - add cut/copy/paste/dnd support
* based on Francois Chouinard ProjectView code.
- */
+ *******************************************************************************/
package org.eclipse.linuxtools.tmf.ui.views.filter;
@@ -110,6 +110,26 @@ public class FilterView extends TmfView {
}
/**
+ * Add a filter to the FilterView. This does not modify the XML, which must
+ * be done manually. If the filter is already in the FilterView, this is a
+ * no-op.
+ *
+ * @param filter
+ * The filter to add.
+ * @since 3.1
+ */
+ public void addFilter(ITmfFilterTreeNode filter) {
+ ITmfFilterTreeNode root = fViewer.getInput();
+ for (ITmfFilterTreeNode node : root.getChildren()) {
+ if (node.equals(filter)) {
+ return;
+ }
+ }
+ root.addChild(filter);
+ fViewer.setInput(root);
+ }
+
+ /**
* Refresh the tree widget
*/
public void refresh() {