package org.camunda.bpm.modeler.ui.property.tabs.builder;

import org.camunda.bpm.modeler.ui.property.tabs.util.PropertyUtil;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.Definitions;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.graphiti.ui.platform.GFPropertySection;
import org.eclipse.swt.widgets.Composite;

/**
 * Builder for document properties from the definitions
 * 
 * @author kristin.polenz
 */
public class DocumentPropertiesBuilder extends AbstractPropertiesBuilder<Definitions> {

	private static final EStructuralFeature TARGET_NAMESPACE_FEATURE = Bpmn2Package.eINSTANCE.getDefinitions_TargetNamespace();
	
	public DocumentPropertiesBuilder(Composite parent, GFPropertySection section, Definitions bo) {
		super(parent, section, bo);
	}
	
	@Override
	public void create() {
		PropertyUtil.createText(section, parent, "Target Namespace", TARGET_NAMESPACE_FEATURE, bo);
//		final Text text = PropertyUtil.createUnboundText(section, parent, "Target Namespace");
//		new TargetNamespaceStringTextBinding(bo, TARGET_NAMESPACE_FEATURE, text).establish();
	}
	
//	/**
//	 * Binding for the target namespace element
//	 * 
//	 * @author kristin.polenz
//	 */
//	private class TargetNamespaceStringTextBinding extends StringTextBinding {
//
//		public TargetNamespaceStringTextBinding(EObject model,EStructuralFeature feature, Text control) {
//			super(model, feature, control);
//		}
//
//		@Override
//		protected String toString(String value) {
//			if (value == null) {
//				return "";
//			} else {
//				return value;
//			}
//		}
//
//		@Override
//		protected String fromString(String str) {
//			// TODO Auto-generated method stub
//			return null;
//		}
//
//		@Override
//		public String getModelValue() {
//			return (String) model.eContainer().eGet(feature);
//		}
//	}
}

@@ -922,913 +922,8 @@
 o);%0A
-//%09%09final Text text = PropertyUtil.createUnboundText(section, parent, %22Target Namespace%22);%0A//%09%09new TargetNamespaceStringTextBinding(bo, TARGET_NAMESPACE_FEATURE, text).establish();%0A%09%7D%0A%09%0A//%09/**%0A//%09 * Binding for the target namespace element%0A//%09 * %0A//%09 * @author kristin.polenz%0A//%09 */%0A//%09private class TargetNamespaceStringTextBinding extends StringTextBinding %7B%0A//%0A//%09%09public TargetNamespaceStringTextBinding(EObject model,EStructuralFeature feature, Text control) %7B%0A//%09%09%09super(model, feature, control);%0A//%09%09%7D%0A//%0A//%09%09@Override%0A//%09%09protected String toString(String value) %7B%0A//%09%09%09if (value == null) %7B%0A//%09%09%09%09return %22%22;%0A//%09%09%09%7D else %7B%0A//%09%09%09%09return value;%0A//%09%09%09%7D%0A//%09%09%7D%0A//%0A//%09%09@Override%0A//%09%09protected String fromString(String str) %7B%0A//%09%09%09// TODO Auto-generated method stub%0A//%09%09%09return null;%0A//%09%09%7D%0A//%0A//%09%09@Override%0A//%09%09public String getModelValue() %7B%0A//%09%09%09return (String) model.eContainer().eGet(feature);%0A//%09%09%7D%0A//
 %09%7D%0A%7D

remove commented out text