catch up with branch daily
Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.xtext.menu/about.properties b/org.eclipse.osbp.xtext.menu/about.properties
index c69fdac..79b2157 100644
--- a/org.eclipse.osbp.xtext.menu/about.properties
+++ b/org.eclipse.osbp.xtext.menu/about.properties
@@ -16,6 +16,18 @@
featureName=org.eclipse.osbp.xtext.menu
################ blurb property ####################################
+aboutText=\
+Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0 \n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/\n\
+\n\
+SPDX-License-Identifier: EPL-2.0\n\
+\n\
+Contributors:\n\
+ Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation\n
+
featureText=\
Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\
All rights reserved. This program and the accompanying materials\n\
@@ -27,4 +39,19 @@
\n\
Contributors:\n\
Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation\n
+
+blurb=\
+Eclipse OSBP Software Factory\n\
+org.eclipse.osbp.xtext.menu - Version ${featureVersion}\n\
+\n\
+Copyright (c) 2012-2016 - Loetz GmbH&Co.KG \n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License 2.0 \n\
+which accompanies this distribution, and is available at\n\
+https://www.eclipse.org/legal/epl-2.0/\n\
+\n\
+SPDX-License-Identifier: EPL-2.0\n\
+\n\
+Contributors:\n\
+ Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation\n
################ end of blurb property ####################################
diff --git a/org.eclipse.osbp.xtext.menu/emf-gen/org/eclipse/osbp/xtext/menu/MenuDslPackage.java b/org.eclipse.osbp.xtext.menu/emf-gen/org/eclipse/osbp/xtext/menu/MenuDslPackage.java
index fdf3f6d..e09de66 100644
--- a/org.eclipse.osbp.xtext.menu/emf-gen/org/eclipse/osbp/xtext/menu/MenuDslPackage.java
+++ b/org.eclipse.osbp.xtext.menu/emf-gen/org/eclipse/osbp/xtext/menu/MenuDslPackage.java
@@ -207,7 +207,7 @@
* @generated
* @ordered
*/
- int MENU_PACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
+ int MENU_PACKAGE___ERESOLVE_PROXY__OBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
/**
* The number of operations of the '<em>Menu Package</em>' class.
@@ -352,7 +352,7 @@
* @generated
* @ordered
*/
- int MENU_CATEGORY___ERESOLVE_PROXY__INTERNALEOBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
+ int MENU_CATEGORY___ERESOLVE_PROXY__OBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
/**
* The number of operations of the '<em>Menu Category</em>' class.
@@ -425,7 +425,7 @@
* @generated
* @ordered
*/
- int MENU_TREE___ERESOLVE_PROXY__INTERNALEOBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
+ int MENU_TREE___ERESOLVE_PROXY__OBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
/**
* The number of operations of the '<em>Menu Tree</em>' class.
@@ -543,7 +543,7 @@
* @generated
* @ordered
*/
- int MENU_ENTRY___ERESOLVE_PROXY__INTERNALEOBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
+ int MENU_ENTRY___ERESOLVE_PROXY__OBJECT = OSBPTypesPackage.LPACKAGE___ERESOLVE_PROXY__INTERNALEOBJECT;
/**
* The number of operations of the '<em>Menu Entry</em>' class.
diff --git a/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.xtend b/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.xtend
index 7c494e1..ae14012 100644
--- a/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.xtend
+++ b/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.xtend
@@ -192,6 +192,8 @@
type.members += field
field = pkg.toField("menuComponent", _typeReferenceBuilder.typeRef(VerticalLayout))
type.members += field
+ field = pkg.toField("reloadModelText", _typeReferenceBuilder.typeRef(String))
+ type.members += field
field = pkg.toField("designerText", _typeReferenceBuilder.typeRef(String))
type.members += field
field = pkg.toField("designmodeText", _typeReferenceBuilder.typeRef(String))
@@ -213,6 +215,8 @@
annotations += _annotationTypesBuilder.annotationRef(Inject)]
type.members += field
+ field = pkg.toField("reloadModelHandler", _typeReferenceBuilder.typeRef(IMenuItemHandler))[annotations += _annotationTypesBuilder.annotationRef(Inject) annotations += _annotationTypesBuilder.annotationRef(Optional) annotations += _annotationTypesBuilder.annotationRef(Named, "ReloadModelHandler")]
+ type.members += field
field = pkg.toField("designModeHandler", _typeReferenceBuilder.typeRef(IMenuItemHandler))[annotations += _annotationTypesBuilder.annotationRef(Inject) annotations += _annotationTypesBuilder.annotationRef(Optional) annotations += _annotationTypesBuilder.annotationRef(Named, "DesignModeHandler")]
type.members += field
field = pkg.toField("designerUndoHandler", _typeReferenceBuilder.typeRef(IMenuItemHandler))[annotations += _annotationTypesBuilder.annotationRef(Inject) annotations += _annotationTypesBuilder.annotationRef(Optional) annotations += _annotationTypesBuilder.annotationRef(Named, "DesignerUndoHandler")]
@@ -361,6 +365,11 @@
MenuBar menubar = new MenuBar();
tabRoot.addComponent(menubar);
MenuItem designer = menubar.addItem(designerText, null, null);
+ menuItems.put(reloadModelHandler, designer.addItem(reloadModelText, null, new MenuBar.Command() {
+ public void menuSelected(MenuItem selectedItem) {
+ reloadModelHandler.execute(selectedItem);
+ }
+ }));
MenuItem mode = designer.addItem(designmodeText, null, new MenuBar.Command() {
public void menuSelected(MenuItem selectedItem) {
designModeHandler.execute(selectedItem);
@@ -552,6 +561,7 @@
for(UserMenuItem item: items.keySet()) {
item.setLocale(locale);
}
+ reloadModelText = dslMetadataService.translate(locale.toLanguageTag(),"reloadmodel");
designerText = dslMetadataService.translate(locale.toLanguageTag(),"designer");
designmodeText = dslMetadataService.translate(locale.toLanguageTag(),"designermode");
undoText = dslMetadataService.translate(locale.toLanguageTag(),"undo");
diff --git a/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.xtend b/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.xtend
index c8df6f8..5ee5873 100644
--- a/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.xtend
+++ b/org.eclipse.osbp.xtext.menu/src/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.xtend
@@ -18,6 +18,19 @@
*/
package org.eclipse.osbp.xtext.menu.validation
+
+import java.util.Collection
+import java.util.HashSet
+import java.util.LinkedHashSet
+import java.util.Set
+import org.eclipse.osbp.dsl.semantic.entity.LEntityAttribute
+import org.eclipse.osbp.xtext.datamartdsl.DatamartAttribute
+import org.eclipse.osbp.xtext.menu.MenuTree
+import org.eclipse.osbp.xtext.reportdsl.DatamartTableAttribute
+import org.eclipse.osbp.xtext.menu.MenuCategory
+import org.eclipse.osbp.xtext.menu.MenuDslPackage
+import org.eclipse.xtext.validation.Check
+
//import org.eclipse.xtext.validation.Check
/**
@@ -37,4 +50,29 @@
// INVALID_NAME)
// }
// }
+
+
+ def private Set<MenuTree> findDuplicates(Collection<MenuTree> list) {
+ var duplicates = new LinkedHashSet<MenuTree>();
+ var uniques = new HashSet<String>();
+
+ for(MenuTree tree : list) {
+ if(!uniques.add(tree.name)) {
+ duplicates.add(tree);
+ }
+ }
+ return duplicates;
+ }
+
+ @Check
+ def checkMenuTreeDuplicates(MenuCategory menu) {
+ var duplicates = menu.trees.findDuplicates
+ var idx = 0
+ for (menuTree : menu.trees) {
+ if (duplicates.contains(menuTree)) {
+ error('Duplicated menu tree names are not allowed in a menu category definition', MenuDslPackage.Literals.MENU_CATEGORY__TREES, idx)
+ }
+ idx++
+ }
+ }
}
diff --git a/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.java b/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.java
index bc51955..400eedb 100644
--- a/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.java
+++ b/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/jvmmodel/MenuDslJvmModelInferrer.java
@@ -324,38 +324,41 @@
field = this._jvmTypesBuilder.toField(pkg, "menuComponent", this._typeReferenceBuilder.typeRef(VerticalLayout.class));
EList<JvmMember> _members_10 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_10, field);
- field = this._jvmTypesBuilder.toField(pkg, "designerText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "reloadModelText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_11 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_11, field);
- field = this._jvmTypesBuilder.toField(pkg, "designmodeText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "designerText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_12 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_12, field);
- field = this._jvmTypesBuilder.toField(pkg, "undoText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "designmodeText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_13 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_13, field);
- field = this._jvmTypesBuilder.toField(pkg, "redoText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "undoText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_14 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_14, field);
- field = this._jvmTypesBuilder.toField(pkg, "newText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "redoText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_15 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_15, field);
- field = this._jvmTypesBuilder.toField(pkg, "changeText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "newText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_16 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_16, field);
- field = this._jvmTypesBuilder.toField(pkg, "exportText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "changeText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_17 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_17, field);
- field = this._jvmTypesBuilder.toField(pkg, "downloadText", this._typeReferenceBuilder.typeRef(String.class));
+ field = this._jvmTypesBuilder.toField(pkg, "exportText", this._typeReferenceBuilder.typeRef(String.class));
EList<JvmMember> _members_18 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_18, field);
+ field = this._jvmTypesBuilder.toField(pkg, "downloadText", this._typeReferenceBuilder.typeRef(String.class));
+ EList<JvmMember> _members_19 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_19, field);
final Procedure1<JvmField> _function_8 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
};
field = this._jvmTypesBuilder.toField(pkg, "context", this._typeReferenceBuilder.typeRef(IEclipseContext.class), _function_8);
- EList<JvmMember> _members_19 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_19, field);
+ EList<JvmMember> _members_20 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_20, field);
final Procedure1<JvmField> _function_9 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
@@ -364,13 +367,27 @@
JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Optional.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1);
EList<JvmAnnotationReference> _annotations_2 = it.getAnnotations();
+ JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "ReloadModelHandler");
+ this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
+ };
+ field = this._jvmTypesBuilder.toField(pkg, "reloadModelHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_9);
+ EList<JvmMember> _members_21 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_21, field);
+ final Procedure1<JvmField> _function_10 = (JvmField it) -> {
+ EList<JvmAnnotationReference> _annotations = it.getAnnotations();
+ JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
+ this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
+ EList<JvmAnnotationReference> _annotations_1 = it.getAnnotations();
+ JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Optional.class);
+ this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1);
+ EList<JvmAnnotationReference> _annotations_2 = it.getAnnotations();
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "DesignModeHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "designModeHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_9);
- EList<JvmMember> _members_20 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_20, field);
- final Procedure1<JvmField> _function_10 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "designModeHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_10);
+ EList<JvmMember> _members_22 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_22, field);
+ final Procedure1<JvmField> _function_11 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -381,10 +398,10 @@
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "DesignerUndoHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "designerUndoHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_10);
- EList<JvmMember> _members_21 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_21, field);
- final Procedure1<JvmField> _function_11 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "designerUndoHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_11);
+ EList<JvmMember> _members_23 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_23, field);
+ final Procedure1<JvmField> _function_12 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -395,10 +412,10 @@
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "DesignerRedoHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "designerRedoHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_11);
- EList<JvmMember> _members_22 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_22, field);
- final Procedure1<JvmField> _function_12 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "designerRedoHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_12);
+ EList<JvmMember> _members_24 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_24, field);
+ final Procedure1<JvmField> _function_13 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -409,10 +426,10 @@
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "NewPerspectiveHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "newPerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_12);
- EList<JvmMember> _members_23 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_23, field);
- final Procedure1<JvmField> _function_13 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "newPerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_13);
+ EList<JvmMember> _members_25 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_25, field);
+ final Procedure1<JvmField> _function_14 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -423,10 +440,10 @@
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "ChangePerspectiveHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "changePerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_13);
- EList<JvmMember> _members_24 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_24, field);
- final Procedure1<JvmField> _function_14 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "changePerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_14);
+ EList<JvmMember> _members_26 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_26, field);
+ final Procedure1<JvmField> _function_15 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -437,10 +454,10 @@
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "ExportPerspectiveHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "exportPerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_14);
- EList<JvmMember> _members_25 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_25, field);
- final Procedure1<JvmField> _function_15 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "exportPerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_15);
+ EList<JvmMember> _members_27 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_27, field);
+ final Procedure1<JvmField> _function_16 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -451,26 +468,26 @@
JvmAnnotationReference _annotationRef_2 = this._annotationTypesBuilder.annotationRef(Named.class, "DownloadPerspectiveHandler");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_2, _annotationRef_2);
};
- field = this._jvmTypesBuilder.toField(pkg, "downloadPerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_15);
- EList<JvmMember> _members_26 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_26, field);
- final Procedure1<JvmField> _function_16 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "downloadPerspectiveHandler", this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), _function_16);
+ EList<JvmMember> _members_28 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_28, field);
+ final Procedure1<JvmField> _function_17 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
};
- field = this._jvmTypesBuilder.toField(pkg, "blip", this._typeReferenceBuilder.typeRef(IBlipBPMFunctionProvider.class), _function_16);
- EList<JvmMember> _members_27 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_27, field);
- field = this._jvmTypesBuilder.toField(pkg, "tabs",
- this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(TabSheet.Tab.class), this._typeReferenceBuilder.typeRef(Pair.class, this._typeReferenceBuilder.typeRef(String.class), this._typeReferenceBuilder.typeRef(String.class))));
- EList<JvmMember> _members_28 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_28, field);
- field = this._jvmTypesBuilder.toField(pkg, "items",
- this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(UserMenuItem.class), this._typeReferenceBuilder.typeRef(String.class)));
+ field = this._jvmTypesBuilder.toField(pkg, "blip", this._typeReferenceBuilder.typeRef(IBlipBPMFunctionProvider.class), _function_17);
EList<JvmMember> _members_29 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_29, field);
- final Procedure1<JvmField> _function_17 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "tabs",
+ this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(TabSheet.Tab.class), this._typeReferenceBuilder.typeRef(Pair.class, this._typeReferenceBuilder.typeRef(String.class), this._typeReferenceBuilder.typeRef(String.class))));
+ EList<JvmMember> _members_30 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_30, field);
+ field = this._jvmTypesBuilder.toField(pkg, "items",
+ this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(UserMenuItem.class), this._typeReferenceBuilder.typeRef(String.class)));
+ EList<JvmMember> _members_31 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_31, field);
+ final Procedure1<JvmField> _function_18 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -478,10 +495,10 @@
JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Named.class, "UserFilter");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1);
};
- field = this._jvmTypesBuilder.toField(pkg, "userFilter", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_17);
- EList<JvmMember> _members_30 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_30, field);
- final Procedure1<JvmField> _function_18 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "userFilter", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_18);
+ EList<JvmMember> _members_32 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_32, field);
+ final Procedure1<JvmField> _function_19 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -489,10 +506,10 @@
JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Named.class, "KeyBindingDialog");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1);
};
- field = this._jvmTypesBuilder.toField(pkg, "keyBinding", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_18);
- EList<JvmMember> _members_31 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_31, field);
- final Procedure1<JvmField> _function_19 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "keyBinding", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_19);
+ EList<JvmMember> _members_33 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_33, field);
+ final Procedure1<JvmField> _function_20 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -500,10 +517,10 @@
JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Named.class, "SystemSettings");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1);
};
- field = this._jvmTypesBuilder.toField(pkg, "systemSettings", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_19);
- EList<JvmMember> _members_32 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_32, field);
- final Procedure1<JvmField> _function_20 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "systemSettings", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_20);
+ EList<JvmMember> _members_34 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_34, field);
+ final Procedure1<JvmField> _function_21 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
@@ -511,28 +528,17 @@
JvmAnnotationReference _annotationRef_1 = this._annotationTypesBuilder.annotationRef(Named.class, "ReportPrinterDialog");
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations_1, _annotationRef_1);
};
- field = this._jvmTypesBuilder.toField(pkg, "reportPrinter", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_20);
- EList<JvmMember> _members_33 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_33, field);
- final Procedure1<JvmField> _function_21 = (JvmField it) -> {
+ field = this._jvmTypesBuilder.toField(pkg, "reportPrinter", this._typeReferenceBuilder.typeRef(IVaadinDialogProvider.class), _function_21);
+ EList<JvmMember> _members_35 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_35, field);
+ final Procedure1<JvmField> _function_22 = (JvmField it) -> {
EList<JvmAnnotationReference> _annotations = it.getAnnotations();
JvmAnnotationReference _annotationRef = this._annotationTypesBuilder.annotationRef(Inject.class);
this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotationRef);
};
- field = this._jvmTypesBuilder.toField(pkg, "executorService", this._typeReferenceBuilder.typeRef(VaadinExecutorService.class), _function_21);
- EList<JvmMember> _members_34 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_34, field);
- final Procedure1<JvmField> _function_22 = (JvmField it) -> {
- final Procedure1<ITreeAppendable> _function_23 = (ITreeAppendable it_1) -> {
- StringConcatenation _builder = new StringConcatenation();
- _builder.append("new HashMap<>()");
- it_1.append(_builder);
- };
- this._jvmTypesBuilder.setInitializer(it, _function_23);
- };
- field = this._jvmTypesBuilder.toField(pkg, "enabledUpdaters", this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(MenuBar.MenuItem.class), this._typeReferenceBuilder.typeRef(Runnable.class)), _function_22);
- EList<JvmMember> _members_35 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_35, field);
+ field = this._jvmTypesBuilder.toField(pkg, "executorService", this._typeReferenceBuilder.typeRef(VaadinExecutorService.class), _function_22);
+ EList<JvmMember> _members_36 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_36, field);
final Procedure1<JvmField> _function_23 = (JvmField it) -> {
final Procedure1<ITreeAppendable> _function_24 = (ITreeAppendable it_1) -> {
StringConcatenation _builder = new StringConcatenation();
@@ -541,12 +547,23 @@
};
this._jvmTypesBuilder.setInitializer(it, _function_24);
};
- field = this._jvmTypesBuilder.toField(pkg, "menuItems", this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), this._typeReferenceBuilder.typeRef(MenuBar.MenuItem.class)), _function_23);
- EList<JvmMember> _members_36 = type.getMembers();
- this._jvmTypesBuilder.<JvmField>operator_add(_members_36, field);
- field = this._jvmTypesBuilder.toField(pkg, "bpmnWindow", this._typeReferenceBuilder.typeRef(BpmnWindow.class));
+ field = this._jvmTypesBuilder.toField(pkg, "enabledUpdaters", this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(MenuBar.MenuItem.class), this._typeReferenceBuilder.typeRef(Runnable.class)), _function_23);
EList<JvmMember> _members_37 = type.getMembers();
this._jvmTypesBuilder.<JvmField>operator_add(_members_37, field);
+ final Procedure1<JvmField> _function_24 = (JvmField it) -> {
+ final Procedure1<ITreeAppendable> _function_25 = (ITreeAppendable it_1) -> {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("new HashMap<>()");
+ it_1.append(_builder);
+ };
+ this._jvmTypesBuilder.setInitializer(it, _function_25);
+ };
+ field = this._jvmTypesBuilder.toField(pkg, "menuItems", this._typeReferenceBuilder.typeRef(HashMap.class, this._typeReferenceBuilder.typeRef(IMenuItemHandler.class), this._typeReferenceBuilder.typeRef(MenuBar.MenuItem.class)), _function_24);
+ EList<JvmMember> _members_38 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_38, field);
+ field = this._jvmTypesBuilder.toField(pkg, "bpmnWindow", this._typeReferenceBuilder.typeRef(BpmnWindow.class));
+ EList<JvmMember> _members_39 = type.getMembers();
+ this._jvmTypesBuilder.<JvmField>operator_add(_members_39, field);
}
public void toOperations(final JvmDeclaredType type, final MenuPackage pkg) {
@@ -793,6 +810,21 @@
_builder.append("MenuItem designer = menubar.addItem(designerText, null, null);");
_builder.newLine();
_builder.append("\t");
+ _builder.append("menuItems.put(reloadModelHandler, designer.addItem(reloadModelText, null, new MenuBar.Command() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public void menuSelected(MenuItem selectedItem) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("reloadModelHandler.execute(selectedItem);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}));");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("MenuItem mode = designer.addItem(designmodeText, null, new MenuBar.Command() {");
_builder.newLine();
_builder.append("\t\t");
@@ -1560,6 +1592,8 @@
_builder.newLine();
_builder.append("}");
_builder.newLine();
+ _builder.append("reloadModelText = dslMetadataService.translate(locale.toLanguageTag(),\"reloadmodel\");");
+ _builder.newLine();
_builder.append("designerText = dslMetadataService.translate(locale.toLanguageTag(),\"designer\");");
_builder.newLine();
_builder.append("designmodeText = dslMetadataService.translate(locale.toLanguageTag(),\"designermode\");");
diff --git a/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.java b/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.java
index 3ac7c21..4ff2596 100644
--- a/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.java
+++ b/org.eclipse.osbp.xtext.menu/xtend-gen/org/eclipse/osbp/xtext/menu/validation/MenuDslValidator.java
@@ -16,7 +16,16 @@
*/
package org.eclipse.osbp.xtext.menu.validation;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.osbp.xtext.menu.MenuCategory;
+import org.eclipse.osbp.xtext.menu.MenuDslPackage;
+import org.eclipse.osbp.xtext.menu.MenuTree;
import org.eclipse.osbp.xtext.menu.validation.AbstractMenuDslValidator;
+import org.eclipse.xtext.validation.Check;
/**
* Custom validation rules.
@@ -25,4 +34,32 @@
*/
@SuppressWarnings("all")
public class MenuDslValidator extends AbstractMenuDslValidator {
+ private Set<MenuTree> findDuplicates(final Collection<MenuTree> list) {
+ LinkedHashSet<MenuTree> duplicates = new LinkedHashSet<MenuTree>();
+ HashSet<String> uniques = new HashSet<String>();
+ for (final MenuTree tree : list) {
+ boolean _add = uniques.add(tree.getName());
+ boolean _not = (!_add);
+ if (_not) {
+ duplicates.add(tree);
+ }
+ }
+ return duplicates;
+ }
+
+ @Check
+ public void checkMenuTreeDuplicates(final MenuCategory menu) {
+ Set<MenuTree> duplicates = this.findDuplicates(menu.getTrees());
+ int idx = 0;
+ EList<MenuTree> _trees = menu.getTrees();
+ for (final MenuTree menuTree : _trees) {
+ {
+ boolean _contains = duplicates.contains(menuTree);
+ if (_contains) {
+ this.error("Duplicated menu tree names are not allowed in a menu category definition", MenuDslPackage.Literals.MENU_CATEGORY__TREES, idx);
+ }
+ idx++;
+ }
+ }
+ }
}