fixes + copy available only for global types and global element declarations
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml b/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml
index a0ed489..d180c85 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/plugin.xml
@@ -90,7 +90,7 @@
    <extension
        point="org.eclipse.ui.handlers">
   		<handler
-       	 class="org.eclipse.wst.sse.sieditor.ui.v2.dt.handlers.CopyHandler"
+       	 class="org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.handlers.CopyHandler"
        	 commandId="org.eclipse.ui.edit.copy">
     		 <activeWhen>
           <with
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/actions/CopyAction.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/actions/CopyAction.java
index a39d690..9f3e0e0 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/actions/CopyAction.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/actions/CopyAction.java
@@ -13,10 +13,7 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.wst.sse.sieditor.model.api.IModelObject;
 import org.eclipse.wst.sse.sieditor.search.i18n.Messages;
-import org.eclipse.wst.sse.sieditor.ui.v2.clipboard.ClipboardService;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.impl.ElementNode;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.impl.SimpleTypeNode;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.impl.StructureTypeNode;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.ClipboardService;
 import org.eclipse.wst.sse.sieditor.ui.v2.nodes.ITreeNode;
 
 public class CopyAction extends AbstractActiveOnSingleSelectionAction {
@@ -41,8 +38,7 @@
         }
 
         Object firstElement = getStructuredSelectionFirstElement();
-        return firstElement instanceof ElementNode || firstElement instanceof SimpleTypeNode
-                || firstElement instanceof StructureTypeNode;
+        return ClipboardService.isCopyEnabled(firstElement);
     }
 
     @Override
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/tree/TreeNodeDragListener.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/tree/TreeNodeDragListener.java
index f1c2448..9266a2e 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/tree/TreeNodeDragListener.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/ui/tree/TreeNodeDragListener.java
@@ -6,6 +6,7 @@
 import org.eclipse.swt.dnd.DragSourceAdapter;

 import org.eclipse.swt.dnd.DragSourceEvent;

 import org.eclipse.wst.sse.sieditor.model.api.IModelObject;

+import org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.ClipboardService;

 import org.eclipse.wst.sse.sieditor.ui.v2.dt.dnd.SiEditorTransfer;

 import org.eclipse.wst.sse.sieditor.ui.v2.nodes.ITreeNode;

 

@@ -37,7 +38,12 @@
     public void dragStart(DragSourceEvent event) {

         ISelection selection = viewer.getSelection();

         if (selection instanceof IStructuredSelection) {

-            event.doit = ((IStructuredSelection) selection).size() == 1;

+            IStructuredSelection structuredSelection = (IStructuredSelection) selection;

+            if (structuredSelection.size() != 1) {

+                event.doit = false;

+                return;

+            }

+            event.doit = ClipboardService.isCopyEnabled(structuredSelection.getFirstElement());

         } else {

             event.doit = !selection.isEmpty();

         }

diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.sse.sieditor.ui/META-INF/MANIFEST.MF
index 67df700..ef0d70a 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/META-INF/MANIFEST.MF
@@ -60,7 +60,6 @@
    org.eclipse.wst.sse.sieditor.model.xsd.api,
    org.eclipse.ui.forms,
    org.eclipse.ui.forms.widgets",
- org.eclipse.wst.sse.sieditor.ui.v2.clipboard,
  org.eclipse.wst.sse.sieditor.ui.v2.common;
   uses:="org.eclipse.swt.events,
    org.eclipse.swt.custom,
@@ -89,13 +88,14 @@
    org.eclipse.wst.sse.sieditor.model.xsd.api,
    org.eclipse.swt.widgets",
  org.eclipse.wst.sse.sieditor.ui.v2.dt.actionenablement,
+ org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard,
+ org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.handlers,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.dnd,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard.listeners,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard.pages,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard.table,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard.utils,
- org.eclipse.wst.sse.sieditor.ui.v2.dt.handlers,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes;uses:="org.eclipse.wst.sse.sieditor.ui.v2.wsdltree.nodes,org.eclipse.wst.sse.sieditor.model.api,org.eclipse.wst.sse.sieditor.model.xsd.api",
  org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.impl,
  org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.labels,
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/AbstractEditorWithSourcePage.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/AbstractEditorWithSourcePage.java
index 85f2ec7..e06d3d9 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/AbstractEditorWithSourcePage.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/AbstractEditorWithSourcePage.java
@@ -88,8 +88,8 @@
 import org.eclipse.wst.sse.sieditor.ui.v2.common.ThreadUtils;
 import org.eclipse.wst.sse.sieditor.ui.v2.common.ValidationListener;
 import org.eclipse.wst.sse.sieditor.ui.v2.dt.DataTypesEditorPage;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.handlers.CopyHandler;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.handlers.PasteHandler;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.handlers.CopyHandler;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.handlers.PasteHandler;
 import org.eclipse.wst.sse.sieditor.ui.v2.resources.ResourceChangeHandler;
 import org.eclipse.wst.sse.sieditor.ui.v2.wsdl.formpage.ServiceIntefaceEditorPage;
 import org.eclipse.wst.sse.sieditor.ui.view.impl.SISourceEditorPart;
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/Messages.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/Messages.java
index 754bb14..b9ec1af 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/Messages.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/Messages.java
@@ -44,6 +44,8 @@
     public static String AbstractTypeDialogStrategy_msg_error_element;
     public static String AbstractTypeDialogStrategy_msg_error_simple_type;
     public static String AbstractTypeDialogStrategy_msg_error_structure_type;
+    public static String CopyHandler_CopyNotPossibleMessage;
+    public static String CopyHandler_CopyNotPossibleMessageTitle;
     public static String DataTypesEditorPage_form_title;
     public static String DataTypesFormPageController_0;
     public static String DataTypesFormPageController_1;
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/messages.properties b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/messages.properties
index 91e92bb..80a63f7 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/messages.properties
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/i18n/messages.properties
@@ -24,6 +24,8 @@
 AbstractTypeDialogStrategy_msg_error_element=element
 AbstractTypeDialogStrategy_msg_error_simple_type=simple type
 AbstractTypeDialogStrategy_msg_error_structure_type=structure type
+CopyHandler_CopyNotPossibleMessage=Copy operation is possible only on selected global types.
+CopyHandler_CopyNotPossibleMessageTitle=Copy not possible
 DataTypesEditorPage_form_title=Data Types
 DataTypesFormPageController_0=Copy
 DataTypesFormPageController_1=Copy
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/DataTypesFormPageController.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/DataTypesFormPageController.java
index 5e8f416..e40732f 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/DataTypesFormPageController.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/DataTypesFormPageController.java
@@ -83,7 +83,7 @@
 import org.eclipse.wst.sse.sieditor.ui.DataTypesEditor;
 import org.eclipse.wst.sse.sieditor.ui.i18n.Messages;
 import org.eclipse.wst.sse.sieditor.ui.v2.AbstractFormPageController;
-import org.eclipse.wst.sse.sieditor.ui.v2.clipboard.ClipboardService;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.ClipboardService;
 import org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard.ExtractNamespaceWizard;
 import org.eclipse.wst.sse.sieditor.ui.v2.dt.extractwizard.utils.ExtractSchemaWizardConstants;
 import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.IDataTypesTreeNode;
@@ -1467,12 +1467,7 @@
     }
 
     public boolean isCopyEnabled(final IDataTypesTreeNode selectedNode) {
-        if (selectedNode == null) {
-            return false;
-        }
-        final IModelObject modelObject = selectedNode.getModelObject();
-
-        return modelObject != null && modelObject instanceof IType;
+        return ClipboardService.isCopyEnabled(selectedNode);
     }
 
     public void setElementFacet(final IElement element, final String value, final int facetId) {
@@ -1508,7 +1503,7 @@
 
     public boolean handleDropTypeIntoEditor(AbstractModelRoot modelRoot, INamedObject typeToBeCopied, ITreeNode dropTarget) {
         ISchema targetSchema = null;
-        INamespaceNode namespaceNode = getNamespaceNode((ITreeNode) dropTarget);
+
         if (modelRoot instanceof IXSDModelRoot) {
             targetSchema = ((IXSDModelRoot) modelRoot).getSchema();
         } else {
@@ -1516,6 +1511,7 @@
                 return false;
             }
 
+            INamespaceNode namespaceNode = getNamespaceNode((ITreeNode) dropTarget);
             targetSchema = (ISchema) namespaceNode.getModelObject();
         }
 
@@ -1557,6 +1553,9 @@
         }
 
         INamedObject sourceModelObject = (INamedObject) ClipboardService.getModelObjectFromClipboard();
+        if (sourceModelObject == null) {
+            return;
+        }
 
         copyTypeAndSelectItOnTree(targetSchema, sourceModelObject);
     }
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/clipboard/ClipboardService.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/ClipboardService.java
similarity index 87%
rename from plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/clipboard/ClipboardService.java
rename to plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/ClipboardService.java
index b1b62b1..09640aa 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/clipboard/ClipboardService.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/ClipboardService.java
@@ -1,4 +1,4 @@
-package org.eclipse.wst.sse.sieditor.ui.v2.clipboard;
+package org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard;
 
 import java.io.ByteArrayOutputStream;
 import java.io.UnsupportedEncodingException;
@@ -19,7 +19,9 @@
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.sse.sieditor.core.common.Logger;
 import org.eclipse.wst.sse.sieditor.model.api.IModelObject;
+import org.eclipse.wst.sse.sieditor.model.xsd.api.IType;
 import org.eclipse.wst.sse.sieditor.ui.v2.dt.dnd.SiEditorTransfer;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.IDataTypesTreeNode;
 import org.eclipse.wst.wsdl.WSDLElement;
 import org.eclipse.xsd.XSDConcreteComponent;
 import org.w3c.dom.Node;
@@ -83,4 +85,14 @@
         Clipboard clipboard = new Clipboard(Display.getCurrent());
         return (IModelObject) clipboard.getContents(SiEditorTransfer.getInstance());
     }
+
+    public static boolean isCopyEnabled(Object selectedNode) {
+        if (!(selectedNode instanceof IDataTypesTreeNode)) {
+            return false;
+        }
+
+        final IModelObject modelObject = ((IDataTypesTreeNode) selectedNode).getModelObject();
+        return modelObject instanceof IType;
+    }
+
 }
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/handlers/CopyHandler.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/handlers/CopyHandler.java
new file mode 100644
index 0000000..5b7a681
--- /dev/null
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/handlers/CopyHandler.java
@@ -0,0 +1,57 @@
+package org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.wst.sse.sieditor.ui.i18n.Messages;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.ClipboardService;
+import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.IDataTypesTreeNode;
+import org.eclipse.wst.sse.sieditor.ui.v2.nodes.ITreeNode;
+
+public class CopyHandler extends AbstractHandler {
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        ITreeNode selectedTreeNode = getSelectedTreeNode();
+
+        if (!ClipboardService.isCopyEnabled((IDataTypesTreeNode) selectedTreeNode)) {
+            showNotPosibleDialog();
+            return null;
+        }
+
+        ClipboardService.copyModelObjectToClipboard(selectedTreeNode.getModelObject());
+
+        return null;
+    }
+
+    private ITreeNode getSelectedTreeNode() {
+        Control focusControl = Display.getCurrent().getFocusControl();
+        if (!(focusControl instanceof Tree)) {
+            return null;
+        }
+
+        Tree tree = (Tree) focusControl;
+        TreeItem[] selection = tree.getSelection();
+        if (selection.length != 1) {
+            return null;
+        }
+
+        Object selectionData = selection[0].getData();
+        if (selectionData instanceof ITreeNode) {
+            return (ITreeNode) selectionData;
+        }
+
+        return null;
+    }
+
+    private void showNotPosibleDialog() {
+        MessageDialog.open(MessageDialog.INFORMATION, Display.getDefault().getActiveShell(),
+                Messages.CopyHandler_CopyNotPossibleMessageTitle, Messages.CopyHandler_CopyNotPossibleMessage, SWT.NONE);
+    }
+}
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/handlers/PasteHandler.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/handlers/PasteHandler.java
similarity index 96%
rename from plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/handlers/PasteHandler.java
rename to plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/handlers/PasteHandler.java
index aa971a0..d5b68f0 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/handlers/PasteHandler.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/clipboard/handlers/PasteHandler.java
@@ -1,4 +1,4 @@
-package org.eclipse.wst.sse.sieditor.ui.v2.dt.handlers;
+package org.eclipse.wst.sse.sieditor.ui.v2.dt.clipboard.handlers;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
diff --git a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/handlers/CopyHandler.java b/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/handlers/CopyHandler.java
deleted file mode 100644
index 89d16c5..0000000
--- a/plugins/org.eclipse.wst.sse.sieditor.ui/api/org/eclipse/wst/sse/sieditor/ui/v2/dt/handlers/CopyHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.eclipse.wst.sse.sieditor.ui.v2.dt.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.wst.sse.sieditor.ui.v2.clipboard.ClipboardService;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.IElementNode;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.ISimpleTypeNode;
-import org.eclipse.wst.sse.sieditor.ui.v2.dt.nodes.IStructureTypeNode;
-import org.eclipse.wst.sse.sieditor.ui.v2.nodes.ITreeNode;
-
-public class CopyHandler extends AbstractHandler {
-
-    @Override
-    public Object execute(ExecutionEvent event) throws ExecutionException {
-        ITreeNode selectedTreeNode = getSelectedTreeNode();
-        if (selectedTreeNode == null) {
-            return null;
-        }
-
-        ClipboardService.copyModelObjectToClipboard(selectedTreeNode.getModelObject());
-
-        return null;
-    }
-
-    private ITreeNode getSelectedTreeNode() {
-        Control focusControl = Display.getCurrent().getFocusControl();
-        if (!(focusControl instanceof Tree)) {
-            return null;
-        }
-
-        Tree tree = (Tree) focusControl;
-        TreeItem[] selection = tree.getSelection();
-        if (selection.length != 1) {
-            return null;
-        }
-
-        Object selectionData = selection[0].getData();
-        if (!(selectionData instanceof IStructureTypeNode || selectionData instanceof ISimpleTypeNode || selectionData instanceof IElementNode)) {
-            return null;
-        }
-
-        return (ITreeNode) selectionData;
-    }
-}