Commit 8931bc98 authored by Florian Hölzl's avatar Florian Hölzl

AF3: data state editor resets error message when editing was canceled.

Issue-Ref: 3961
Issue-Url: https://af3-developer.fortiss.org/issues/3961Signed-off-by: Florian Hölzl's avatarFlorian Hoelzl <hoelzl@fortiss.org>
parent f22acc6c
DataStateFXEditor.java e64fcec84ea83e5ba99e48a6825063471e9ea70d GREEN
DataStateFXEditorBase.java 9e9ad35d14ab1d7ca82be8685dab56a4248105cd YELLOW
DataStateFXEditorBase.java 83655742fdcfdade31eabd7deafa88862f28ba22 YELLOW
DataStateFXEditorBinding.java 46ab36b197a6fca102a5e2d75aa24b1fbba26b89 GREEN
DataStateFXEditorContentProvider.java 324cd24e2219ba2cf360b0f82e3628ca1b5dabba GREEN
DataStateFXEditorUIProvider.java 4993d4a6685b7738dd28a7a55177ab43fe81fc53 GREEN
......
......@@ -43,6 +43,7 @@ import javafx.scene.Parent;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox;
......@@ -89,7 +90,7 @@ public abstract class DataStateFXEditorBase<T extends IDataStateVariableProvider
String text) {
String message = DataStateFXEditorBase.DESCRIPTION;
ImageView icon = null;
if(colIndex == 1) {
if(event.getCode() != KeyCode.ESCAPE && colIndex == 1) {
StringToTypeValidator validator = new StringToTypeValidator(item);
IStatus status = validator.validate(text);
if(!status.isOK()) {
......@@ -100,6 +101,14 @@ public abstract class DataStateFXEditorBase<T extends IDataStateVariableProvider
}
descriptionError.setText(message);
descriptionError.setGraphic(icon);
event.consume();
}
/** {@inheritDoc} */
@Override
public void validateOnCancelEdit(int colIndex, EObject item) {
descriptionError.setText(DataStateFXEditorBase.DESCRIPTION);
descriptionError.setGraphic(null);
}
};
......
Markdown is supported
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