Skip to content
Snippets Groups Projects
Commit 600d7ba2 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Annotations: Editing seams to work

Editing of Enumeration values seams to work. But wrong value is
displayed, still.

Issue-Ref: 4014
Issue-Url: https://af3-developer.fortiss.org/issues/4014


Signed-off-by: default avatarAndreas Bayha <bayha@fortiss.org>
parent 255f14e8
No related branches found
No related tags found
1 merge request!1254014
...@@ -51,7 +51,9 @@ import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeCon ...@@ -51,7 +51,9 @@ import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeCon
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableUIProviderBase; import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableUIProviderBase;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer; import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer;
import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase; import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.model.INamedCommentedElement; import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
...@@ -189,17 +191,6 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP ...@@ -189,17 +191,6 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
Callback<TreeTableColumn<AnnotationEntry, String>, TreeTableCell<AnnotationEntry, String>> comboCellFactory = Callback<TreeTableColumn<AnnotationEntry, String>, TreeTableCell<AnnotationEntry, String>> comboCellFactory =
ComboBoxTreeTableCell.forTreeTableColumn(items); ComboBoxTreeTableCell.forTreeTableColumn(items);
column.setCellFactory(comboCellFactory); column.setCellFactory(comboCellFactory);
// column.setCellFactory(
// new Callback<TreeTableColumn<AnnotationEntry, String>, TreeTableCell<AnnotationEntry,
// String>>() {
// @Override
// public TreeTableCell<AnnotationEntry, String>
// call(TreeTableColumn<AnnotationEntry, String> param) {
// Object userData = param.getUserData();
// return new ComboBoxTreeTableCell<AnnotationEntry, String>("Foobar",
// "Foo");
// }
// });
column.setEditable(true); column.setEditable(true);
column.setOnEditStart(event -> { column.setOnEditStart(event -> {
...@@ -218,21 +209,25 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP ...@@ -218,21 +209,25 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
EList<EEnumLiteral> allLiterals = ((EEnum)type).getELiterals(); EList<EEnumLiteral> allLiterals = ((EEnum)type).getELiterals();
items.clear(); items.clear();
items.addAll(allLiterals.stream().map(l -> l.getName()).collect(toList())); items.addAll(allLiterals.stream().map(l -> l.getLiteral()).collect(toList()));
} }
});
column.setOnEditCommit(event -> {
TreeItem<AnnotationEntry> treeItem = event.getRowValue();
AnnotationEntry rowEntry = treeItem.getValue();
// Collection<String> choices = annotationValueProvider.getCurrentInputChoice(); ITopLevelElement tle =
// if(choices == null || choices.isEmpty()) { IPersistencyService.getInstance().getTopLevelElementFor(selectedElement);
// IModelElement rowModelElement = rowEntry.getModelElement();
// annotationValueProvider.updateInputChoice(rowModelElement, annotationClass); tle.runAsCommand(() -> {
// try {
// choices = annotationValueProvider.getCurrentInputChoice(); rowEntry.setSpecificationValue(event.getNewValue(),
// } specification.getClass());
// } catch(Exception e1) {
// items.clear(); // TODO Auto-generated catch block
// items.addAll(choices); e1.printStackTrace();
// }
// System.out.println(event.toString()); });
}); });
} }
...@@ -263,6 +258,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP ...@@ -263,6 +258,7 @@ public class AnnotationViewFXController extends CompositeFXControllerBase<SplitP
} }
return ""; return "";
default: default:
// entry.getAnnotationValueProvider(colIdxAnnotationMap.get(column));
ColumnHandle<IAnnotatedSpecification> colHandle = ColumnHandle<IAnnotatedSpecification> colHandle =
colIdxAnnotationMap.get(column); colIdxAnnotationMap.get(column);
IAnnotationValueProvider<IAnnotatedSpecification> valProvider = IAnnotationValueProvider<IAnnotatedSpecification> valProvider =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment