~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/EnableEventOnSessionHandler.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 session 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 EnableEventOnSessionHandler extends BaseEnableEventHandler {
39
39
    // ------------------------------------------------------------------------
40
40
    // Attributes
41
41
    // ------------------------------------------------------------------------
42
 
    
 
42
 
43
43
    //-------------------------------------------------------------------------
44
44
    // Operations
45
45
    // ------------------------------------------------------------------------
79
79
        param.getSession().enableLogLevel(eventName, logLevelType, level, monitor);
80
80
    }
81
81
 
82
 
    
 
82
 
83
83
    /*
84
84
     * (non-Javadoc)
85
85
     * @see org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.BaseEnableEventHandler#getDomain(org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers.CommandParameter)
107
107
        if (selection instanceof StructuredSelection) {
108
108
            StructuredSelection structered = ((StructuredSelection) selection);
109
109
            for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
110
 
                Object element = (Object) iterator.next();
 
110
                Object element = iterator.next();
111
111
                if (element instanceof TraceSessionComponent) {
112
112
                    // Add only if corresponding TraceSessionComponents is inactive and not destroyed
113
 
                    TraceSessionComponent tmpSession = (TraceSessionComponent) element; 
 
113
                    TraceSessionComponent tmpSession = (TraceSessionComponent) element;
114
114
                    if(tmpSession.getSessionState() == TraceSessionState.INACTIVE && !tmpSession.isDestroyed()) {
115
115
                        session = tmpSession;
116
116
                    }