/**********************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2014 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 monitor - a progress monitor
* @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 {
if (kernelDomain != null) {
session = (TraceSessionComponent)kernelDomain.getParent();
- List<String> channelNames = new ArrayList<String>();
+ List<String> channelNames = new ArrayList<>();
for (Iterator<TraceChannelComponent> iterator = kernelChannels.iterator(); iterator.hasNext();) {
// Enable all selected channels which are disabled
TraceChannelComponent channel = iterator.next();
session = (TraceSessionComponent)ustDomain.getParent();
}
- List<String> channelNames = new ArrayList<String>();
+ List<String> channelNames = new ArrayList<>();
for (Iterator<TraceChannelComponent> iterator = ustChannels.iterator(); iterator.hasNext();) {
// Enable all selected channels which are disabled
TraceChannelComponent channel = iterator.next();
return null;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- */
@Override
public boolean isEnabled() {
TraceDomainComponent kernelDomain = null;
TraceDomainComponent ustDomain = null;
- List<TraceChannelComponent> kernelChannels = new ArrayList<TraceChannelComponent>();
- List<TraceChannelComponent> ustChannels = new ArrayList<TraceChannelComponent>();
+ List<TraceChannelComponent> kernelChannels = new ArrayList<>();
+ List<TraceChannelComponent> ustChannels = new ArrayList<>();
// Check if one or more session are selected
ISelection selection = page.getSelection(ControlView.ID);
/**
* 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
public Parameter(TraceDomainComponent kernelDomain, TraceDomainComponent ustDomain, List<TraceChannelComponent> kernelChannels, List<TraceChannelComponent> ustChannels) {
fKernelDomain = kernelDomain;
fUstDomain = ustDomain;
- fKernelChannels = new ArrayList<TraceChannelComponent>();
+ fKernelChannels = new ArrayList<>();
fKernelChannels.addAll(kernelChannels);
- fUstChannels = new ArrayList<TraceChannelComponent>();
+ fUstChannels = new ArrayList<>();
fUstChannels.addAll(ustChannels);
}