// Get channel information from user
final ICreateChannelDialog dialog = new CreateChannelDialog(window.getShell(), fDomain);
- if (dialog.open() == Window.OK) {
-
- Job job = new Job(Messages.TraceControl_EnableChannelJob) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- String errorString = null;
-
- List<String> channelNames = new ArrayList<String>();
- channelNames.add(dialog.getChannelInfo().getName());
-
- try {
- fDomain.enableChannels(channelNames, dialog.getChannelInfo(), monitor);
- } catch (ExecutionException e) {
- if (errorString == null) {
- errorString = new String();
- }
- errorString += e.toString() + "\n"; //$NON-NLS-1$
- }
+ if (dialog.open() != Window.OK) {
+ return null;
+ }
+
+ Job job = new Job(Messages.TraceControl_ChangeChannelStateJob) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ String errorString = null;
- // get session configuration in all cases
- try {
- fDomain.getConfigurationFromNode(monitor);
- } catch (ExecutionException e) {
- if (errorString == null) {
- errorString = new String();
- }
- errorString += Messages.TraceControl_ListSessionFailure + ": " + e.toString(); //$NON-NLS-1$
+ List<String> channelNames = new ArrayList<String>();
+ channelNames.add(dialog.getChannelInfo().getName());
+
+ try {
+ fDomain.enableChannels(channelNames, dialog.getChannelInfo(), monitor);
+ } catch (ExecutionException e) {
+ if (errorString == null) {
+ errorString = new String();
}
+ errorString += e.toString() + "\n"; //$NON-NLS-1$
+ }
- if (errorString != null) {
- return new Status(Status.ERROR, LTTngUiPlugin.PLUGIN_ID, errorString);
+ // get session configuration in all cases
+ try {
+ fDomain.getConfigurationFromNode(monitor);
+ } catch (ExecutionException e) {
+ if (errorString == null) {
+ errorString = new String();
}
- return Status.OK_STATUS;
- }};
- job.setUser(true);
- job.schedule();
- }
+ errorString += Messages.TraceControl_ListSessionFailure + ": " + e.toString(); //$NON-NLS-1$
+ }
+
+ if (errorString != null) {
+ return new Status(Status.ERROR, LTTngUiPlugin.PLUGIN_ID, errorString);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+
+ job.setUser(true);
+ job.schedule();
+
return null;
}