/**********************************************************************
* Copyright (c) 2012 Ericsson
- *
+ *
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ *
+ * Contributors:
* Bernd Hufmann - Initial API and implementation
**********************************************************************/
package org.eclipse.linuxtools.internal.lttng2.ui.views.control.handlers;
import org.eclipse.ui.IWorkbenchPage;
/**
- * <b><u>AddContextOnEventHandler</u></b>
* <p>
* Command handler implementation to add contexts to a given event.
* </p>
+ *
+ * @author Bernd Hufmann
*/
public class AddContextOnEventHandler extends BaseAddContextHandler {
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
-
+
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
if (selection instanceof StructuredSelection) {
StructuredSelection structered = ((StructuredSelection) selection);
for (Iterator<?> iterator = structered.iterator(); iterator.hasNext();) {
- Object element = (Object) iterator.next();
+ Object element = iterator.next();
if (element instanceof TraceEventComponent) {
// Add only if corresponding TraceSessionComponents is inactive and not destroyed
- TraceEventComponent tmpEvent = (TraceEventComponent) element;
+ TraceEventComponent tmpEvent = (TraceEventComponent) element;
session = tmpEvent.getSession();
if(session.getSessionState() == TraceSessionState.INACTIVE && !session.isDestroyed()) {
event = tmpEvent;
}
}
}
-
+
boolean isEnabled = (event != null);
fLock.lock();
try {