Skip to content
Snippets Groups Projects
Commit 5324f91d authored by nullsub's avatar nullsub
Browse files

update constraint checker for all rules

parent d53424fa
No related branches found
No related tags found
No related merge requests found
...@@ -176,6 +176,9 @@ public class FRaMEDFeatureEditor extends EditorPart { ...@@ -176,6 +176,9 @@ public class FRaMEDFeatureEditor extends EditorPart {
* @param featureModel the feature model to instantiate the configuration with * @param featureModel the feature model to instantiate the configuration with
*/ */
private void loadConfiguration(Model rootModel, IFeatureModel featureModel) { private void loadConfiguration(Model rootModel, IFeatureModel featureModel) {
if(rootModel == null) {
return;
}
FRaMEDConfiguration framedConfiguration = rootModel.getFramedConfiguration(); FRaMEDConfiguration framedConfiguration = rootModel.getFramedConfiguration();
configuration = new Configuration(featureModel); configuration = new Configuration(featureModel);
configuration.getPropagator().update(); configuration.getPropagator().update();
...@@ -277,6 +280,8 @@ public class FRaMEDFeatureEditor extends EditorPart { ...@@ -277,6 +280,8 @@ public class FRaMEDFeatureEditor extends EditorPart {
* updates the labels text and color if the configuration is valid or not * updates the labels text and color if the configuration is valid or not
*/ */
private void updateInfoLabel() { private void updateInfoLabel() {
if(configuration == null)
return;
Boolean valid = configuration.isValid(); Boolean valid = configuration.isValid();
infoLabel.setText(valid ? "VALID Configuration" : "INVALID Configuration"); infoLabel.setText(valid ? "VALID Configuration" : "INVALID Configuration");
infoLabel.setForeground(valid ? COLOR_VALID_CONFIGURATION : COLOR_INVALID_CONFIGURATION); infoLabel.setForeground(valid ? COLOR_VALID_CONFIGURATION : COLOR_INVALID_CONFIGURATION);
...@@ -288,6 +293,8 @@ public class FRaMEDFeatureEditor extends EditorPart { ...@@ -288,6 +293,8 @@ public class FRaMEDFeatureEditor extends EditorPart {
private void updateTree() { private void updateTree() {
tree.removeAll(); tree.removeAll();
final TreeItem root = new TreeItem(tree, 0); final TreeItem root = new TreeItem(tree, 0);
if(configuration == null)
return;
final SelectableFeature rootFeature = configuration.getRoot(); final SelectableFeature rootFeature = configuration.getRoot();
root.setText(configuration.getRoot().getName()); root.setText(configuration.getRoot().getName());
root.setData(configuration.getRoot()); root.setData(configuration.getRoot());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment