/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
*
* @author Bernd Hufmann
*/
-abstract public class ChangeChannelStateHandler extends BaseControlViewHandler {
+public abstract class ChangeChannelStateHandler extends BaseControlViewHandler {
// ------------------------------------------------------------------------
// Attributes
/**
* @return the new state to set
*/
- abstract protected TraceEnablement getNewState();
+ protected abstract TraceEnablement getNewState();
// ------------------------------------------------------------------------
// Operations
* @param domain - the domain of the channels.
* @param channelNames - a list of channel names
* @param monitor - a progress monitor
- * @throws ExecutionException
+ * @throws ExecutionException If the command fails
*/
- abstract protected void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException;
+ protected abstract void changeState(TraceDomainComponent domain, List<String> channelNames, IProgressMonitor monitor) throws ExecutionException;
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
}
// In all cases notify listeners
- session.fireComponentChanged(session);
+ if (session != null) {
+ session.fireComponentChanged(session);
+ }
if (error != null) {
return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TraceControl_ChangeChannelStateFailure, error);
return null;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- */
@Override
public boolean isEnabled() {
/**
* Class containing parameter for the command execution.
*/
- static protected class Parameter {
+ protected static class Parameter {
/**
* Kernel domain component reference.
*/
- final protected TraceDomainComponent fKernelDomain;
+ protected final TraceDomainComponent fKernelDomain;
/**
* UST domain component reference.
*/
- final protected TraceDomainComponent fUstDomain;
+ protected final TraceDomainComponent fUstDomain;
/**
* The list of kernel channel components the command is to be executed on.
*/
- final protected List<TraceChannelComponent> fKernelChannels;
+ protected final List<TraceChannelComponent> fKernelChannels;
/**
* The list of UST channel components the command is to be executed on.
*/
- final protected List<TraceChannelComponent> fUstChannels;
+ protected final List<TraceChannelComponent> fUstChannels;
/**
* Constructor