فهرست منبع

Removed <name> attribute for entry states

Andreas Mülder 12 سال پیش
والد
کامیت
e572d93d93

+ 0 - 1
de.itemis.gmf.utils/plugins/de.itemis.gmf.runtime.commons/src/de/itemis/gmf/runtime/commons/editparts/ControlEditPart.java

@@ -66,7 +66,6 @@ public abstract class ControlEditPart extends ShapeEditPart {
 			rect = rect.getCopy();
 			translateToAbsolute(rect);
 			control.setBounds(rect.x, rect.y, rect.width, rect.height);
-			System.out.println("Set Bounds " + rect);
 			super.setBounds(rect);
 		}
 	}

+ 2 - 2
de.itemis.gmf.utils/plugins/de.itemis.gmf.runtime.commons/src/de/itemis/gmf/runtime/commons/editparts/TextAwareLabelEditPart.java

@@ -57,9 +57,9 @@ public abstract class TextAwareLabelEditPart extends CompartmentEditPart
 
 	private final DirectEditManager manager;
 
-	private final EAttribute feature;
+	protected final EAttribute feature;
 
-	private final String pluginId;
+	protected final String pluginId;
 
 	public TextAwareLabelEditPart(View view, EAttribute feature, String pluginId) {
 		super(view);

+ 26 - 7
de.itemis.gmf.utils/plugins/de.itemis.gmf.runtime.commons/src/de/itemis/gmf/runtime/commons/parsers/StringAttributeParser.java

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) 2013 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
 package de.itemis.gmf.runtime.commons.parsers;
 
 import org.eclipse.core.runtime.Assert;
@@ -22,7 +32,7 @@ import de.itemis.xtext.utils.gmf.directedit.IEAttributeProvider;
 /**
  * Direct editing parser that allows editing of an EAttribute of type String.
  * 
- * @author andreas muelder
+ * @author andreas muelder - Initial contribution and API
  * 
  */
 public class StringAttributeParser implements IParser {
@@ -52,24 +62,32 @@ public class StringAttributeParser implements IParser {
 		if (string != null && !string.trim().isEmpty()) {
 			return String.valueOf(string);
 		} else {
-			return "<" + attribute.getName() + ">";
+			return createEmptyStringLabel(attribute);
 		}
 	}
 
-	public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+	protected String createEmptyStringLabel(EAttribute attribute) {
+		return "<" + attribute.getName() + ">";
+	}
+
+	public IParserEditStatus isValidEditString(IAdaptable element,
+			String editString) {
 		return new ParserEditStatus(pluginId, IParserEditStatus.OK, "");
 	}
 
-	public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
+	public ICommand getParseCommand(IAdaptable adapter, String newString,
+			int flags) {
 		if (newString == null) {
 			return UnexecutableCommand.INSTANCE;
 		}
 		EObject element = (EObject) adapter.getAdapter(EObject.class);
-		TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
+		TransactionalEditingDomain editingDomain = TransactionUtil
+				.getEditingDomain(element);
 		if (editingDomain == null) {
 			return UnexecutableCommand.INSTANCE;
 		}
-		SetRequest request = new SetRequest(element, provider.getAttribute(), newString);
+		SetRequest request = new SetRequest(element, provider.getAttribute(),
+				newString);
 		return new SetValueCommand(request);
 	}
 
@@ -80,7 +98,8 @@ public class StringAttributeParser implements IParser {
 
 	public boolean isAffectingEvent(Object event, int flags) {
 		if (event instanceof Notification) {
-			return (((Notification) event).getFeature() == provider.getAttribute());
+			return (((Notification) event).getFeature() == provider
+					.getAttribute());
 		}
 		return false;
 	}

+ 0 - 1
de.itemis.xtext.utils/plugins/de.itemis.xtext.utils.jface/src/de/itemis/xtext/utils/jface/viewers/StyledTextXtextAdapter.java

@@ -251,7 +251,6 @@ public class StyledTextXtextAdapter {
 
 	protected void initXtextDocument(XtextFakeResourceContext context) {
 		document.setInput(context.getFakeResource());
-
 		IDocumentPartitioner partitioner = documentPartitioner.get();
 		partitioner.connect(document);
 		document.setDocumentPartitioner(partitioner);

+ 0 - 1
de.itemis.xtext.utils/plugins/de.itemis.xtext.utils.jface/src/de/itemis/xtext/utils/jface/viewers/util/ActiveEditorTracker.java

@@ -157,7 +157,6 @@ public class ActiveEditorTracker implements IPageListener, IPartListener,
 
 	public void pageOpened(IWorkbenchPage page) {
 		// do nothing
-		System.out.println("PAGE OPENED: " + page);
 	}
 
 	public void partActivated(IWorkbenchPart part) {