re-enable refactoring and search actions from design view
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
index 4c8e451..d46aa02 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-refactor/org/eclipse/wst/xsd/ui/internal/refactor/actions/XSDRefactorGroupActionDelegate.java
@@ -1,36 +1,16 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- *     IBM Corporation - initial API and implementation
- *     
- *******************************************************************************/
 package org.eclipse.wst.xsd.ui.internal.refactor.actions;
 
-import java.io.IOException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xsd.editor.ISelectionMapper;
+import org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorActionGroup;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorActionGroup;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupActionDelegate;
 import org.eclipse.wst.xsd.ui.internal.refactor.wizard.RefactorGroupSubMenu;
-import org.eclipse.xsd.XSDFactory;
 import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceImpl;
 
 public class XSDRefactorGroupActionDelegate extends RefactorGroupActionDelegate {
 
@@ -52,45 +32,19 @@
 				return;
 	
 			IEditorPart editor = site.getPage().getActiveEditor();
-			if (editor != null) {
-				IEditorInput editorInput = editor.getEditorInput();
-				if(editorInput instanceof IFileEditorInput){
-					IFileEditorInput fileInput = (IFileEditorInput)editorInput;
-					XSDSchema schema = createXMLSchema(fileInput.getFile(), resourceSet);
-					RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(fSelection, schema);
+			if (editor != null) {              
+                XSDSchema schema = (XSDSchema)editor.getAdapter(XSDSchema.class);
+                ISelectionMapper mapper = (ISelectionMapper)editor.getAdapter(ISelectionMapper.class);
+			    if (schema != null)
+                {                
+                    ISelection selection = mapper != null ? mapper.mapSelection(fSelection) : fSelection;                    
+					RefactorActionGroup refactorMenuGroup = new XSDRefactorActionGroup(selection, schema);
 					RefactorGroupSubMenu subMenu = new RefactorGroupSubMenu(refactorMenuGroup);
 					subMenu.fill(menu, -1);
-				}
-				
+				}				
 			}
 		
 		}
 	
 	}
-	
-	public static XSDSchema createXMLSchema(IFile file, ResourceSet set)  {
-		
-		URI uri = URI.createFileURI(file.getLocation().toString());
-		XSDSchema schema = XSDFactory.eINSTANCE.createXSDSchema();
-		// we need this model to be able to get locations
-		try {
-			IStructuredModel structuredModel = StructuredModelManager.getModelManager().getModelForEdit(file);
-			IDOMModel domModel = (IDOMModel) structuredModel;
-			Resource xsdResource = new XSDResourceImpl();
-			xsdResource.setURI(uri);
-			schema = XSDFactory.eINSTANCE.createXSDSchema();
-			xsdResource.getContents().add(schema);
-			schema.setElement(domModel.getDocument().getDocumentElement());
-			if(set != null){
-				set.getResources().add(xsdResource);
-			}
-		} catch (IOException e) {
-			// do nothing
-		} catch (CoreException e) {
-			// do nothing
-		}
-		return schema;
-	}
-
-
 }