<commit_before>package de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ui;

import java.util.List;

import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.jface.databinding.viewers.ViewersObservables;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;

import de.ptb.epics.eve.data.scandescription.AbstractBehavior;
import de.ptb.epics.eve.data.scandescription.Axis;
import de.ptb.epics.eve.data.scandescription.Channel;
import de.ptb.epics.eve.data.scandescription.PositionMode;
import de.ptb.epics.eve.data.scandescription.ScanModule;
import de.ptb.epics.eve.data.scandescription.ScanModuleTypes;
import de.ptb.epics.eve.data.scandescription.errors.IModelError;
import de.ptb.epics.eve.data.scandescription.updatenotification.ModelUpdateEvent;
import de.ptb.epics.eve.editor.handler.axeschannelsview.RemoveAxesDefaultHandler;
import de.ptb.epics.eve.editor.handler.axeschannelsview.RemoveChannelsDefaultHandler;
import de.ptb.epics.eve.editor.views.DelColumnEditingSupport;
import de.ptb.epics.eve.editor.views.ScanModuleTableDragSourceListener;
import de.ptb.epics.eve.editor.views.ScanModuleTableDropTargetListener;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ScanModuleSelectionProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.TriggerDelaySettleTimeModelToTargetConverter;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.TriggerDelaySettleTimeTargetToModelConverter;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.TriggerDelaySettleTimeTargetToModelValidator;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ValueCountTargetToModelConverter;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ValueCountTargetToModelValidator;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.AxesContentProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.MainAxisColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.MainAxisEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.PositionModeEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.StepfunctionEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.ValuesColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.ValuesEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.AcquisitionTypeEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.ChannelsContentProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.DeferredColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.DeferredEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.NormalizeEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.ParametersColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.ParametersEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.ui.AxesChannelsView;
import de.ptb.epics.eve.editor.views.axeschannelsview.ui.AxesChannelsViewComposite;
import de.ptb.epics.eve.util.ui.jface.viewercomparator.alphabetical.AlphabeticalTableViewerSorter;
import de.ptb.epics.eve.util.ui.jface.viewercomparator.alphabetical.AlphabeticalViewerComparator;
import de.ptb.epics.eve.util.ui.jface.viewercomparator.alphabetical.SortOrder;
import de.ptb.epics.eve.util.ui.swt.TextSelectAllFocusListener;
import de.ptb.epics.eve.util.ui.swt.TextSelectAllMouseListener;

/**
 * @author <NAME>
 * @since 1.34
 */
public class ClassicComposite extends AxesChannelsViewComposite {
	private static final int TABLE_MIN_HEIGHT = 150;
	
	private static final String MEMENTO_AXES_SASH_WEIGHT = "axesSashWeight";
	private static final String MEMENTO_CHANNELS_SASH_WEIGHT = "channelsSashWeight";
	private static final String MEMENTO_AXES_SORT_ORDER = "axesSortState";
	private static final String MEMENTO_CHANNELS_SORT_ORDER = "channelsSortState";
	
	private ScanModule scanModule;
	private TableViewer axesTable;
	private TableViewer channelsTable;
	
	private AlphabeticalTableViewerSorter axesTableSorter;
	private AlphabeticalTableViewerSorter channelsTableSorter;

	private SashForm sashForm;

	private AxesCAComposite axesCAComposite;
	
	private Text valueCountText;
	private Text triggerDelayText;
	private Text settleTimeText;
	private Button triggerConfirmAxisCheckBox;
	private Button triggerConfirmChannelCheckBox;

	private Binding valueCountBinding;
	private Binding triggerDelayBinding;
	private Binding settleTimeBinding;
	
	public ClassicComposite(AxesChannelsView parentView, Composite parent, int style) {
		super(parentView, parent, style);
		
		this.setLayout(new FillLayout());
		ScrolledComposite sc = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL);
		
		Composite topComposite = new Composite(sc, SWT.NONE);
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		gridLayout.marginWidth = 0;
		gridLayout.marginHeight = 0;
		topComposite.setLayout(gridLayout);
		sc.setExpandHorizontal(true);
		sc.setExpandVertical(true);
		sc.setContent(topComposite);
		
		this.createGeneralComposite(topComposite);
		
		sashForm = new SashForm(topComposite, SWT.VERTICAL);
		sashForm.SASH_WIDTH = 4;
		GridData gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		gridData.verticalAlignment = GridData.FILL;
		sashForm.setLayoutData(gridData);
		
		Composite axesComposite = new Composite(sashForm, SWT.BORDER);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		axesComposite.setLayout(gridLayout);
		
		axesCAComposite = new AxesCAComposite(axesComposite, SWT.NONE);
		gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		axesCAComposite.setLayoutData(gridData);
		
		Label axesLabel = new Label(axesComposite, SWT.NONE);
		axesLabel.setText("Motor Axes:");
		gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = SWT.LEFT;
		axesLabel.setLayoutData(gridData);
		this.createAxesTable(axesComposite);
		
		Composite channelsComposite = new Composite(sashForm, SWT.BORDER);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		channelsComposite.setLayout(gridLayout);
		Label channelsLabel = new Label(channelsComposite, SWT.NONE);
		channelsLabel.setText("Detector Channels:");
		gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = SWT.LEFT;
		channelsLabel.setLayoutData(gridData);
		this.createChannelsTable(channelsComposite);
		
		this.initDragAndDrop();
		
		sashForm.setWeights(new int[] {50, 50});
		
		sc.setMinSize(sashForm.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		
		this.bindValues();
	}
	
	private void createGeneralComposite(Composite parent) {
		Composite generalComposite = new Composite(parent, SWT.BORDER);
		GridData gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		generalComposite.setLayoutData(gridData);
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 3;
		gridLayout.horizontalSpacing = 15;
		generalComposite.setLayout(gridLayout);
		
		Composite valueCountComposite = new Composite(generalComposite, SWT.NONE);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		valueCountComposite.setLayout(gridLayout);
		Label valueCountLabel = new Label(valueCountComposite, SWT.NONE);
		valueCountLabel.setText("No of Measurements:");
		valueCountLabel.setToolTipText(
				"Number of Measurements taken for each motor position");
		this.valueCountText = new Text(valueCountComposite, SWT.BORDER);
		gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalIndent = 7;
		this.valueCountText.setLayoutData(gridData);
		this.valueCountText.addFocusListener(new TextSelectAllFocusListener(
				this.valueCountText));
		this.valueCountText.addMouseListener(new TextSelectAllMouseListener(
				this.valueCountText));
		this.valueCountText.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				valueCountBinding.updateModelToTarget();
			}
		});
		
		Composite triggerDelayComposite = new Composite(generalComposite, SWT.NONE);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		triggerDelayComposite.setLayout(gridLayout);
		Label triggerDelayLabel = new Label(triggerDelayComposite, SWT.NONE);
		triggerDelayLabel.setText("Trigger Delay (in s):");
		triggerDelayLabel.setToolTipText("delay in s before detectors are triggered");
		this.triggerDelayText = new Text(triggerDelayComposite, SWT.BORDER);
		gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalIndent = 7;
		this.triggerDelayText.setLayoutData(gridData);
		this.triggerDelayText.addFocusListener(new TextSelectAllFocusListener(
				this.triggerDelayText));
		this.triggerDelayText.addMouseListener(new TextSelectAllMouseListener(
				this.triggerDelayText));
		this.triggerDelayText.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				triggerDelayBinding.updateModelToTarget();
			}
		});
		
		Composite settleTimeComposite = new Composite(generalComposite, SWT.NONE);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		settleTimeComposite.setLayout(gridLayout);
		Label settleTimeLabel = new Label(settleTimeComposite, SWT.NONE);
		settleTimeLabel.setText("Settle Time (in s):");
		settleTimeLabel.setToolTipText(
				"delay time after first positioning in the scan module");
		this.settleTimeText = new Text(settleTimeComposite, SWT.BORDER);
		gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalIndent = 7;
		this.settleTimeText.setLayoutData(gridData);
		this.settleTimeText.addFocusListener(new TextSelectAllFocusListener(
				this.settleTimeText));
		this.settleTimeText.addMouseListener(new TextSelectAllMouseListener(
				this.settleTimeText));
		this.settleTimeText.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				settleTimeBinding.updateModelToTarget();
			}
		});
		
		Composite triggerComposite = new Composite(generalComposite, SWT.NONE);
		gridData = new GridData();
		gridData.horizontalSpan = 3;
		triggerComposite.setLayoutData(gridData);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 3;
		triggerComposite.setLayout(gridLayout);
		Label triggerLabel = new Label(triggerComposite, SWT.NONE);
		triggerLabel.setText("Manual Trigger:");
		this.triggerConfirmAxisCheckBox = new Button(triggerComposite, 
				SWT.CHECK);
		this.triggerConfirmAxisCheckBox.setText("Motors");
		this.triggerConfirmChannelCheckBox = new Button(triggerComposite, 
				SWT.CHECK);
		this.triggerConfirmChannelCheckBox.setText("Detectors");
	}
	
	private void createAxesTable(Composite parent) {
		this.axesTable = new TableViewer(parent, SWT.BORDER | SWT.MULTI);
		axesTable.getTable().setHeaderVisible(true);
		axesTable.getTable().setLinesVisible(true);
		GridData gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		gridData.verticalAlignment = GridData.FILL;
		gridData.minimumHeight = TABLE_MIN_HEIGHT;
		axesTable.getTable().setLayoutData(gridData);
		
		createAxesTableColumns(axesTable);
		
		axesTable.setContentProvider(new AxesContentProvider());

		axesTable.getTable().addFocusListener(new FocusAdapter() {
			@Override<commit_msg>#5305: increases horizontal spacing of trigger checkboxes<commit_after>package de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ui;

import java.util.List;

import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeansObservables;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.jface.databinding.viewers.ViewersObservables;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;

import de.ptb.epics.eve.data.scandescription.AbstractBehavior;
import de.ptb.epics.eve.data.scandescription.Axis;
import de.ptb.epics.eve.data.scandescription.Channel;
import de.ptb.epics.eve.data.scandescription.PositionMode;
import de.ptb.epics.eve.data.scandescription.ScanModule;
import de.ptb.epics.eve.data.scandescription.ScanModuleTypes;
import de.ptb.epics.eve.data.scandescription.errors.IModelError;
import de.ptb.epics.eve.data.scandescription.updatenotification.ModelUpdateEvent;
import de.ptb.epics.eve.editor.handler.axeschannelsview.RemoveAxesDefaultHandler;
import de.ptb.epics.eve.editor.handler.axeschannelsview.RemoveChannelsDefaultHandler;
import de.ptb.epics.eve.editor.views.DelColumnEditingSupport;
import de.ptb.epics.eve.editor.views.ScanModuleTableDragSourceListener;
import de.ptb.epics.eve.editor.views.ScanModuleTableDropTargetListener;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ScanModuleSelectionProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.TriggerDelaySettleTimeModelToTargetConverter;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.TriggerDelaySettleTimeTargetToModelConverter;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.TriggerDelaySettleTimeTargetToModelValidator;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ValueCountTargetToModelConverter;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.ValueCountTargetToModelValidator;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.AxesContentProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.MainAxisColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.MainAxisEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.PositionModeEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.StepfunctionEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.ValuesColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.axes.ValuesEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.AcquisitionTypeEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.ChannelsContentProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.DeferredColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.DeferredEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.NormalizeEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.ParametersColumnLabelProvider;
import de.ptb.epics.eve.editor.views.axeschannelsview.classiccomposite.channels.ParametersEditingSupport;
import de.ptb.epics.eve.editor.views.axeschannelsview.ui.AxesChannelsView;
import de.ptb.epics.eve.editor.views.axeschannelsview.ui.AxesChannelsViewComposite;
import de.ptb.epics.eve.util.ui.jface.viewercomparator.alphabetical.AlphabeticalTableViewerSorter;
import de.ptb.epics.eve.util.ui.jface.viewercomparator.alphabetical.AlphabeticalViewerComparator;
import de.ptb.epics.eve.util.ui.jface.viewercomparator.alphabetical.SortOrder;
import de.ptb.epics.eve.util.ui.swt.TextSelectAllFocusListener;
import de.ptb.epics.eve.util.ui.swt.TextSelectAllMouseListener;

/**
 * @author <NAME>
 * @since 1.34
 */
public class ClassicComposite extends AxesChannelsViewComposite {
	private static final int TABLE_MIN_HEIGHT = 150;
	
	private static final String MEMENTO_AXES_SASH_WEIGHT = "axesSashWeight";
	private static final String MEMENTO_CHANNELS_SASH_WEIGHT = "channelsSashWeight";
	private static final String MEMENTO_AXES_SORT_ORDER = "axesSortState";
	private static final String MEMENTO_CHANNELS_SORT_ORDER = "channelsSortState";
	
	private ScanModule scanModule;
	private TableViewer axesTable;
	private TableViewer channelsTable;
	
	private AlphabeticalTableViewerSorter axesTableSorter;
	private AlphabeticalTableViewerSorter channelsTableSorter;

	private SashForm sashForm;

	private AxesCAComposite axesCAComposite;
	
	private Text valueCountText;
	private Text triggerDelayText;
	private Text settleTimeText;
	private Button triggerConfirmAxisCheckBox;
	private Button triggerConfirmChannelCheckBox;

	private Binding valueCountBinding;
	private Binding triggerDelayBinding;
	private Binding settleTimeBinding;
	
	public ClassicComposite(AxesChannelsView parentView, Composite parent, int style) {
		super(parentView, parent, style);
		
		this.setLayout(new FillLayout());
		ScrolledComposite sc = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL);
		
		Composite topComposite = new Composite(sc, SWT.NONE);
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		gridLayout.marginWidth = 0;
		gridLayout.marginHeight = 0;
		topComposite.setLayout(gridLayout);
		sc.setExpandHorizontal(true);
		sc.setExpandVertical(true);
		sc.setContent(topComposite);
		
		this.createGeneralComposite(topComposite);
		
		sashForm = new SashForm(topComposite, SWT.VERTICAL);
		sashForm.SASH_WIDTH = 4;
		GridData gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		gridData.verticalAlignment = GridData.FILL;
		sashForm.setLayoutData(gridData);
		
		Composite axesComposite = new Composite(sashForm, SWT.BORDER);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		axesComposite.setLayout(gridLayout);
		
		axesCAComposite = new AxesCAComposite(axesComposite, SWT.NONE);
		gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		axesCAComposite.setLayoutData(gridData);
		
		Label axesLabel = new Label(axesComposite, SWT.NONE);
		axesLabel.setText("Motor Axes:");
		gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = SWT.LEFT;
		axesLabel.setLayoutData(gridData);
		this.createAxesTable(axesComposite);
		
		Composite channelsComposite = new Composite(sashForm, SWT.BORDER);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 1;
		channelsComposite.setLayout(gridLayout);
		Label channelsLabel = new Label(channelsComposite, SWT.NONE);
		channelsLabel.setText("Detector Channels:");
		gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = SWT.LEFT;
		channelsLabel.setLayoutData(gridData);
		this.createChannelsTable(channelsComposite);
		
		this.initDragAndDrop();
		
		sashForm.setWeights(new int[] {50, 50});
		
		sc.setMinSize(sashForm.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		
		this.bindValues();
	}
	
	private void createGeneralComposite(Composite parent) {
		Composite generalComposite = new Composite(parent, SWT.BORDER);
		GridData gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		generalComposite.setLayoutData(gridData);
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 3;
		gridLayout.horizontalSpacing = 15;
		generalComposite.setLayout(gridLayout);
		
		Composite valueCountComposite = new Composite(generalComposite, SWT.NONE);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		valueCountComposite.setLayout(gridLayout);
		Label valueCountLabel = new Label(valueCountComposite, SWT.NONE);
		valueCountLabel.setText("No of Measurements:");
		valueCountLabel.setToolTipText(
				"Number of Measurements taken for each motor position");
		this.valueCountText = new Text(valueCountComposite, SWT.BORDER);
		gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalIndent = 7;
		this.valueCountText.setLayoutData(gridData);
		this.valueCountText.addFocusListener(new TextSelectAllFocusListener(
				this.valueCountText));
		this.valueCountText.addMouseListener(new TextSelectAllMouseListener(
				this.valueCountText));
		this.valueCountText.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				valueCountBinding.updateModelToTarget();
			}
		});
		
		Composite triggerDelayComposite = new Composite(generalComposite, SWT.NONE);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		triggerDelayComposite.setLayout(gridLayout);
		Label triggerDelayLabel = new Label(triggerDelayComposite, SWT.NONE);
		triggerDelayLabel.setText("Trigger Delay (in s):");
		triggerDelayLabel.setToolTipText("delay in s before detectors are triggered");
		this.triggerDelayText = new Text(triggerDelayComposite, SWT.BORDER);
		gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalIndent = 7;
		this.triggerDelayText.setLayoutData(gridData);
		this.triggerDelayText.addFocusListener(new TextSelectAllFocusListener(
				this.triggerDelayText));
		this.triggerDelayText.addMouseListener(new TextSelectAllMouseListener(
				this.triggerDelayText));
		this.triggerDelayText.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				triggerDelayBinding.updateModelToTarget();
			}
		});
		
		Composite settleTimeComposite = new Composite(generalComposite, SWT.NONE);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		settleTimeComposite.setLayout(gridLayout);
		Label settleTimeLabel = new Label(settleTimeComposite, SWT.NONE);
		settleTimeLabel.setText("Settle Time (in s):");
		settleTimeLabel.setToolTipText(
				"delay time after first positioning in the scan module");
		this.settleTimeText = new Text(settleTimeComposite, SWT.BORDER);
		gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.horizontalIndent = 7;
		this.settleTimeText.setLayoutData(gridData);
		this.settleTimeText.addFocusListener(new TextSelectAllFocusListener(
				this.settleTimeText));
		this.settleTimeText.addMouseListener(new TextSelectAllMouseListener(
				this.settleTimeText));
		this.settleTimeText.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				settleTimeBinding.updateModelToTarget();
			}
		});
		
		Composite triggerComposite = new Composite(generalComposite, SWT.NONE);
		gridData = new GridData();
		gridData.horizontalSpan = 3;
		triggerComposite.setLayoutData(gridData);
		gridLayout = new GridLayout();
		gridLayout.numColumns = 3;
		gridLayout.horizontalSpacing = 20;
		triggerComposite.setLayout(gridLayout);
		Label triggerLabel = new Label(triggerComposite, SWT.NONE);
		triggerLabel.setText("Manual Trigger:");
		this.triggerConfirmAxisCheckBox = new Button(triggerComposite, 
				SWT.CHECK);
		this.triggerConfirmAxisCheckBox.setText("Motors");
		this.triggerConfirmChannelCheckBox = new Button(triggerComposite, 
				SWT.CHECK);
		this.triggerConfirmChannelCheckBox.setText("Detectors");
	}
	
	private void createAxesTable(Composite parent) {
		this.axesTable = new TableViewer(parent, SWT.BORDER | SWT.MULTI);
		axesTable.getTable().setHeaderVisible(true);
		axesTable.getTable().setLinesVisible(true);
		GridData gridData = new GridData();
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		gridData.horizontalAlignment = GridData.FILL;
		gridData.verticalAlignment = GridData.FILL;
		gridData.minimumHeight = TABLE_MIN_HEIGHT;
		axesTable.getTable().setLayoutData(gridData);
		
		createAxesTableColumns(axesTable);
		
		axesTable.setContentProvider(new AxesContentProvider());

		axesTable.getTable().addFocusListener(new FocusAdapter() {
			@Override
{'fraction_non_alphanumeric': 0.09586854800681925, 'fraction_numerical': 0.0021763575029924917, 'mean_word_length': 6.4372808200701375, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5402191', 'n_tokens_mistral': 9328, 'n_tokens_neox': 8613, 'n_words': 1277}