Commit d6783018 authored by Johannes Eder's avatar Johannes Eder
Browse files

gui of reworked synthesis view base

parent 6f25618e
......@@ -20,7 +20,11 @@ package org.fortiss.af3.exploration.ui.perspective.generic;
import java.util.List;
import java.util.stream.Collectors;
import org.conqat.ide.commons.ui.selection.SelectionUtils;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
......@@ -161,8 +165,38 @@ public abstract class SynthesisViewBase2 extends DSEPerspectiveViewBase {
synthesisComposite.explorationTimeoutText.addVerifyListener(new TimeoutVerifyListener());
synthesisComposite.validityTimeoutText.addVerifyListener(new TimeoutVerifyListener());
synthesisComposite.explorationTimeoutText.addKeyListener(new TimeoutKeyListener());
synthesisComposite.constraintSetsTable
.addSelectionChangedListener(new ConstraintObjectiveRuleSetListener(
synthesisComposite.constraintsTree));
synthesisComposite.objectiveSetsTable
.addSelectionChangedListener(new ConstraintObjectiveRuleSetListener(
synthesisComposite.objectivesTree));
}
/**
* Listener for updating the constraints objectives in the lower part due to {@link RuleSet}
* selection in the upper part.
*/
private class ConstraintObjectiveRuleSetListener implements ISelectionChangedListener {
/** The {@link CheckboxTreeViewer} to be updated. */
private CheckboxTreeViewer checkboxTableViewer;
/** Constructor. */
public ConstraintObjectiveRuleSetListener(CheckboxTreeViewer checkboxTableViewer) {
this.checkboxTableViewer = checkboxTableViewer;
}
/** {@inheritDoc} */
@Override
public void selectionChanged(SelectionChangedEvent event) {
RuleSet explorationSpecificationSubSet =
SelectionUtils.checkAndPickFirst(event.getSelection(), RuleSet.class);
checkboxTableViewer.setCheckedElements(explorationSpecificationSubSet
.getExplorationTargets().toArray());
}
}
/** Listener verifying the text in the timeout text field. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment