~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/handlers/EnableEventOnDomainHandler.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-13 21:43:22 UTC
  • mfrom: (1.2.1) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130513214322-6frgd9du1n0w2uo7
Tags: 1.2.1-1
* Team upload.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**********************************************************************
2
2
 * Copyright (c) 2012 Ericsson
3
 
 * 
 
3
 *
4
4
 * All rights reserved. This program and the accompanying materials are
5
5
 * made available under the terms of the Eclipse Public License v1.0 which
6
6
 * accompanies this distribution, and is available at
7
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 
 * 
9
 
 * Contributors: 
 
8
 *
 
9
 * Contributors:
10
10
 *   Bernd Hufmann - Initial API and implementation
11
11
 **********************************************************************/
12
12
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
31
31
 * Command handler implementation to enable events for a known domain and default channel 'channel0'
32
32
 * (which will be created if doesn't exist).
33
33
 * </p>
34
 
 * 
 
34
 *
35
35
 * @author Bernd Hufmann
36
36
 */
37
37
public class EnableEventOnDomainHandler extends BaseEnableEventHandler {
117
117
        if (selection instanceof StructuredSelection) {
118
118
            StructuredSelection structered = ((StructuredSelection) selection);
119
119
            for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
120
 
                Object element = (Object) iterator.next();
 
120
                Object element = iterator.next();
121
121
                if (element instanceof TraceDomainComponent) {
122
122
                    // Add only if corresponding TraceSessionComponents is inactive and not destroyed
123
 
                    TraceDomainComponent tmpDomain = (TraceDomainComponent) element; 
 
123
                    TraceDomainComponent tmpDomain = (TraceDomainComponent) element;
124
124
                    session = tmpDomain.getSession();
125
125
                    if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) {
126
126
                        domain = tmpDomain;
128
128
                }
129
129
            }
130
130
        }
131
 
        
 
131
 
132
132
        boolean isEnabled = (domain != null);
133
133
        fLock.lock();
134
134
        try {