1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.tracecompass
.lttng2
.control
.ui
.tests
.model
.component
;
14 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.ITraceControlComponent
;
15 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.ITraceControlComponentChangedListener
;
18 * The class can be used to validate the listener interface.
20 @SuppressWarnings("javadoc")
21 public class ListenerValidator
implements ITraceControlComponentChangedListener
{
23 // ------------------------------------------------------------------------
25 // ------------------------------------------------------------------------
26 private boolean fisAddedCalled
= false;
27 private boolean fisRemoveCalled
= false;
28 private boolean fisChangedCalled
= false;
30 private ITraceControlComponent fParent
= null;
31 private ITraceControlComponent fChild
= null;
32 private ITraceControlComponent fChangedComponent
= null;
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
37 public boolean isAddedCalled() {
38 return fisAddedCalled
;
41 public boolean isRemovedCalled() {
42 return fisRemoveCalled
;
45 public boolean isChangedCalled() {
46 return fisChangedCalled
;
49 public ITraceControlComponent
getSavedParent() {
53 public ITraceControlComponent
getSavedChild() {
57 public ITraceControlComponent
getSavedComponent() {
58 return fChangedComponent
;
61 // ------------------------------------------------------------------------
63 // ------------------------------------------------------------------------
64 public void initialize() {
65 fisAddedCalled
= false;
66 fisRemoveCalled
= false;
67 fisChangedCalled
= false;
70 fChangedComponent
= null;
74 public void componentAdded(ITraceControlComponent parent
, ITraceControlComponent component
) {
75 fisAddedCalled
= true;
81 public void componentRemoved(ITraceControlComponent parent
, ITraceControlComponent component
) {
82 fisRemoveCalled
= true;
88 public void componentChanged(ITraceControlComponent component
) {
89 fisChangedCalled
= true;
91 fChangedComponent
= component
;