Explorar o código

Added Pictogram navigation from State to Substatechart

Andreas Mülder %!s(int64=14) %!d(string=hai) anos
pai
achega
9ec0e05b15

+ 9 - 7
de.itemis.gmf.utils/plugins/de.itemis.gmf.runtime.commons/src/de/itemis/gmf/runtime/commons/properties/descriptors/ComboPropertyDescriptor.java

@@ -35,25 +35,26 @@ public class ComboPropertyDescriptor extends AbstractPropertyDescriptor {
 	private final Enumerator[] items;
 	private ComboViewer comboViewer;
 
-	public ComboPropertyDescriptor(EStructuralFeature feature, String labelName,
-			Enumerator[] items) {
+	public ComboPropertyDescriptor(EStructuralFeature feature,
+			String labelName, Enumerator[] items) {
 		super(feature, labelName);
 		this.items = items;
 	}
 
-	public ComboPropertyDescriptor(EStructuralFeature feature, String labelName,
-			Enumerator[] items, String helpContextId) {
+	public ComboPropertyDescriptor(EStructuralFeature feature,
+			String labelName, Enumerator[] items, String helpContextId) {
 		this(feature, labelName, items);
 		this.helpContextId = helpContextId;
 	}
 
-
 	@Override
 	protected Control createControl(Composite parent) {
 		comboViewer = new ComboViewer(parent, SWT.READ_ONLY | SWT.SINGLE);
 		comboViewer.setContentProvider(new ArrayContentProvider());
 		comboViewer.setLabelProvider(new LabelProvider());
 		comboViewer.setInput(items);
+		comboViewer.getControl().setEnabled(items.length > 0);
+
 		applyLayout(comboViewer.getControl());
 		return comboViewer.getControl();
 	}
@@ -62,10 +63,11 @@ public class ComboPropertyDescriptor extends AbstractPropertyDescriptor {
 	public Combo getControl() {
 		return (Combo) super.getControl();
 	}
-	
+
 	@Override
 	protected IObservableValue getWidgetValue() {
-		IViewerValueProperty singleSelection = ViewerProperties.singleSelection();
+		IViewerValueProperty singleSelection = ViewerProperties
+				.singleSelection();
 		return singleSelection.observe(comboViewer);
 	}