Commit 78e7c0d1 authored by Simon Barner's avatar Simon Barner

Merge branch 'master' of https://git.fortiss.org/af3/af3.git into 4065

parents 915568cf 2b764705
AllocationTableEditor.java f6f1c153cb555b7cf5b42fec63fce7ae217517f6 GREEN
AllocationTableEditor.java 5a0d0a2f5318f91725c902e934c7409bdd73b4bd GREEN
ArchitectureParameterEditorBase.java c9e9a721f5b8aee62c39ae3307c9ad32a78bce4a GREEN
ArchitectureParameterTableEditorBase.java 1bf2f9273e4bbecc779cedcbce2d4742db0eb32c GREEN
ModelListenerEditorBase.java f8970c5917a9a4e71d86f739a60a21bcd10f2d93 GREEN
......
......@@ -25,10 +25,11 @@ import static org.eclipse.jface.dialogs.MessageDialog.openConfirm;
import static org.fortiss.af3.allocation.utils.AllocationUtils.checkAllocationEntryType;
import static org.fortiss.af3.allocation.utils.AllocationUtils.getAllocationTableType;
import static org.fortiss.af3.allocation.utils.AllocationUtils.isAllocated;
import static org.fortiss.tooling.common.util.LambdaUtils.asStream;
import static org.fortiss.tooling.common.util.LambdaUtils.filterList;
import static org.fortiss.tooling.common.util.LambdaUtils.getFirst;
import static org.fortiss.tooling.common.util.LambdaUtils.isAssignableFromAny;
import static org.fortiss.tooling.kernel.ui.util.KernelUIUtils.getName;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getEClassForClass;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
......@@ -247,23 +248,23 @@ public abstract class AllocationTableEditor<T extends AllocationTable>
return as.getTargetModelTypes(allocationTableType);
}
/** Returns {@link #sourceEntityType}. */
/** Returns the currently selected {@link #sourceEntityType}. */
public Class<? extends IModelElement> getSourceEntityType() {
return sourceEntityType;
}
/** Sets {@link #sourceEntityType}. */
/** Sets the currently selected {@link #sourceEntityType}. */
private void setSourceEntityType(Class<? extends IModelElement> sourceEntityType) {
this.sourceEntityType = sourceEntityType;
sourceViewModelElements = null;
}
/** Returns {@link #targetEntityType}. */
/** Returns the currently selected {@link #targetEntityType}. */
public Class<? extends IModelElement> getTargetEntityType() {
return targetEntityType;
}
/** Sets {@link #targetEntityType}. */
/** Sets the currently selected {@link #targetEntityType}. */
private void setTargetEntityType(Class<? extends IModelElement> targetEntityType) {
this.targetEntityType = targetEntityType;
targetViewModelElements = null;
......@@ -910,28 +911,32 @@ public abstract class AllocationTableEditor<T extends AllocationTable>
}
/** Determines the list of model elements offered for a given {@code modelView}. */
private List<? extends IModelElement> getModelViewElements(IProjectRootElement modelView,
Class<? extends IModelElement> entityType, ViewElementFilter elementFilter) {
@SuppressWarnings({"unchecked", "rawtypes"})
private <S extends IModelElement> List<S> getModelViewElements(IProjectRootElement modelView,
Class<? extends IModelElement> selectedEntityType,
Collection<Class<? extends IModelElement>> entityTypes,
ViewElementFilter elementFilter) {
if(modelView == null || entityType == null) {
if(modelView == null || selectedEntityType == null) {
return emptyList();
}
Stream<IModelElement> modelElements = asStream(modelView.eAllContents())
.filter(entityType::isInstance).map(entityType::cast);
if(elementFilter != null) {
modelElements = modelElements.filter(elementFilter);
}
return modelElements.collect(toList());
Collection<S> modelElements = getChildrenWithType(modelView, (Class<S>)selectedEntityType,
(Collection<Class<? extends S>>)(Collection)entityTypes);
return filterList(modelElements,
elementFilter != null ? (Predicate)elementFilter : e -> true);
}
/**
* Determines the list of source model elements offered in this {@link AllocationTableEditor}.
*/
public List<? extends IModelElement> getSourceViewModelElements() {
public <S extends IModelElement> List<? extends IModelElement> getSourceViewModelElements() {
if(sourceViewModelElements == null) {
sourceViewModelElements = getModelViewElements(getEditedObject().getSourceView(),
getSourceEntityType(), sourceViewElementFilter);
IAllocationService as = IAllocationService.getInstance();
sourceViewModelElements =
getModelViewElements(getEditedObject().getSourceView(), getSourceEntityType(),
as.getSourceEntityTypes(allocationEntryType), sourceViewElementFilter);
}
return sourceViewModelElements;
}
......@@ -941,8 +946,10 @@ public abstract class AllocationTableEditor<T extends AllocationTable>
*/
public List<? extends IModelElement> getTargetViewModelElements() {
// if(targetViewModelElements == null) {
targetViewModelElements = getModelViewElements(getEditedObject().getTargetView(),
getTargetEntityType(), targetViewElementFilter);
IAllocationService as = IAllocationService.getInstance();
targetViewModelElements =
getModelViewElements(getEditedObject().getTargetView(), getTargetEntityType(),
as.getTargetEntityTypes(allocationEntryType), targetViewElementFilter);
// }
return targetViewModelElements;
}
......
AllocationModelElementFactory.java 9aba183708290c741ebbbe2897bbfcc51ea33fb6 GREEN
AllocationUtils.java ad2c5fd704b4b72c38e2c52c9c88f22a10d47eec GREEN
AllocationUtils.java 1509b817054cd7835a6294ee74bd6daf446a6811 GREEN
......@@ -20,6 +20,7 @@ import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import static org.eclipse.emf.ecore.util.EcoreUtil.create;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationEntry;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationTableCollection;
import static org.fortiss.tooling.base.utils.AnnotationUtils.instantiateAnnotationsRecursive;
import static org.fortiss.tooling.common.util.LambdaUtils.asStream;
import static org.fortiss.tooling.common.util.LambdaUtils.getFirst;
import static org.fortiss.tooling.common.util.LambdaUtils.isAssignableFromAny;
......@@ -763,6 +764,18 @@ public class AllocationUtils {
return null;
}
/**
* Initializes any {@link AnnotationEntry} for a {@link ParameterEntry}.
*/
private static void addAnnotationEntry(AllocationTable parameterTable,
Class<? extends ParameterEntry> parameterEntryType, IModelElement sourceElement,
IModelElement targetElement) {
ParameterEntry parameterEntry = getAllocationEntry(parameterTable, parameterEntryType,
sourceElement, targetElement);
instantiateAnnotationsRecursive(parameterEntry);
fixMissingIDs(parameterEntry, parameterTable);
}
/**
* Sets the value of a given {@link ParameterEntry} based on the provided {@code value}.
*/
......@@ -773,6 +786,7 @@ public class AllocationUtils {
if(!isAllocated(parameterTable, parameterEntryType, sourceElement, targetElement)) {
addAllocationEntry(parameterTable, parameterEntryType, sourceElement, targetElement);
addAnnotationEntry(parameterTable, parameterEntryType, sourceElement, targetElement);
}
if(isAllocated(parameterTable, parameterEntryType, sourceElement, targetElement)) {
......
ComponentArchitectureTransformationMenuBase.java 22b6e8af5218780335c1ff938fc05140016cae21 GREEN
ComponentArchitectureTransformationMenuBase.java e7149140c7489f74c63e7c140b9485868589b9e0 GREEN
......@@ -15,6 +15,7 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.commands;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.eclipse.jface.dialogs.MessageDialog.openConfirm;
import static org.eclipse.swt.widgets.Display.getCurrent;
......@@ -22,6 +23,7 @@ import static org.fortiss.tooling.kernel.service.IElementCompositorService.getIn
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.ArrayList;
import java.util.List;
......@@ -32,6 +34,7 @@ import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.resource.ImageDescriptor;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.component.utils.IComponentArchitectureTransformation;
import org.fortiss.af3.project.model.FileProject;
......@@ -42,7 +45,7 @@ import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuMultiSelectionContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
/**
......@@ -52,7 +55,7 @@ import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
* @author barner
*/
public abstract class ComponentArchitectureTransformationMenuBase<A extends IProjectRootElement & IHierarchicElement, AE extends AllocationTable>
implements IContextMenuContributor {
implements IContextMenuMultiSelectionContributor {
/**
* Transformer used to synthesize derived architecture from given {@link ComponentArchitecture}.
......@@ -60,7 +63,7 @@ public abstract class ComponentArchitectureTransformationMenuBase<A extends IPro
private IComponentArchitectureTransformation<A> compTrans;
/**
* Type of {@link AllocationTable} specialization used to define allocation betweeen given
* Type of {@link AllocationTable} specialization used to define allocation between given
* {@link ComponentArchitecture} and derived architecture.
*/
private Class<AE> entityAllocationTableType;
......@@ -87,13 +90,18 @@ public abstract class ComponentArchitectureTransformationMenuBase<A extends IPro
/** {@link Action} to execute automatic layout. */
protected class LaunchTransformComponentArchitectureAction extends Action {
/** {@link ComponentArchitecture} selected by user */
/** {@link ComponentArchitecture} selected by user. */
private final ComponentArchitecture ca;
/** {@link Component}s selected by user (may be empty). */
private final List<Component> comps;
/** Constructor. */
public LaunchTransformComponentArchitectureAction(ComponentArchitecture ca) {
public LaunchTransformComponentArchitectureAction(ComponentArchitecture ca,
List<Component> comps) {
super(getMenuLabel(), getActionIcon());
this.ca = ca;
this.comps = comps;
}
/** {@inheritDoc} */
......@@ -114,7 +122,7 @@ public abstract class ComponentArchitectureTransformationMenuBase<A extends IPro
}
}
IHierarchicElement arch = compTrans.transform(ca.getTopComponent(), null);
IHierarchicElement arch = compTrans.transform(ca.getTopComponent(), comps, null);
IAutoLayouter al = new KielerAutoLayouter();
cs.compose(fileProject, arch, null);
al.performAutoLayout(arch);
......@@ -140,19 +148,43 @@ public abstract class ComponentArchitectureTransformationMenuBase<A extends IPro
/** {@inheritDoc} */
@Override
public List<IContributionItem> getContributedItems(EObject selection,
public List<IContributionItem> getContributedItems(List<EObject> selection,
ContextMenuContextProvider contextProvider) {
if(!(selection instanceof ComponentArchitecture)) {
if(selection == null) {
return emptyList();
}
// We expect exactly one CompnonentArchitecture, and a list of Components (may be empty)
List<ComponentArchitecture> cas = pickInstanceOf(ComponentArchitecture.class, selection);
List<Component> comps = pickInstanceOf(Component.class, selection);
if(cas.size() != 1 || comps.size() != selection.size() - 1) {
return emptyList();
}
ComponentArchitecture ca = (ComponentArchitecture)selection;
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
contributionItems.add(
new ActionContributionItem(new LaunchTransformComponentArchitectureAction(ca)));
// Above check ensures that there is exactly one ComponentArchitecture
ComponentArchitecture ca = cas.get(0);
return contributionItems;
for(Component c : comps) {
for(EObject obj = c.eContainer(); obj != null; obj = obj.eContainer()) {
// Ensure that all selected Components are in the selected ComponentArchitecture
// and that selection of Components does not contain ancestors
if(obj instanceof ComponentArchitecture && obj != ca || comps.contains(obj)) {
return emptyList();
}
}
}
LaunchTransformComponentArchitectureAction action =
new LaunchTransformComponentArchitectureAction(ca, comps);
return asList(new ActionContributionItem(action));
}
/** {@inheritDoc} */
@Override
public List<IContributionItem> getContributedItems(EObject selection,
ContextMenuContextProvider contextProvider) {
return getContributedItems(asList(selection), contextProvider);
}
/** {@inheritDoc} */
......
BehaviorModelElementFactory.java 5be68f9a2ae4fad663d6fb20f6c5c7b12c0647ab GREEN
ComponentArchitectureTransformationBase.java da3a674974ee3304af109357e674ab7d6e0dde86 GREEN
ComponentArchitectureTransformationBase.java b7e06dbfbb01d2f1d84b53613e03edcfa6d8a1c6 GREEN
ComponentArchitectureUtils.java 8a894320e5aa34ea2078601ca47ccabdd082d544 GREEN
ComponentModelElementFactory.java 7d73764f4ebc3a45bcd2833c68a06213109784a0 GREEN
ComponentProgramUtils.java 71faad6256159ee2d59843fcde83ac6995dff0fe GREEN
ComponentUtils.java 9d94c0f184585d52d9ea31433b93ee399fc3cfc8 GREEN
GeneratorModelElementFactory.java 7fdb75341336fe579d4338a53c99df2f091c2b09 GREEN
IComponentArchitectureTransformation.java da70307771248f1d95e2fcd68e86fd68327f9df0 GREEN
IComponentArchitectureTransformation.java e619dd8404321b5bc39d00c05307a8c78c04deda GREEN
SimulationUtils.java a28590d89ed92d862bf7b657b9dfc4784545e36a GREEN
......@@ -15,16 +15,16 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.utils;
import static java.util.stream.Collectors.toList;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationTableCollection;
import static org.fortiss.af3.allocation.utils.AllocationUtils.addAllocationEntry;
import static org.fortiss.af3.component.utils.ComponentArchitectureUtils.isAtomicComponent;
import static org.fortiss.af3.component.utils.ComponentUtils.getAllSubComponentsRecursively;
import static org.fortiss.tooling.base.utils.AnnotationUtils.instantiateAnnotationsRecursive;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import static org.fortiss.tooling.kernel.utils.UniqueIDUtils.fixMissingIDs;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.EList;
......@@ -78,22 +78,30 @@ public abstract class ComponentArchitectureTransformationBase<A extends IHierarc
}
/**
* Predicate if the given {@link Component} should be transformed into an entity of the
* generated architecture. In case the {@link Component} is not atomic, all atomic
* {@link Component}s contained by it will be allocated to the respective architecture entity.
* Determine {@link Component}s to be represented by entities of the generated architecture:
* leaf components (e.g., selected by the user), or atomic components (in case for a given
* subtree no {@link Component} has been provided).
*/
protected boolean isEntityComponent(Component component) {
return isAtomicComponent(component);
private void searchComponents(Component component, List<Component> leafComponents,
List<Component> result) {
if(leafComponents.contains(component) || isAtomicComponent(component)) {
result.add(component);
return;
}
for(Component childComponent : pickInstanceOf(Component.class, component.eContents())) {
searchComponents(childComponent, leafComponents, result);
}
}
/** {@inheritDoc} */
@Override
public final A transform(Component topLevelComponent, AllocationTableCollection atc) {
public final A transform(Component topLevelComponent, List<Component> leafComponents,
AllocationTableCollection atc) {
A arch = createArchitecture(topLevelComponent);
// Determine components to be represented by entities of the generated architecture
List<Component> components = (getAllSubComponentsRecursively(topLevelComponent)).stream()
.filter(c -> isEntityComponent(c)).collect(toList());
List<Component> components = new ArrayList<>();
searchComponents(topLevelComponent, leafComponents, components);
ComponentArchitecture componentArchitecture =
getParentElement(topLevelComponent, ComponentArchitecture.class, false);
......@@ -140,14 +148,14 @@ public abstract class ComponentArchitectureTransformationBase<A extends IHierarc
// An input port can only have one incoming channel
Channel channel = inputPort.getIncomingChannels().get(0);
Component sourceComp = channel.getSource().getComponent();
while(!isAtomicComponent(sourceComp)) {
while(!components.contains(sourceComp)) {
EList<Channel> incomingChannels = channel.getSource().getIncomingChannels();
if(incomingChannels.isEmpty()) {
// Ignore: there is no connection in the architecture to be created.
sourceComp = null;
break;
}
// an input port can only have one incoming channel
// An input port can only have one incoming channel
channel = incomingChannels.get(0);
sourceComp = channel.getSource().getComponent();
}
......
......@@ -15,6 +15,9 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.utils;
import java.util.List;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.allocation.model.AllocationTableCollection;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
......@@ -29,7 +32,19 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
public interface IComponentArchitectureTransformation<A extends IHierarchicElement & IProjectRootElement> {
/**
* Transforms the atomic children of the given {@link Component} into a derived architecture.
* Transforms the selected children of the given {@link Component} into a derived architecture.
*
* @param topLevelComponent
* Root of {@link ComponentArchitecture} to be transformed.
* @param leafComponents
* {@link Component}s to be considered as leaves for transformation. Will be
* complemented with atomic {@link Component}s if needed.
* @param atc
* {@link AllocationTableCollection} in which {@link AllocationTable} between
* original {@link ComponentArchitecture} and the generated architecture is stored.
*
* @return Architecture derived from provided {@link ComponentArchitecture}.
*/
public abstract A transform(Component topLevelComponent, AllocationTableCollection atc);
public abstract A transform(Component topLevelComponent, List<Component> leafComponents,
AllocationTableCollection atc);
}
ButtonColumnLabelProvider.java 084b877ac2db59c79aa4852240c53795c1f7b72b GREEN
ButtonColumnLabelProvider.java d17107e5346a869d9e303c751f3f8c8789f80180 GREEN
ExportButtonColumnLabelProvider.java 340fea483d190986c39bc039d889f246b7300ced GREEN
SelectionButtonColumnLabelProvider.java e7c4030d78622243fb851679a1cb8b444cbf0815 GREEN
TableComposite.java 0eeba7ccb95b7cfaabf01033c9f0ac44db81f70a GREEN
......
......@@ -46,6 +46,7 @@ import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.exploration.model.IExplorationConstraint;
import org.fortiss.af3.exploration.model.SuperSetMap;
import org.fortiss.af3.exploration.model.project.DSE;
import org.fortiss.af3.exploration.model.project.ModelSnapshot;
import org.fortiss.af3.exploration.model.project.ProcessStep;
import org.fortiss.af3.exploration.model.project.SolutionSelectionStep;
import org.fortiss.af3.exploration.model.project.SystemConstraintSet;
......@@ -178,10 +179,12 @@ abstract class ButtonColumnLabelProvider extends ColumnLabelProvider {
Optional<SuperSet<TaskToExecutionUnitAllocationEntry>> ta2HwSet = Optional.of(
selectedSolution.getSolutionModel(TaskToExecutionUnitAllocationEntry.class));
SuperSet<Route> routeSet = solStep.getSuperSetMap().get(Route.class);
TimingSpecification timingSpec =
(TimingSpecification)getFirst(solStep.getModelSnapshots(),
ms -> ms.getRootElement() instanceof TimingSpecification).get()
.getRootElement();
ModelSnapshot modelSnapshot = getFirst(solStep.getModelSnapshots(),
ms -> ms.getRootElement() instanceof TimingSpecification).orElse(null);
if(modelSnapshot == null) {
return;
}
TimingSpecification timingSpec = (TimingSpecification)modelSnapshot.getRootElement();
Collection<IModelElement> entityContainments = new ArrayList<>();
SuperSetMap schedSuperSets = constructSchedulableEntities(ta2HwSet, routeSet,
Optional.empty(), timingSpec, entityContainments);
......
......@@ -5,4 +5,4 @@ FileWriterUtil.java 4a95559f571d41fa44e6236fc055ab5baac7c384 GREEN
GraphGenerationUtilities.java e637fd6a38339c60a6a7ac5af116db304266d345 GREEN
GraphMetricUtils.java 99a398d4ff9b15b3eeb35748e32aa34a9b197f07 GREEN
GraphUtils.java 4d59affe2bab3113f48d1a827ad0bc9599b3439e GREEN
ProjectUtils.java 0228e21e2875a9f7a472bb6ebacdf0574e9c7c10 GREEN
ProjectUtils.java e7dec53ba3e0ad29e7f17fc843ec15fc978f445a GREEN
......@@ -16,6 +16,7 @@
package org.fortiss.af3.exploration.testgenerator.util;
import static java.io.File.separator;
import static java.util.Collections.emptyList;
import static org.eclipse.emf.common.util.URI.createURI;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationTableCollection;
import static org.fortiss.af3.project.AF3Project.AF3_PRJ_SUFFIX;
......@@ -112,8 +113,8 @@ public class ProjectUtils {
AllocationTableCollection allocationTableCollection) {
ComponentToTaskArchitectureTransformation componentToTaskTranformator =
new ComponentToTaskArchitectureTransformation();
TaskArchitecture taskArchitecture = componentToTaskTranformator
.transform(componentArchitecture.getTopComponent(), allocationTableCollection);
TaskArchitecture taskArchitecture = componentToTaskTranformator.transform(
componentArchitecture.getTopComponent(), emptyList(), allocationTableCollection);
return taskArchitecture;
}
......
RequirementsOverviewFXEditor.java 61a0faa7d5dbf525fae07a334494920932770094 GREEN
RequirementsOverviewFXEditor.java 2a9978e24ebe9c8a5183c5046c203f4b1a700ebb GREEN
RequirementsOverviewFXEditorBinding.java 3346106642d7dbd68e6328e4cbd33f6569c6f6ff GREEN
RequirementsOverviewFXEditorContentProvider.java 2f9b6874d6d7063ba2d3acd49f77f36052d75a5b GREEN
RequirementsOverviewFXEditorUIProvider.java a00fc594a841e120b14901fb0039664b5d1136ea GREEN
RequirementsOverviewFXEditorUIProvider.java 011f7ab962b2600da2e46f35907744d65a1257cf GREEN
......@@ -15,10 +15,15 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.mira.ui.editor.overview.fx;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import java.util.List;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.mira.model.RequirementStatus;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.IDoubleClickHandler;
......@@ -29,6 +34,7 @@ import org.fortiss.tooling.kernel.utils.KernelServiceBasedModelListenerBase;
import javafx.scene.Parent;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.layout.BorderPane;
/**
......@@ -54,7 +60,7 @@ public class RequirementsOverviewFXEditor<T extends IHierarchicElement> extends
/** {@inheritDoc} */
@Override
public void updateComplete(List<Notification> notifications) {
treeTableViewer.update();
treeTableViewer.getControl().refresh();
}
};
modelListener.register();
......@@ -62,7 +68,7 @@ public class RequirementsOverviewFXEditor<T extends IHierarchicElement> extends
RequirementsOverviewFXEditorContentProvider contentProvider =
new RequirementsOverviewFXEditorContentProvider();
RequirementsOverviewFXEditorUIProvider uiProvider =
new RequirementsOverviewFXEditorUIProvider(this);
new RequirementsOverviewFXEditorUIProvider();
filterWidget = new TextField();
filterWidget.textProperty().addListener((obs, oVal, nVal) -> {
......@@ -77,12 +83,23 @@ public class RequirementsOverviewFXEditor<T extends IHierarchicElement> extends
contentProvider, uiProvider);
treeTableViewer.addColumn("Type", 160);
treeTableViewer.addColumn("Status", 160);
treeTableViewer.addColumn("ID", 100);
TreeTableColumn<IHierarchicElement, String> statusColumn = treeTableViewer
.addComboColumn("Status", 160, e -> asList(RequirementStatus.values()).stream()
.map(r -> r.getName()).collect(toList()));
TreeTableColumn<IHierarchicElement, String> idColumn = treeTableViewer.addColumn("ID", 100);
treeTableViewer.addColumn("Title", 160);
treeTableViewer.addColumn("Description", 280);
treeTableViewer.addColumn("Comment", 250);
// If only a glossary is opened, there is no need for an ID and Status column
if(editedObject instanceof Glossary) {