/**
 * Copyright (c) 2012 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 org.yakindu.sct.ui.editor.policies;

import java.util.List;

import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gmf.runtime.diagram.core.util.ViewType;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;

/**
 * 
 * @author andreas muelder - Initial contribution and API
 * 
 */
public class StateCompartmentCreationEditPolicy extends
		CompartmentCreationEditPolicy {

	@Override
	protected Command getCreateCommand(CreateViewRequest request) {
		List<? extends ViewDescriptor> viewDescriptors = request
				.getViewDescriptors();
		for (ViewDescriptor viewDescriptor : viewDescriptors) {
			String semanticHint = viewDescriptor.getSemanticHint();
			if (ViewType.NOTE.equals(semanticHint)
					|| ViewType.NOTEATTACHMENT.equals(semanticHint)
					|| ViewType.TEXT.equals(semanticHint)) {
				return UnexecutableCommand.INSTANCE;
			}
		}
		return super.getCreateCommand(request);
	}
}

@@ -778,16 +778,264 @@
 riptor;%0D
+%0Aimport org.eclipse.gmf.runtime.notation.BooleanValueStyle;%0D%0Aimport org.yakindu.sct.ui.editor.editparts.StateEditPart;%0D%0Aimport org.yakindu.sct.ui.editor.partitioning.DiagramPartitioningUtil;%0D%0Aimport org.yakindu.sct.ui.editor.utils.GMFNotationUtil;%0D
 %0A%0D%0A/**%0D%0A
@@ -1163,20 +1163,17 @@
  extends
-%0D%0A%09%09
+ 
 Compartm
@@ -1277,16 +1277,322 @@
 est) %7B%0D%0A
+%0D%0A%09%09StateEditPart parent = (StateEditPart) getHost().getParent();%0D%0A%0D%0A%09%09BooleanValueStyle isInline = GMFNotationUtil.getBooleanValueStyle(parent.getNotationView(),%0D%0A%09%09%09%09DiagramPartitioningUtil.INLINE_STYLE);%0D%0A%09%09if (isInline != null && !isInline.isBooleanValue())%0D%0A%09%09%09return UnexecutableCommand.INSTANCE;%0D%0A%0D%0A
 %09%09List%3C?
@@ -1641,22 +1641,16 @@
  request
-%0D%0A%09%09%09%09
 .getView
@@ -1817,39 +1817,33 @@
 ls(semanticHint)
-%0D%0A%09%09%09%09%09
+ 
 %7C%7C ViewType.NOTE

Disable element creation for extracted subdiagrams