catch up with branch daily

Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF b/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
index 91f08be..85f8a3e 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/META-INF/MANIFEST.MF
@@ -40,7 +40,6 @@
  org.eclipse.e4.ui.model.application.ui.advanced,
  org.eclipse.e4.ui.model.application.ui.advanced.impl,
  org.eclipse.e4.ui.model.application.ui.basic,
- org.eclipse.osbp.ui.api.user;version="0.9.0",
  org.eclipse.osbp.vaaclipse.publicapi.authentication;version="0.9.0",
  org.osgi.framework;version="1.7.0",
  org.osgi.service.component.annotations;version="1.2.0"
diff --git a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java
index d4f5c70..643c385 100644
--- a/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java
+++ b/org.eclipse.osbp.ecview.extension.grid.presentation/src/org/eclipse/osbp/ecview/extension/grid/presentation/renderer/RendererFactory.java
@@ -15,6 +15,7 @@
  */
 package org.eclipse.osbp.ecview.extension.grid.presentation.renderer;
 
+import java.text.DateFormat;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
 import java.text.SimpleDateFormat;
@@ -101,7 +102,7 @@
 				return new DateRenderer(new SimpleDateFormat(dateFormat,
 						uiContext.getLocale()));
 			} else {
-				return new DateRenderer(uiContext.getLocale());
+				return new DateRenderer(DateFormat.getDateInstance(DateFormat.DEFAULT, uiContext.getLocale()));
 			}
 		} else if (cxRenderer instanceof CxGridNumberRenderer) {
 			CxGridNumberRenderer cxCasted = (CxGridNumberRenderer) cxRenderer;
diff --git a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
index 438b814..653ead5 100644
--- a/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
+++ b/org.eclipse.osbp.ecview.extension.strategy/src/org/eclipse/osbp/ecview/extension/strategy/AbstractLayoutingStrategy.java
@@ -189,7 +189,7 @@
 
 	private IUser user;
 
-    private static Map<String, Boolean> isEditable = new HashMap<>();
+    private static Map<String, Boolean> isSuspectEditable = new HashMap<>();
 
 	/** The Constant LOGGER. */
 	private static final Logger LOGGER = LoggerFactory.getLogger(AbstractLayoutingStrategy.class);
@@ -218,6 +218,7 @@
 	 */
 	@Override
 	public void layout(YLayoutingInfo layoutingInfo) {
+		LOGGER.trace("{}", "layout");
 		this.layoutingInfo = layoutingInfo;
 
 		clean();
@@ -275,6 +276,7 @@
 	}
 
 	private YLayout createColumnedLayout(int numberColumns) {
+		LOGGER.trace("{}", "createColumnedLayout");
 	    YHorizontalLayout layout = ExtensionModelFactory.eINSTANCE.createYHorizontalLayout();
 	    for(int i=0; i < numberColumns; i++) {
 	    	layoutList.add(ExtensionModelFactory.eINSTANCE.createYVerticalLayout());
@@ -286,6 +288,7 @@
 	}
 
 	private void addColumnedElement(final YLayout layout, final YEmbeddable element, int numberColumns) {
+		LOGGER.trace("{}", "addColunedElement");
 		int idx = currentIndex % numberColumns;
 		int lastAddedIdx = layoutList.get(idx).getElements().size();
 		YLayout subLayout = null;
@@ -317,6 +320,7 @@
 	 * Removes elements tagged with #TAG__TO_BE_CLEANED from the view.
 	 */
 	private void clean() {
+		LOGGER.trace("{}", "clean");
 		YView view = layoutingInfo.getView();
 		TreeIterator<Object> contents = EcoreUtil.getAllContents(view, true);
 		while (contents.hasNext()) {
@@ -338,6 +342,7 @@
 	 * @return the array list
 	 */
 	private ArrayList<YSuspect> createSuspectList(YStrategyLayout yLayout) {
+		LOGGER.trace("{}", "createSuspectList");
 		ArrayList<YSuspect> suspectList = new ArrayList<>(yLayout.getSuspects().size());
 		ArrayList<YSuspect> suspectCollectionList = new ArrayList<>(yLayout.getSuspects().size());
 		for (YSuspect ySuspect : yLayout.getSuspects()) {
@@ -405,7 +410,7 @@
 	 *            the suspect info
 	 */
 	private void addElement(YEmbeddable content, YEmbeddable element, YSuspectInfo suspectInfo, int numberColumns) {
-		
+		LOGGER.trace("{}", "addElement");
 		if (content instanceof YTabSheet) {
 			EList<YTab> tabs = ((YTabSheet) content).getTabs();
 			if (suspectInfo.getSuspect().getTags().contains(TAG__TABLE)
@@ -455,6 +460,7 @@
 	}
 
 	private void createGrouping(YEmbeddable content, YEmbeddable element, YSuspectInfo suspectInfo, int numberColumns) {
+		LOGGER.trace("{}", "createGrouping");
 		String group = suspectInfo.getSuspect().getGroupName();
 		YFormLayout groupLayout = null;
 		if (currentGroup == null || !currentGroup.name.equals(group)) {
@@ -527,6 +533,7 @@
 	 *            the y embeddable
 	 */
 	protected void prepareValueBindings(YSuspectInfo suspectInfo, YEmbeddable yEmbeddable) {
+		LOGGER.trace("{}", "prepareValueBinding");
 		YSuspect ySuspect = suspectInfo.getSuspect();
 		// iterate over all elements
 		for (YBindingEndpoint ep : ySuspect.getValueBindingEndpoints()) {
@@ -602,6 +609,7 @@
 	 * @return the y embeddable
 	 */
 	protected YEmbeddable createElementForSuspect(YSuspectInfo suspectInfo) {
+		LOGGER.trace("{}", "createElementForSuspect");
 		YSuspect ySuspect = suspectInfo.getSuspect();
 		YEmbeddable yEmbeddable = null;
 		if (ySuspect.getTags().contains(TAG__DECIMAL)) {
@@ -770,6 +778,7 @@
 	 * @return
 	 */
 	private boolean existFunctionsInProperties(YSuspect ySuspect) {
+		LOGGER.trace("{}", "existFuntionInProperties");
 		for (FunctionType functionType : functionTypingApi.getTypes()) {
 			if (existInProperties(ySuspect, functionType.getName().toLowerCase())) {
 				return true;
@@ -786,6 +795,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createIconComboBox(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createIconComboBox");
 		YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
 		YIconComboBox yIconCombo = YECviewFactory.eINSTANCE.createYIconComboBox();
 		yIconCombo.setType(yTypedSuspect.getType());
@@ -809,7 +819,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createSubTypeElements(YSubTypeBaseSuspect ySuspect) {
-
+		LOGGER.trace("{}", "createSbTypeElement");
 		for (YSuspect temp : ySuspect.getChildren()) {
 			YSubTypeSuspect childSuspect = (YSubTypeSuspect) temp;
 
@@ -844,7 +854,7 @@
 	 * @return the yEmbeddable
 	 */
 	private YEmbeddable createNestedBeanElements(YTypedCompoundSuspect ySuspect) {
-
+		LOGGER.trace("{}", "createNestedBeanElements");
 		for (YSuspect childSuspect : ySuspect.getChildren()) {
 			childSuspect.setGroupName(ySuspect.getLabelI18nKey());
 			childSuspect.getTags().add(TAG__GROUP);
@@ -873,6 +883,7 @@
 	 */
 	private YSubTypeVisibilityProcessor createSubTypeVisibilityProcessor(YEmbeddable yEmbeddable,
 			YSubTypeSuspect childSuspect, YBeanSlot beanSlot) {
+		LOGGER.trace("{}", "createSubTypeVisibilityProcessor");
 		// create a VP which sets the element visible true/false if the
 		// type of the bound dto matches the expected or not
 		YSubTypeVisibilityProcessor yVp = YVisibilityFactory.eINSTANCE.createYSubTypeVisibilityProcessor();
@@ -907,6 +918,7 @@
 	 */
 	// Helper Methods
 	private YEmbeddable createYBlobUploadComponent(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createYBlobUploadComponent");
 		YEmbeddable yEmbeddable = YECviewFactory.eINSTANCE.createYBlobUploadComponent();
 		if (existInProperties(ySuspect, IPropertyConstants.PROPERTY_BLOB)) {
 			try {
@@ -934,6 +946,7 @@
 	 * @return
 	 */
 	private YEmbeddable createRichTextFieldBlob(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createRichTextFieldBlob");
 		YRichTextArea yRichText = YECviewFactory.eINSTANCE.createYRichTextArea();
 		yRichText.setUseBlob(true);
 		return yRichText;
@@ -947,6 +960,7 @@
 	 * @return
 	 */
 	private YEmbeddable createRichTextFieldString(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createRichTextFieldString");
 		YRichTextArea yRichText = YECviewFactory.eINSTANCE.createYRichTextArea();
 		yRichText.setUseBlob(false);
 		return yRichText;
@@ -959,6 +973,7 @@
 	 * @return
 	 */
 	private YEmbeddable createMaskedTextField(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createMaskedTextField");
 		YMaskedTextField yRichText = YECviewFactory.eINSTANCE.createYMaskedTextField();
 		yRichText.setMask(ySuspect.getProperties().get(IPropertyConstants.PROPERTY_MASK));
 		return yRichText;
@@ -971,6 +986,7 @@
 	 * @return
 	 */
 	private YEmbeddable createMaskedDecimalField(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createMaskedDecimalField");
 		YMaskedDecimalField yRichText = YECviewFactory.eINSTANCE.createYMaskedDecimalField();
 		yRichText.setMask(ySuspect.getProperties().get(IPropertyConstants.PROPERTY_MASK));
 
@@ -985,6 +1001,7 @@
 	 * @return
 	 */
 	private YEmbeddable createPasswordField(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createPasswordField");
 		YPasswordField yPasswordField = ExtensionModelFactory.eINSTANCE.createYPasswordField();
 		return yPasswordField;
 	}
@@ -997,6 +1014,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createYBeanReference(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createYBeanReference");
 		YTypedSuspect yTypedSuspect = (YTypedSuspect) ySuspect;
 		EMap<String, String> suspectProperties = yTypedSuspect.getProperties();
 		YEmbeddable yEmbeddable = null;
@@ -1030,6 +1048,13 @@
 					yDialogComponent.setUpdateCallback(new DtoServiceCallback());
 					beanReferenceField.setDialogComponent(yDialogComponent);
 				}
+				
+				if(ySuspect.getProperties().containsKey("TargetEnumRefClass")) {
+					beanReferenceField.setReferenceSourceTypeQualifiedName(ySuspect.getProperties().get("TargetEnumRefClass"));
+					beanReferenceField.setReferenceSourceTypeProperty(ySuspect.getProperties().get("TargetEnumRefField"));
+				}
+				
+				
 			}
 
 			// Alternative for non editable bean references is a non editable
@@ -1065,6 +1090,7 @@
 	}
 	
 	public IViewContext getAutobindedDialogModel(Class<?> dtoType) {
+		LOGGER.trace("{}", "getAutobindedDialogModel");
 		IViewContext viewContext = null;
 		BundleContext bc = FrameworkUtil.getBundle(getClass()).getBundleContext();
 		ServiceReference<IECViewProviderService> ref = bc.getServiceReference(IECViewProviderService.class);
@@ -1128,6 +1154,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createTable(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createTable");
 		YEmbeddable yEmbeddable;
 		YCollectionSuspect yCollectionSuspect = (YCollectionSuspect) ySuspect;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYTable();
@@ -1166,6 +1193,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createGrid(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createGrid");
 		YEmbeddable yEmbeddable;
 		YCollectionSuspect yTypedSuspect = (YCollectionSuspect) ySuspect;
 		GridFactory gFactory = new GridFactory();
@@ -1183,6 +1211,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createEnumOptions(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createEnumOptions");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYEnumOptionsGroup();
 		YEnumOptionsGroup enumOptionsGroup = (YEnumOptionsGroup) yEmbeddable;
@@ -1200,6 +1229,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createEnumCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createEnumCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYEnumComboBox();
 		YEnumComboBox yEnumCombo = (YEnumComboBox) yEmbeddable;
@@ -1217,6 +1247,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createOrganizationCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createOrganizationCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
 		YComboBox yCombo = (YComboBox) yEmbeddable;
@@ -1245,6 +1276,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createPerspectiveCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createPerspectiveCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = YECviewFactory.eINSTANCE.createYPairComboBox();
 		YPairComboBox yCombo = (YPairComboBox) yEmbeddable;
@@ -1264,6 +1296,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createThemeCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createThemeCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
 		YComboBox yCombo = (YComboBox) yEmbeddable;
@@ -1287,6 +1320,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createPrintServiceCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createPrintServiceCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
 		YComboBox yCombo = (YComboBox) yEmbeddable;
@@ -1307,6 +1341,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createModelCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createModelCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = ExtensionModelFactory.eINSTANCE.createYComboBox();
 		YComboBox yCombo = (YComboBox) yEmbeddable;
@@ -1337,6 +1372,7 @@
 	 * @return the y embeddable
 	 */
 	private YEmbeddable createI18nCombo(YSuspect ySuspect) {
+		LOGGER.trace("{}", "createI18nCombo");
 		YEmbeddable yEmbeddable;
 		yEmbeddable = YECviewFactory.eINSTANCE.createYI18nComboBox();
 		YI18nComboBox yCombo = (YI18nComboBox) yEmbeddable;
@@ -1346,6 +1382,7 @@
 	}
 
 	private Collection<String> getOrganizationPositionNames(String organizationName) {
+		LOGGER.trace("{}", "getOrganizationPositionNames");
 		IOrganizationService organizationService = ServiceListener.getOrganizationService();
 		// In case of the open source solution a organization service is not
 		// available!
@@ -1380,6 +1417,7 @@
 	 *            the y suspect
 	 */
 	private void setCustomDecimalConverter(YEmbeddable yEmbeddable, YSuspect ySuspect) {
+		LOGGER.trace("{}", "setCustomDecimalConverter");
 		if (existFunctionsInProperties(ySuspect)) {
 			YCustomDecimalConverter converter = YConverterFactory.eINSTANCE.createYCustomDecimalConverter();
 			converter.getProperties().addAll(ySuspect.getProperties());
@@ -1427,6 +1465,7 @@
 	 * @return the converter
 	 */
 	public static YConverter getConverter(EMap<String, String> properties) {
+		LOGGER.trace("{}", "getConverter");
 		String decimalformatPropertyValue = properties.get(IPropertyConstants.PROPERTY_DECIMALFORMAT);
 		if (decimalformatPropertyValue != null) {
 			YSimpleDecimalConverter yConverter = YConverterFactory.eINSTANCE.createYSimpleDecimalConverter();
@@ -1443,13 +1482,14 @@
 	 * existing user permissions
 	 */
 	private boolean isEditable(YSuspect ySuspect) {
+		LOGGER.trace("{}", "isEditable");
 		String dtoName = ySuspect.getAuthorizationGroup();
 		String dtoProperty = ySuspect.getAuthorizationId();
 
 		Boolean result=false;
     	String grantKey = dtoName + "." + dtoProperty + "###EDITABLE";
-    	if( isEditable.containsKey(grantKey)) {
-    		result=isEditable.get(grantKey);
+    	if( isSuspectEditable.containsKey(grantKey)) {
+    		result=isSuspectEditable.get(grantKey);
     	} else {
     		if (userAccessService.isGranted(Group.DTO, Action.READABLE, dtoName)) {
     			boolean invisible = userAccessService.isVetoed(Group.DTO, Action.INVISIBLE, dtoName, dtoProperty);
@@ -1463,7 +1503,7 @@
     			}
 				result = !invisible && enabled && editable; 
     		}
-    		isEditable.put(grantKey,result);
+    		isSuspectEditable.put(grantKey,result);
     	}
 		return result;
 	}