Просмотр исходного кода

Remove dispose input since it may lead to dead locks

Andreas Muelder 8 лет назад
Родитель
Сommit
7f93a9e1bd

+ 42 - 47
plugins/org.yakindu.base.types.edit/src/org/yakindu/base/types/provider/OperationItemProvider.java

@@ -32,9 +32,10 @@ import org.yakindu.base.types.TypesFactory;
 import org.yakindu.base.types.TypesPackage;
 
 /**
- * This is the item provider adapter for a {@link org.yakindu.base.types.Operation} object.
- * <!-- begin-user-doc --> <!--
+ * This is the item provider adapter for a
+ * {@link org.yakindu.base.types.Operation} object. <!-- begin-user-doc --> <!--
  * end-user-doc -->
+ * 
  * @generated
  */
 public class OperationItemProvider extends DeclarationItemProvider {
@@ -65,32 +66,28 @@ public class OperationItemProvider extends DeclarationItemProvider {
 	}
 
 	/**
-	 * This adds a property descriptor for the Variadic feature.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * This adds a property descriptor for the Variadic feature. <!-- begin-user-doc
+	 * --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	protected void addVariadicPropertyDescriptor(Object object) {
-		itemPropertyDescriptors.add
-			(createItemPropertyDescriptor
-				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
-				 getResourceLocator(),
-				 getString("_UI_Operation_variadic_feature"),
-				 getString("_UI_PropertyDescriptor_description", "_UI_Operation_variadic_feature", "_UI_Operation_type"),
-				 TypesPackage.Literals.OPERATION__VARIADIC,
-				 false,
-				 false,
-				 false,
-				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
-				 null,
-				 null));
+		itemPropertyDescriptors
+				.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
+						getResourceLocator(), getString("_UI_Operation_variadic_feature"),
+						getString("_UI_PropertyDescriptor_description", "_UI_Operation_variadic_feature",
+								"_UI_Operation_type"),
+						TypesPackage.Literals.OPERATION__VARIADIC, false, false, false,
+						ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
 	}
 
 	/**
-	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
-	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+	 * This specifies how to implement {@link #getChildren} and is used to deduce an
+	 * appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand},
+	 * {@link org.eclipse.emf.edit.command.RemoveCommand} or
 	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
@@ -105,19 +102,21 @@ public class OperationItemProvider extends DeclarationItemProvider {
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	protected EStructuralFeature getChildFeature(Object object, Object child) {
-		// Check the type of the specified child object and return the proper feature to use for
+		// Check the type of the specified child object and return the proper feature to
+		// use for
 		// adding (see {@link AddCommand}) it as a child.
 
 		return super.getChildFeature(object, child);
 	}
 
 	/**
-	 * This returns Operation.gif.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * This returns Operation.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
@@ -142,14 +141,14 @@ public class OperationItemProvider extends DeclarationItemProvider {
 			builder.append(sep);
 			builder.append(parameter.getName());
 			builder.append(" : ");
-			String typeName = getTypeName(parameter.getTypeSpecifier());
+			String typeName = parameter.getType().getName();
 			builder.append(typeName);
 			sep = ", ";
 		}
 		builder.append(")");
 		if (operation.getType() != null) {
 			builder.append(" : ");
-			String name = getTypeName(operation.getTypeSpecifier());
+			String name = operation.getType().getName();
 			builder.append(name == null ? "void" : name);
 		}
 		return builder.toString();
@@ -170,10 +169,10 @@ public class OperationItemProvider extends DeclarationItemProvider {
 	}
 
 	/**
-	 * This handles model notifications by calling {@link #updateChildren} to update any cached
-	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
-	 * <!-- begin-user-doc --> <!--
-	 * end-user-doc -->
+	 * This handles model notifications by calling {@link #updateChildren} to update
+	 * any cached children and by creating a viewer notification, which it passes to
+	 * {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
@@ -181,21 +180,21 @@ public class OperationItemProvider extends DeclarationItemProvider {
 		updateChildren(notification);
 
 		switch (notification.getFeatureID(Operation.class)) {
-			case TypesPackage.OPERATION__VARIADIC:
-				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
-				return;
-			case TypesPackage.OPERATION__TYPE_PARAMETERS:
-			case TypesPackage.OPERATION__PARAMETERS:
-				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
-				return;
+		case TypesPackage.OPERATION__VARIADIC:
+			fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+			return;
+		case TypesPackage.OPERATION__TYPE_PARAMETERS:
+		case TypesPackage.OPERATION__PARAMETERS:
+			fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+			return;
 		}
 		super.notifyChanged(notification);
 	}
 
 	/**
-	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s
-	 * describing the children that can be created under this object. <!--
-	 * begin-user-doc --> <!-- end-user-doc -->
+	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing
+	 * the children that can be created under this object. <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
 	 * 
 	 * @generated
 	 */
@@ -203,15 +202,11 @@ public class OperationItemProvider extends DeclarationItemProvider {
 	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
 		super.collectNewChildDescriptors(newChildDescriptors, object);
 
-		newChildDescriptors.add
-			(createChildParameter
-				(TypesPackage.Literals.GENERIC_ELEMENT__TYPE_PARAMETERS,
-				 TypesFactory.eINSTANCE.createTypeParameter()));
+		newChildDescriptors.add(createChildParameter(TypesPackage.Literals.GENERIC_ELEMENT__TYPE_PARAMETERS,
+				TypesFactory.eINSTANCE.createTypeParameter()));
 
-		newChildDescriptors.add
-			(createChildParameter
-				(TypesPackage.Literals.OPERATION__PARAMETERS,
-				 TypesFactory.eINSTANCE.createParameter()));
+		newChildDescriptors.add(createChildParameter(TypesPackage.Literals.OPERATION__PARAMETERS,
+				TypesFactory.eINSTANCE.createParameter()));
 	}
 
 }

+ 5 - 1
plugins/org.yakindu.base.xtext.utils.jface/src/org/yakindu/base/xtext/utils/jface/viewers/StyledTextXtextAdapter.java

@@ -12,7 +12,12 @@ package org.yakindu.base.xtext.utils.jface.viewers;
 
 import java.util.List;
 
+import org.eclipse.core.internal.jobs.JobManager;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.jface.bindings.keys.KeyStroke;
 import org.eclipse.jface.fieldassist.ControlDecoration;
@@ -291,7 +296,6 @@ public class StyledTextXtextAdapter {
 			unconfigureSourceViewerDecorationSupport(decorationSupport);
 		}
 		uninstallHighlightingHelper();
-		document.disposeInput();
 	}
 
 	protected XtextSourceViewerConfiguration getXtextSourceViewerConfiguration() {