diff options
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor')
92 files changed, 0 insertions, 5421 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java deleted file mode 100644 index f2a74acc7d..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/BaseHyperlinkDetector.java +++ /dev/null @@ -1,267 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - *******************************************************************************/ - -package org.eclipse.wst.xsd.ui.internal.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.Region; -import org.eclipse.jface.text.hyperlink.IHyperlink; -import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; -import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; -import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion; -import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion; -import org.eclipse.wst.sse.core.utils.StringUtils; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -/** - * Base class for hyperlinks detectors. Provides a framework and common code for - * hyperlink detectors. TODO: Can we pull this class further up the inheritance - * hierarchy? - */ -public abstract class BaseHyperlinkDetector implements IHyperlinkDetector -{ - /* - * (non-Javadoc) - */ - public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) - { - if (region == null || textViewer == null) - { - return null; - } - - List hyperlinks = new ArrayList(0); - IDocument document = textViewer.getDocument(); - int offset = region.getOffset(); - - IDOMNode node = getCurrentNode(document, offset); - - // This call allows us to determine whether an attribute is linkable, - // without incurring the cost of asking for the target component. - - if (!isLinkable(node)) - { - return null; - } - - IRegion hyperlinkRegion = getHyperlinkRegion(node); - - // createHyperlink is a template method. Derived classes, should override. - - IHyperlink hyperlink = createHyperlink(document, node, hyperlinkRegion); - - if (hyperlink != null) - { - hyperlinks.add(hyperlink); - } - - if (hyperlinks.size() == 0) - { - return null; - } - - return (IHyperlink[]) hyperlinks.toArray(new IHyperlink[0]); - } - - /** - * Determines whether a node is "linkable" that is, the component it refers to - * can be the target of a "go to definition" navigation. - * - * @param node the node to test, must not be null; - * @return true if the node is linkable, false otherwise. - */ - private boolean isLinkable(IDOMNode node) - { - if (node == null) - { - return false; - } - - short nodeType = node.getNodeType(); - - boolean isLinkable = false; - - if (nodeType == Node.ATTRIBUTE_NODE) - { - IDOMAttr attr = (IDOMAttr) node; - String name = attr.getName(); - - // isLinkableAttribute is a template method. Derived classes should - // override. - - isLinkable = isLinkableAttribute(name); - } - - return isLinkable; - } - - /** - * Determines whether an attribute is "linkable" that is, the component it - * points to can be the target of a "go to definition" navigation. Derived - * classes should override. - * - * @param name the attribute name. Must not be null. - * @return true if the attribute is linkable, false otherwise. - */ - protected abstract boolean isLinkableAttribute(String name); - - /** - * Creates a hyperlink based on the selected node. Derived classes should - * override. - * - * @param document the source document. - * @param node the node under the cursor. - * @param region the text region to use to create the hyperlink. - * @return a new IHyperlink for the node or null if one cannot be created. - */ - protected abstract IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region); - - /** - * Locates the attribute node under the cursor. - * - * @param offset the cursor offset. - * @param parent the parent node - * @return an IDOMNode representing the attribute if one is found at the - * offset or null otherwise. - */ - protected IDOMNode getAttributeNode(int offset, IDOMNode parent) - { - IDOMAttr attrNode = null; - NamedNodeMap map = parent.getAttributes(); - - for (int index = 0; index < map.getLength(); index++) - { - attrNode = (IDOMAttr) map.item(index); - boolean located = attrNode.contains(offset); - if (located) - { - if (attrNode.hasNameOnly()) - { - attrNode = null; - } - break; - } - } - - if (attrNode == null) - { - return parent; - } - return attrNode; - } - - /** - * Returns the node the cursor is currently on in the document or null if no - * node is selected - * - * @param offset the current cursor offset. - * @return IDOMNode either element, doctype, text, attribute or null - */ - private IDOMNode getCurrentNode(IDocument document, int offset) - { - IndexedRegion inode = null; - IStructuredModel sModel = null; - - try - { - sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document); - inode = sModel.getIndexedRegion(offset); - if (inode == null) - inode = sModel.getIndexedRegion(offset - 1); - } - finally - { - if (sModel != null) - sModel.releaseFromRead(); - } - - if (inode instanceof IDOMNode) - { - IDOMNode node = (IDOMNode) inode; - - if (node.hasAttributes()) - { - node = getAttributeNode(offset, node); - } - return node; - } - - return null; - } - - /** - * Get the text region corresponding to an IDOMNode. - * - * @param node the node for which we want the text region. Must not be null. - * @return an IRegion for the node, or null if the node is not recognized. - */ - protected IRegion getHyperlinkRegion(IDOMNode node) - { - if (node == null) - { - return null; - } - - IRegion hyperRegion = null; - short nodeType = node.getNodeType(); - - switch (nodeType) - { - case Node.ELEMENT_NODE : - { - hyperRegion = new Region(node.getStartOffset(), node.getEndOffset() - node.getStartOffset()); - } - break; - case Node.ATTRIBUTE_NODE : - { - IDOMAttr att = (IDOMAttr) node; - - int regOffset = att.getValueRegionStartOffset(); - - // ISSUE: We are using a deprecated method here. Is there - // a better way to get what we need? - - ITextRegion valueRegion = att.getValueRegion(); - if (valueRegion != null) - { - int regLength = valueRegion.getTextLength(); - String attValue = att.getValueRegionText(); - - // Do not include quotes in attribute value region and only - // underline the actual value, not the quotes. - - if (StringUtils.isQuoted(attValue)) - { - regLength = regLength - 2; - regOffset++; - } - hyperRegion = new Region(regOffset, regLength); - } - } - break; - default : - // Do nothing. - break; - } - - return hyperRegion; - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java deleted file mode 100644 index a51c0fd84d..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/ISelectionMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.jface.viewers.ISelection; - -public interface ISelectionMapper -{ - ISelection mapSelection(ISelection selectedObject); -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java deleted file mode 100644 index f20eadbcb7..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/InternalXSDMultiPageEditor.java +++ /dev/null @@ -1,1080 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 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.editor; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPartFactory; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.KeyStroke; -import org.eclipse.gef.RootEditPart; -import org.eclipse.gef.ui.actions.ActionRegistry; -import org.eclipse.gef.ui.actions.GEFActionConstants; -import org.eclipse.gef.ui.actions.PrintAction; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.IPostSelectionProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.INavigationLocation; -import org.eclipse.ui.INavigationLocationProvider; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; -import org.eclipse.wst.sse.core.StructuredModelManager; -import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter; -import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; -import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; -import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion; -import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; -import org.eclipse.wst.sse.ui.StructuredTextEditor; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; -import org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter; -import org.eclipse.wst.xsd.ui.internal.adt.actions.AddFieldAction; -import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseDirectEditAction; -import org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction; -import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction; -import org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView; -import org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction; -import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer; -import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart; -import org.eclipse.wst.xsd.ui.internal.adt.editor.ADTMultiPageEditor; -import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorMode; -import org.eclipse.wst.xsd.ui.internal.adt.editor.EditorModeManager; -import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider; -import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject; -import org.eclipse.wst.xsd.ui.internal.adt.facade.IModel; -import org.eclipse.wst.xsd.ui.internal.adt.outline.ADTContentOutlinePage; -import org.eclipse.wst.xsd.ui.internal.adt.typeviz.TypeVizEditorMode; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyAttributeAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAnyElementAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeDeclarationAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDAttributeGroupDefinitionAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDComplexTypeDefinitionAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDElementAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDModelGroupDefinitionAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSchemaDirectiveAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.AddXSDSimpleTypeDefinitionAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.OpenInNewEditor; -import org.eclipse.wst.xsd.ui.internal.common.actions.SetMultiplicityAction; -import org.eclipse.wst.xsd.ui.internal.common.actions.SetTypeAction; -import org.eclipse.wst.xsd.ui.internal.common.properties.sections.IDocumentChangedNotifier; -import org.eclipse.wst.xsd.ui.internal.navigation.DesignViewNavigationLocation; -import org.eclipse.wst.xsd.ui.internal.navigation.MultiPageEditorTextSelectionNavigationLocation; -import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter; -import org.eclipse.wst.xsd.ui.internal.utils.OpenOnSelectionHelper; -import org.eclipse.xsd.XSDComponent; -import org.eclipse.xsd.XSDCompositor; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDSchema; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -public class InternalXSDMultiPageEditor extends ADTMultiPageEditor implements ITabbedPropertySheetPageContributor, INavigationLocationProvider -{ - // IModel model; - IStructuredModel structuredModel; - XSDSchema xsdSchema; - XSDModelAdapter schemaNodeAdapter; - private OutlineTreeSelectionChangeListener fOutlineListener; - private SourceEditorSelectionListener fSourceEditorSelectionListener; - private XSDSelectionManagerSelectionListener fXSDSelectionListener; - private InternalDocumentChangedNotifier internalDocumentChangedNotifier = new InternalDocumentChangedNotifier(); - private static final String XSD_EDITOR_MODE_EXTENSION_ID = "org.eclipse.wst.xsd.ui.editorModes"; //$NON-NLS-N$ - private XSDPreferenceStoreListener xsdPreferenceStoreListener; - - class InternalDocumentChangedNotifier implements IDocumentChangedNotifier - { - List list = new ArrayList(); - - public void addListener(INodeAdapter adapter) - { - list.add(adapter); - } - - public void removeListener(INodeAdapter adapter) - { - list.remove(adapter); - } - - public void notifyListeners(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) - { - List clone = new ArrayList(list.size()); - clone.addAll(list); - for (Iterator i = clone.iterator(); i.hasNext(); ) - { - INodeAdapter adapter = (INodeAdapter)i.next(); - adapter.notifyChanged(notifier, eventType, changedFeature, oldValue, newValue, pos); - } - } - } - public IModel buildModel() - { - try - { - IEditorInput editorInput = getEditorInput(); - - // If the input schema is from the WSDL Editor, then use that inline schema - if (editorInput instanceof XSDFileEditorInput) - { - xsdSchema = ((XSDFileEditorInput) editorInput).getSchema(); - model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema); - } - - Document document = null; - IDocument doc = structuredTextEditor.getDocumentProvider().getDocument(getEditorInput()); - if (doc instanceof IStructuredDocument) - { - IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForEdit(doc); - if (model == null) { - model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) doc); - } - structuredModel = model; - document = ((IDOMModel)model).getDocument(); - } - Assert.isNotNull(document); - - if (model != null) - return model; - - xsdSchema = XSDModelAdapter.lookupOrCreateSchema(document); - model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema); - } - catch (Exception e) { - e.printStackTrace(); - } - - -// try -// { -// EPackage.Registry reg = EPackage.Registry.INSTANCE; -// XSDPackage xsdPackage = (XSDPackage) reg.getEPackage(XSDPackage.eNS_URI); -// xsdSchema = xsdPackage.getXSDFactory().createXSDSchema(); -// resourceSet = XSDSchemaImpl.createResourceSet(); -// IFile resourceFile = editorInput.getFile(); -// structuredModel = StructuredModelManager.getModelManager().getModelForEdit(resourceFile); -// // If the resource is in the workspace.... -// // otherwise the user is trying to open an external file -// if (resourceFile != null) -// { -// String pathName = resourceFile.getFullPath().toString(); -// xsdResource = resourceSet.getResource(URI.createPlatformResourceURI(pathName), true); -// resourceSet.getResources().add(xsdResource); -// Object obj = xsdResource.getContents().get(0); -// if (obj instanceof XSDSchema) -// { -// xsdSchema = (XSDSchema) obj; -// xsdSchema.setElement(((IDOMModel) structuredModel).getDocument().getDocumentElement()); -// model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema); -// } -// -// // If the input schema is from the WSDL Editor, then use that inline schema -// if (editorInput instanceof XSDFileEditorInput) -// { -// xsdSchema = ((XSDFileEditorInput) editorInput).getSchema(); -// model = (IModel) XSDAdapterFactory.getInstance().adapt(xsdSchema); -// } -// if (xsdSchema.getElement() != null) -// -// // TODO (cs) ... we need to look into performance issues when we add elements -// // seems to be that formatting is causig lots of notification and things get terribly slow -// // I'm specializing the method below to add an isModelStateChanging check that should -// // help here ... but we need to investigate further -// new XSDModelReconcileAdapter(xsdSchema.getElement().getOwnerDocument(), xsdSchema) -// { -// public void handleNotifyChange(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int index) -// { -// if (notifier instanceof NodeImpl) -// { -// NodeImpl nodeImpl = (NodeImpl)notifier; -// if (!nodeImpl.getModel().isModelStateChanging()) -// { -// super.handleNotifyChange(notifier, eventType, feature, oldValue, newValue, index); -// internalDocumentChangedNotifier.notifyListeners(notifier, eventType, feature, oldValue, newValue, index); -// } -// } -// } -// }; -// xsdResource.setModified(false); -// } -// } -// catch (StackOverflowError e) -// { -// } -// catch (Exception ex) -// { -// } - return model; - } - - public void dispose() - { - if (structuredModel != null) - { - structuredModel.releaseFromEdit(); - structuredModel = null; - } - - if (schemaNodeAdapter != null) - { - schemaNodeAdapter.clear(); - schemaNodeAdapter = null; - } - - if (fOutlinePage != null) - { -// if (fOutlinePage instanceof ConfigurableContentOutlinePage && fOutlineListener != null) -// { -// ((ConfigurableContentOutlinePage) fOutlinePage).removeDoubleClickListener(fOutlineListener); -// } - if (fOutlineListener != null) - { - fOutlinePage.removeSelectionChangedListener(fOutlineListener); - } - } - getSelectionManager().removeSelectionChangedListener(fXSDSelectionListener); - XSDEditorPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(xsdPreferenceStoreListener); - xsdPreferenceStoreListener = null; - super.dispose(); - } - - protected void initializeGraphicalViewer() - { - RootContentEditPart root = new RootContentEditPart(); - if (!(getEditorInput() instanceof XSDFileEditorInput)) - { - root.setModel(model); - } - graphicalViewer.setContents(root); - } - - protected void configureGraphicalViewer() - { - super.configureGraphicalViewer(); - graphicalViewer.getKeyHandler().put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT)); - // get edit part factory from extension - EditPartFactory editPartFactory = getEditorModeManager().getCurrentMode().getEditPartFactory(); - graphicalViewer.setEditPartFactory(editPartFactory); - } - - public Object getAdapter(Class type) - { - if (type == org.eclipse.ui.views.properties.IPropertySheetPage.class) - { - XSDTabbedPropertySheetPage page = new XSDTabbedPropertySheetPage(this); - return page; - } - else if (type == ISelectionProvider.class) - { - return getSelectionManager(); - } - else if (type == XSDSchema.class) - { - return xsdSchema; - } - else if (type == IContentOutlinePage.class) - { - Object adapter = super.getAdapter(type); - if (adapter != null) - { - IContentOutlinePage page = (IContentOutlinePage) adapter; - fOutlineListener = new OutlineTreeSelectionChangeListener(); - page.addSelectionChangedListener(fOutlineListener); - -// if (page instanceof ConfigurableContentOutlinePage) -// { -// ((ConfigurableContentOutlinePage) page).addDoubleClickListener(fOutlineListener); -// } - return page; - } - } - else if (type == XSDElementReferenceEditManager.class) - { - IEditorInput editorInput = getEditorInput(); - if (editorInput instanceof IFileEditorInput) - { - IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput; - // TODO (cs) currently we assume the schema editor will only ever edit a - // single schema - /// but if we want to enable the schema editor to edit wsdl files we - // should pass in - // an array of schemas - // hmm.. perhaps just pass in a ResourceSet - XSDSchema[] schemas = {xsdSchema}; - return new XSDElementReferenceEditManager(fileEditorInput.getFile(), schemas); - } - } - else if (type == XSDTypeReferenceEditManager.class) - { - IEditorInput editorInput = getEditorInput(); - if (editorInput instanceof IFileEditorInput) - { - IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput; - // TODO (cs) currently we assume the schema editor will only ever edit a - // single schema - // but if we want to enable the schema editor to edit wsdl files we - // should pass in - // an array of schemas - // hmm.. perhaps just pass in a ResourceSet - XSDSchema[] schemas = {xsdSchema}; - return new XSDTypeReferenceEditManager(fileEditorInput.getFile(), schemas); - } - } - else if (type == XSDComplexTypeBaseTypeEditManager.class) - { - IEditorInput editorInput = getEditorInput(); - if (editorInput instanceof IFileEditorInput) - { - IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput; - // TODO (cs) currently we assume the schema editor will only ever edit a - // single schema - // but if we want to enable the schema editor to edit wsdl files we - // should pass in - // an array of schemas - // hmm.. perhaps just pass in a ResourceSet - XSDSchema[] schemas = {xsdSchema}; - return new XSDComplexTypeBaseTypeEditManager(fileEditorInput.getFile(), schemas); - } - } - else if (type == XSDSubstitutionGroupEditManager.class) - { - IEditorInput editorInput = getEditorInput(); - if (editorInput instanceof IFileEditorInput) - { - IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput; - XSDSchema[] schemas = {xsdSchema}; - return new XSDSubstitutionGroupEditManager(fileEditorInput.getFile(), schemas); - } - } - else if (type == ITextEditor.class) - { - return getTextEditor(); - } - else if (type == ISelectionMapper.class) - { - return new XSDSelectionMapper(); - } - else if (type == IDocumentChangedNotifier.class) - { - return internalDocumentChangedNotifier; - } - else if (type == ProductCustomizationProvider.class) - { - return XSDEditorPlugin.getPlugin().getProductCustomizationProvider(); - } - return super.getAdapter(type); - } - - public String getContributorId() - { - return "org.eclipse.wst.xsd.ui.internal.editor"; //$NON-NLS-1$ - } - - public XSDSchema getXSDSchema() - { - return xsdSchema; - } - - /** - * Method openOnGlobalReference. The comp argument is a resolved xsd schema - * object from another file. This is created and called from another schema - * model to allow F3 navigation to open a new editor and choose the referenced - * object within that editor context - * - * @param comp - */ - public void openOnGlobalReference(XSDConcreteComponent comp) - { - XSDConcreteComponent namedComponent = openOnSelectionHelper.openOnGlobalReference(comp); - - if (namedComponent == null) - { - namedComponent = getXSDSchema(); - } - XSDBaseAdapter adapter = (XSDBaseAdapter) XSDAdapterFactory.getInstance().adapt(namedComponent); - getSelectionManager().setSelection(new StructuredSelection(adapter)); - IAction action = getActionRegistry().getAction(SetInputToGraphView.ID); - if (action != null) - { - action.run(); - } - - } - - protected OpenOnSelectionHelper openOnSelectionHelper; - - public OpenOnSelectionHelper getOpenOnSelectionHelper() - { - return openOnSelectionHelper; - } - - /** - * Creates the pages of the multi-page editor. - */ - protected void createPages() - { - super.createPages(); - -// selectionProvider = getSelectionManager(); -// getEditorSite().setSelectionProvider(selectionProvider); -// -// structuredTextEditor = new StructuredTextEditor(); -// model = buildModel((IFileEditorInput) getEditorInput()); -// createGraphPage(); -// createSourcePage(); - - openOnSelectionHelper = new OpenOnSelectionHelper(getTextEditor(), getXSDSchema()); - - ISelectionProvider provider = getTextEditor().getSelectionProvider(); - fSourceEditorSelectionListener = new SourceEditorSelectionListener(); - if (provider instanceof IPostSelectionProvider) - { - ((IPostSelectionProvider) provider).addPostSelectionChangedListener(fSourceEditorSelectionListener); - } - else - { - provider.addSelectionChangedListener(fSourceEditorSelectionListener); - } - fXSDSelectionListener = new XSDSelectionManagerSelectionListener(); - getSelectionManager().addSelectionChangedListener(fXSDSelectionListener); - - // Select the schema to show the properties - getSelectionManager().setSelection(new StructuredSelection(getModel())); - - xsdPreferenceStoreListener = new XSDPreferenceStoreListener(); - XSDEditorPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(xsdPreferenceStoreListener); - } - - protected class XSDPreferenceStoreListener implements IPropertyChangeListener - { - public void propertyChange(PropertyChangeEvent evt) - { - String property = evt.getProperty(); - if (XSDEditorPlugin.CONST_SHOW_EXTERNALS.equals(property)) - { - ((GraphicalEditPart) graphicalViewer.getContents()).getFigure().invalidateTree(); - graphicalViewer.getContents().refresh(); - } - } - } - - protected void createActions() - { - super.createActions(); - ActionRegistry registry = getActionRegistry(); - BaseSelectionAction action = new AddFieldAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new DeleteAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDElementAction(this, AddXSDElementAction.ID, Messages._UI_ACTION_ADD_ELEMENT, false); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDElementAction(this, AddXSDElementAction.REF_ID, Messages._UI_ACTION_ADD_ELEMENT_REF, true); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDModelGroupAction(this, XSDCompositor.SEQUENCE_LITERAL, AddXSDModelGroupAction.SEQUENCE_ID); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDModelGroupAction(this, XSDCompositor.CHOICE_LITERAL, AddXSDModelGroupAction.CHOICE_ID); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDModelGroupAction(this, XSDCompositor.ALL_LITERAL, AddXSDModelGroupAction.ALL_ID); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDModelGroupDefinitionAction(this, false); - action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITION_ID); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDModelGroupDefinitionAction(this, true); - action.setId(AddXSDModelGroupDefinitionAction.MODELGROUPDEFINITIONREF_ID); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDComplexTypeDefinitionAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDSimpleTypeDefinitionAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDAttributeDeclarationAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDAttributeDeclarationAction(this, AddXSDAttributeDeclarationAction.REF_ID, Messages._UI_ACTION_ADD_ATTRIBUTE_REF, true); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new OpenInNewEditor(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new ShowPropertiesViewAction(this); - registry.registerAction(action); - action = new AddXSDAttributeGroupDefinitionAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDAttributeGroupDefinitionAction(this, AddXSDAttributeGroupDefinitionAction.REF_ID); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new DeleteXSDConcreteComponentAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - action = new AddXSDAnyElementAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - - action = new AddXSDAnyAttributeAction(this); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - - action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.INCLUDE_ID, Messages._UI_ACTION_ADD_INCLUDE); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - - action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.IMPORT_ID, Messages._UI_ACTION_ADD_IMPORT); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - - action = new AddXSDSchemaDirectiveAction(this, AddXSDSchemaDirectiveAction.REDEFINE_ID, Messages._UI_ACTION_ADD_REDEFINE); - action.setSelectionProvider(getSelectionManager()); - registry.registerAction(action); - - SetTypeAction setNewComplexTypeAction = new SetTypeAction(Messages._UI_ACTION_NEW, SetTypeAction.SET_NEW_TYPE_ID, this); - setNewComplexTypeAction.setSelectionProvider(getSelectionManager()); - registry.registerAction(setNewComplexTypeAction); - - SetTypeAction setExistingTypeAction = new SetTypeAction(Messages._UI_ACTION_BROWSE, SetTypeAction.SELECT_EXISTING_TYPE_ID, this); - setExistingTypeAction.setSelectionProvider(getSelectionManager()); - registry.registerAction(setExistingTypeAction); - - addMultiplicityMenu(registry); - - PrintAction printAction = new PrintAction(this); - registry.registerAction(printAction); - - BaseDirectEditAction directEditAction = new BaseDirectEditAction(this); - directEditAction.setSelectionProvider(getSelectionManager()); - registry.registerAction(directEditAction); - } - - protected void addMultiplicityMenu(ActionRegistry registry) - { - SetMultiplicityAction oneMultiplicity = new SetMultiplicityAction(this, "1..1 (" + Messages._UI_LABEL_REQUIRED + ")", SetMultiplicityAction.REQUIRED_ID); //$NON-NLS-1$ //$NON-NLS-2$ - oneMultiplicity.setMaxOccurs(1); - oneMultiplicity.setMinOccurs(1); - oneMultiplicity.setSelectionProvider(getSelectionManager()); - registry.registerAction(oneMultiplicity); - - SetMultiplicityAction zeroOrMoreMultiplicity = new SetMultiplicityAction(this, "0..* (" + Messages._UI_LABEL_ZERO_OR_MORE + ")", SetMultiplicityAction.ZERO_OR_MORE_ID); //$NON-NLS-1$ //$NON-NLS-2$ - zeroOrMoreMultiplicity.setMaxOccurs(-1); - zeroOrMoreMultiplicity.setMinOccurs(0); - zeroOrMoreMultiplicity.setSelectionProvider(getSelectionManager()); - registry.registerAction(zeroOrMoreMultiplicity); - - SetMultiplicityAction zeroOrOneMultiplicity = new SetMultiplicityAction(this, "0..1 (" + Messages._UI_LABEL_OPTIONAL + ")", SetMultiplicityAction.ZERO_OR_ONE_ID); //$NON-NLS-1$ //$NON-NLS-2$ - zeroOrOneMultiplicity.setMaxOccurs(1); - zeroOrOneMultiplicity.setMinOccurs(0); - zeroOrOneMultiplicity.setSelectionProvider(getSelectionManager()); - registry.registerAction(zeroOrOneMultiplicity); - - SetMultiplicityAction oneOrMoreMultiplicity = new SetMultiplicityAction(this, "1..* (" + Messages._UI_LABEL_ONE_OR_MORE + ")", SetMultiplicityAction.ONE_OR_MORE_ID); //$NON-NLS-1$ //$NON-NLS-2$ - oneOrMoreMultiplicity.setMaxOccurs(-1); - oneOrMoreMultiplicity.setMinOccurs(1); - oneOrMoreMultiplicity.setSelectionProvider(getSelectionManager()); - registry.registerAction(oneOrMoreMultiplicity); - - } - - /** - * Listener on SSE's outline page's selections that converts DOM selections - * into xsd selections and notifies XSD selection manager - */ - class OutlineTreeSelectionChangeListener implements ISelectionChangedListener, IDoubleClickListener - { - public OutlineTreeSelectionChangeListener() - { - } - - private ISelection getXSDSelection(ISelection selection) - { - ISelection sel = null; - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - Object o = structuredSelection.getFirstElement(); - if (o != null) - { - sel = new StructuredSelection(o); - } - - } - return sel; - } - - /** - * Determines DOM node based on object (xsd node) - * - * @param object - * @return - */ - private Object getObjectForOtherModel(Object object) - { - Node node = null; - if (object instanceof Node) - { - node = (Node) object; - } - else if (object instanceof XSDComponent) - { - node = ((XSDComponent) object).getElement(); - } - else if (object instanceof CategoryAdapter) - { - node = ((CategoryAdapter) object).getXSDSchema().getElement(); - } - else if (object instanceof XSDBaseAdapter) - { - if (((XSDBaseAdapter) object).getTarget() instanceof XSDConcreteComponent) - { - node = ((XSDConcreteComponent) ((XSDBaseAdapter) object).getTarget()).getElement(); - } - } - // the text editor can only accept sed nodes! - // - if (!(node instanceof IDOMNode)) - { - node = null; - } - return node; - } - - public void doubleClick(DoubleClickEvent event) - { - /* - * Selection in outline tree changed so set outline tree's selection into - * editor's selection and say it came from outline tree - */ - if (getSelectionManager() != null && getSelectionManager().getEnableNotify()) - { - ISelection selection = getXSDSelection(event.getSelection()); - if (selection != null) - { - getSelectionManager().setSelection(selection, fOutlinePage); - } - if (getTextEditor() != null && selection instanceof IStructuredSelection) - { - int start = -1; - int length = 0; - Object o = ((IStructuredSelection) selection).getFirstElement(); - if (o != null) - o = getObjectForOtherModel(o); - if (o instanceof IndexedRegion) - { - start = ((IndexedRegion) o).getStartOffset(); - length = ((IndexedRegion) o).getEndOffset() - start; - } - if (start > -1) - { - getTextEditor().selectAndReveal(start, length); - } - } - } - } - - public void selectionChanged(SelectionChangedEvent event) - { - /* - * Selection in outline tree changed so set outline tree's selection into - * editor's selection and say it came from outline tree - */ - if (getSelectionManager() != null && getSelectionManager().getEnableNotify()) - { - ISelection selection = getXSDSelection(event.getSelection()); - if (selection != null) - { - getSelectionManager().setSelection(selection, fOutlinePage); - } - } - } - } - - - /** - * Listener on SSE's source editor's selections that converts DOM selections - * into xsd selections and notifies XSD selection manager - */ - private class SourceEditorSelectionListener implements ISelectionChangedListener - { - /** - * Determines XSD node based on object (DOM node) - * - * @param object - * @return - */ - private Object getXSDNode(Object object) - { - // get the element node - Element element = null; - if (object instanceof Node) - { - Node node = (Node) object; - if (node != null) - { - if (node.getNodeType() == Node.ELEMENT_NODE) - { - element = (Element) node; - } - else if (node.getNodeType() == Node.ATTRIBUTE_NODE) - { - element = ((Attr) node).getOwnerElement(); - } - } - } - Object o = element; - if (element != null) - { - Object modelObject = getXSDSchema().getCorrespondingComponent(element); - if (modelObject != null) - { - o = modelObject; - o = XSDAdapterFactory.getInstance().adapt((Notifier) modelObject); - } - } - return o; - } - - public void selectionChanged(SelectionChangedEvent event) - { - if (getSelectionManager().getEnableNotify() && getActivePage() == 1) - { - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection) - { - List xsdSelections = new ArrayList(); - for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) - { - Object domNode = i.next(); - Object xsdNode = getXSDNode(domNode); - if (xsdNode != null) - { - xsdSelections.add(xsdNode); - } - } - if (!xsdSelections.isEmpty()) - { - StructuredSelection xsdSelection = new StructuredSelection(xsdSelections); - getSelectionManager().setSelection(xsdSelection, getTextEditor().getSelectionProvider()); - } - } - } - } - } - /** - * Listener on XSD's selection manager's selections that converts XSD - * selections into DOM selections and notifies SSE's selection provider - */ - private class XSDSelectionManagerSelectionListener implements ISelectionChangedListener - { - /** - * Determines DOM node based on object (xsd node) - * - * @param object - * @return - */ - private Object getObjectForOtherModel(Object object) - { - Node node = null; - if (object instanceof Node) - { - node = (Node) object; - } - else if (object instanceof XSDComponent) - { - node = ((XSDComponent) object).getElement(); - } - else if (object instanceof CategoryAdapter) - { - node = ((CategoryAdapter) object).getXSDSchema().getElement(); - } - else if (object instanceof XSDBaseAdapter) - { - if (((XSDBaseAdapter) object).getTarget() instanceof XSDConcreteComponent) - { - node = ((XSDConcreteComponent) ((XSDBaseAdapter) object).getTarget()).getElement(); - } - } - else if (object instanceof String) - { - // This case was added to make the F3/hyperlink navigation work when an - // inline schema from a WSDL document is opened in the schema editor. - // The string is expected to be a URI fragment used to identify an XSD - // component in the context of the enclosing WSDL resource. - - String uriFragment = (String) object; - Resource resource = xsdSchema.eResource(); - EObject modelObject = resource.getEObject(uriFragment); - - if (modelObject != null && modelObject instanceof XSDComponent) - { - XSDComponent component = (XSDComponent) modelObject; - node = component.getElement(); - } - } - - // the text editor can only accept sed nodes! - // - if (!(node instanceof IDOMNode)) - { - node = null; - } - return node; - } - - public void selectionChanged(SelectionChangedEvent event) - { - // do not fire selection in source editor if the current active page is the InternalXSDMultiPageEditor (source) - // We only want to make source selections if the active page is either the outline or properties (a modify - // has been done via the outline or properties and not the source view). We don't want to be selecting - // and unselecting things in the source when editing in the source!! - boolean makeSelection = true; - if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) { - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - if (page.getActivePart() instanceof InternalXSDMultiPageEditor) { - if (getActiveEditor() instanceof StructuredTextEditor) { - makeSelection = false; - } - } - } - - // do not fire selection in source editor if selection event came - // from source editor - if (event.getSource() != getTextEditor().getSelectionProvider() && makeSelection) - { - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection) - { - List otherModelObjectList = new ArrayList(); - for (Iterator i = ((IStructuredSelection) selection).iterator(); i.hasNext();) - { - Object modelObject = i.next(); - Object otherModelObject = getObjectForOtherModel(modelObject); - if (otherModelObject != null) - { - otherModelObjectList.add(otherModelObject); - } - } - if (!otherModelObjectList.isEmpty()) - { - // here's an ugly hack... if we allow text selections to fire during - // SetInputToGraphView action we screw up the navigation history! - // - //TODO (cs) ... we need to prevent the source editor from messing up the navigation history - // - if (getActivePage() == SOURCE_PAGE_INDEX) - { - StructuredSelection nodeSelection = new StructuredSelection(otherModelObjectList); - getTextEditor().getSelectionProvider().setSelection(nodeSelection); - } - } - } - } - } - - public void doSetSelection() - { - ISelection iSelection = getSelectionManager().getSelection(); - if (iSelection != null) - { - Object firstElement = ((StructuredSelection)iSelection).getFirstElement(); - Object otherModelObject = getObjectForOtherModel(firstElement); - if (otherModelObject != null) - { - StructuredSelection nodeSelection = new StructuredSelection(otherModelObject); - getTextEditor().getSelectionProvider().setSelection(nodeSelection); - } - } - } - } - - // Bug 145590. Workaround to update source position when flipping to the source page. - // Unfortunately, this will still add an entry to the navigation history, but this - // behaviour is an improvement than without this change - boolean doUpdateSourceLocation = false; - protected void pageChange(int newPageIndex) - { - super.pageChange(newPageIndex); - doUpdateSourceLocation = newPageIndex == SOURCE_PAGE_INDEX; - if (doUpdateSourceLocation && fXSDSelectionListener != null) - fXSDSelectionListener.doSetSelection(); - - } - - public INavigationLocation createEmptyNavigationLocation() - { - if (getActivePage() == 0) - { - return new DesignViewNavigationLocation(this); - } - else - { - return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), false); - } - } - - public INavigationLocation createNavigationLocation() - { - if (getActivePage() == DESIGN_PAGE_INDEX) - { - try - { - RootEditPart rootEditPart = graphicalViewer.getRootEditPart(); - EditPart editPart = rootEditPart.getContents(); - if (editPart instanceof RootContentEditPart) - { - RootContentEditPart rootContentEditPart = (RootContentEditPart)editPart; - Object input = rootContentEditPart.getInput(); - if (input instanceof Adapter) - { - XSDConcreteComponent concreteComponent = (XSDConcreteComponent)((Adapter)input).getTarget(); - return new DesignViewNavigationLocation(this, concreteComponent); - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - return null; - } - else - { - return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), true); - } - } - - - public void editorModeChanged(EditorMode newEditorMode) - { - //if (isInitializing) - // return; - - EditPartFactory editPartFactory = newEditorMode.getEditPartFactory(); - if (editPartFactory != null) - { - graphicalViewer.setEditPartFactory(editPartFactory); - if (graphicalViewer instanceof DesignViewGraphicalViewer) - { - DesignViewGraphicalViewer viewer = (DesignViewGraphicalViewer)graphicalViewer; - IADTObject input = viewer.getInput(); - viewer.setInput(null); - //viewer.getRootEditPart().refresh(); - // viewer.getRootEditPart().getContents().refresh(); - viewer.setInput(input); - - floatingToolbar.setEditPartFactory(editPartFactory); - floatingToolbar.setModel(getModel()); - floatingToolbar.refresh(!(input instanceof IModel)); - - Control control = graphicalViewer.getControl(); - if (control instanceof Composite) - { - Composite parent = ((Composite)control).getParent(); - parent.layout(); - } - } - } - IContentProvider provider = newEditorMode.getOutlineProvider(); - if (provider != null) - { - ADTContentOutlinePage outline = (ADTContentOutlinePage)getContentOutlinePage(); - if (outline != null) - { - TreeViewer treeViewer = outline.getTreeViewer(); - if (treeViewer != null) - { - outline.getTreeViewer().setContentProvider(provider); - outline.getTreeViewer().refresh(); - } - } - } - } - - private static final String DEFAULT_EDITOR_MODE_ID = "org.eclipse.wst.xsd.ui.defaultEditorModeId"; //$NON-NLS-1$ - //private boolean isInitializing = false; - protected EditorModeManager createEditorModeManager() - { - final ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider)getAdapter(ProductCustomizationProvider.class); - EditorModeManager manager = new EditorModeManager(XSD_EDITOR_MODE_EXTENSION_ID) - { - public void init() - { - if (productCustomizationProvider == null || - productCustomizationProvider.isEditorModeApplicable(TypeVizEditorMode.ID)) - { - addMode(new TypeVizEditorMode()); - } - super.init(); - } - - protected EditorMode getDefaultMode() - { - String defaultModeId = XSDEditorPlugin.getPlugin().getPreferenceStore().getString(DEFAULT_EDITOR_MODE_ID); - if (defaultModeId != null) - { - EditorMode editorMode = getEditorMode(defaultModeId); - if (editorMode != null) - { - return editorMode; - } - } - return super.getDefaultMode(); - } - }; - manager.setProductCustomizationProvider(productCustomizationProvider); - return manager; - } - - protected void storeCurrentModePreference(String id) - { - XSDEditorPlugin.getPlugin().getPreferenceStore().setValue(DEFAULT_EDITOR_MODE_ID, id); - } - -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java deleted file mode 100644 index d8fb8473ca..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/KeyboardDragImpl.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.wst.xsd.ui.internal.adt.design.IKeyboardDrag; - -public class KeyboardDragImpl implements IKeyboardDrag { - - public void performKeyboardDrag(GraphicalEditPart movingElement, int direction) { - - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java deleted file mode 100644 index 41274520a4..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Logger.java +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.editor; - -import com.ibm.icu.util.StringTokenizer; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.osgi.framework.Bundle; - -/** - * Small convenience class to log messages to plugin's log file and also, if - * desired, the console. This class should only be used by classes in this - * plugin. Other plugins should make their own copy, with appropriate ID. - */ -public class Logger { - private static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui"; //$NON-NLS-1$ - - public static final int ERROR = IStatus.ERROR; // 4 - public static final int ERROR_DEBUG = 200 + ERROR; - public static final int INFO = IStatus.INFO; // 1 - public static final int INFO_DEBUG = 200 + INFO; - - public static final int OK = IStatus.OK; // 0 - - public static final int OK_DEBUG = 200 + OK; - - private static final String TRACEFILTER_LOCATION = "/debug/tracefilter"; //$NON-NLS-1$ - public static final int WARNING = IStatus.WARNING; // 2 - public static final int WARNING_DEBUG = 200 + WARNING; - - /** - * Adds message to log. - * - * @param level - * severity level of the message (OK, INFO, WARNING, ERROR, - * OK_DEBUG, INFO_DEBUG, WARNING_DEBUG, ERROR_DEBUG) - * @param message - * text to add to the log - * @param exception - * exception thrown - */ - protected static void _log(int level, String message, Throwable exception) { - if (level == OK_DEBUG || level == INFO_DEBUG || level == WARNING_DEBUG || level == ERROR_DEBUG) { - if (!isDebugging()) - return; - } - - int severity = IStatus.OK; - switch (level) { - case INFO_DEBUG : - case INFO : - severity = IStatus.INFO; - break; - case WARNING_DEBUG : - case WARNING : - severity = IStatus.WARNING; - break; - case ERROR_DEBUG : - case ERROR : - severity = IStatus.ERROR; - } - message = (message != null) ? message : "null"; //$NON-NLS-1$ - Status statusObj = new Status(severity, PLUGIN_ID, severity, message, exception); - Bundle bundle = Platform.getBundle(PLUGIN_ID); - if (bundle != null) - Platform.getLog(bundle).log(statusObj); - } - - /** - * Prints message to log if category matches /debug/tracefilter option. - * - * @param message - * text to print - * @param category - * category of the message, to be compared with - * /debug/tracefilter - */ - protected static void _trace(String category, String message, Throwable exception) { - if (isTracing(category)) { - message = (message != null) ? message : "null"; //$NON-NLS-1$ - Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception); - Bundle bundle = Platform.getBundle(PLUGIN_ID); - if (bundle != null) - Platform.getLog(bundle).log(statusObj); - } - } - - /** - * @return true if the platform is debugging - */ - public static boolean isDebugging() { - return Platform.inDebugMode(); - } - - /** - * Determines if currently tracing a category - * - * @param category - * @return true if tracing category, false otherwise - */ - public static boolean isTracing(String category) { - if (!isDebugging()) - return false; - - String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION); - if (traceFilter != null) { - StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$ - while (tokenizer.hasMoreTokens()) { - String cat = tokenizer.nextToken().trim(); - if (category.equals(cat)) { - return true; - } - } - } - return false; - } - - public static void log(int level, String message) { - _log(level, message, null); - } - - public static void log(int level, String message, Throwable exception) { - _log(level, message, exception); - } - - public static void logException(String message, Throwable exception) { - _log(ERROR, message, exception); - } - - public static void logException(Throwable exception) { - _log(ERROR, exception.getMessage(), exception); - } - - public static void trace(String category, String message) { - _trace(category, message, null); - } - - public static void traceException(String category, String message, Throwable exception) { - _trace(category, message, exception); - } - - public static void traceException(String category, Throwable exception) { - _trace(category, exception.getMessage(), exception); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java deleted file mode 100644 index 5ae183f559..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/Messages.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS -{ - static - { - NLS.initializeMessages("org.eclipse.wst.xsd.ui.internal.editor.messages", Messages.class); //$NON-NLS-1$ - } - - public Messages() - { - super(); - } - - public static String UI_LABEL_BASE_TYPE; - public static String UI_LABEL_DERIVED_BY; - public static String UI_LABEL_INHERIT_FROM; - public static String UI_LABEL_INHERIT_BY; - public static String UI_LABEL_DOCUMENTATION; - public static String UI_LABEL_APP_INFO; - public static String UI_LABEL_SET_TYPE; - public static String UI_LABEL_TYPE; - public static String UI_LABEL_NAME; - public static String UI_LABEL_KIND; - public static String UI_LABEL_MINOCCURS; - public static String UI_LABEL_MAXOCCURS; - public static String UI_NO_TYPE; - public static String UI_PAGE_HEADING_REFERENCE; - public static String UI_LABEL_READ_ONLY; - public static String UI_LABEL_COMPONENTS; - - public static String _UI_GRAPH_TYPES; - public static String _UI_GRAPH_ELEMENTS; - public static String _UI_GRAPH_ATTRIBUTES; - public static String _UI_GRAPH_ATTRIBUTE_GROUPS; - public static String _UI_GRAPH_NOTATIONS; - public static String _UI_GRAPH_IDENTITY_CONSTRAINTS; - public static String _UI_GRAPH_ANNOTATIONS; - public static String _UI_GRAPH_DIRECTIVES; - public static String _UI_GRAPH_GROUPS; - - public static String _UI_LABEL_NO_LOCATION_SPECIFIED; - public static String _UI_NO_TYPE_DEFINED; - public static String _UI_ACTION_UPDATE_NAME; - public static String _UI_LABEL_ABSENT; - public static String _UI_ACTION_ADD_FIELD; - public static String _UI_ACTION_SET_MULTIPLICITY; - public static String _UI_LABEL_OPTIONAL; - public static String _UI_LABEL_ZERO_OR_MORE; - public static String _UI_LABEL_ONE_OR_MORE; - public static String _UI_LABEL_REQUIRED; - public static String _UI_LABEL_ARRAY; - public static String _UI_ACTION_SET_TYPE; - public static String _UI_LABEL_LOCAL_TYPE; - - public static String _UI_GRAPH_UNKNOWN_OBJECT; - public static String _UI_GRAPH_XSDSCHEMA; - public static String _UI_GRAPH_XSDSCHEMA_NO_NAMESPACE; - public static String _UI_LABEL_SET_COMMON_BUILT_IN_TYPES; - public static String _UI_LABEL_SELECT_TYPES_FILTER_OUT; - public static String _UI_LABEL_NEW_TYPE; - public static String _UI_LABEL_COMPLEX_TYPE; - public static String _UI_LABEL_SIMPLE_TYPE; - public static String _UI_LABEL_NEW_ELEMENT; - public static String _UI_MENU_XSD_EDITOR; - public static String _UI_LABEL_SOURCE; - public static String _UI_ACTION_ADD_ELEMENT; - public static String _UI_ACTION_ADD_ELEMENT_REF; - public static String _UI_ACTION_NEW; - public static String _UI_ACTION_BROWSE; - public static String _UI_ACTION_UPDATE_ELEMENT_REFERENCE; - public static String _UI_LABEL_TARGET_NAMESPACE; - public static String _UI_LABEL_NO_NAMESPACE; - public static String _UI_ACTION_ADD_COMPLEX_TYPE; - public static String _UI_ACTION_ADD_SIMPLE_TYPE; - public static String _UI_LABEL_NAME_SEARCH_FILTER_TEXT; - public static String _UI_LABEL_ELEMENTS_COLON; - public static String _UI_LABEL_SET_ELEMENT_REFERENCE; - public static String _UI_LABEL_TYPES_COLON; - public static String _UI_LABEL_SET_TYPE; - - public static String _UI_TEXT_INDENT_LABEL; - public static String _UI_TEXT_INDENT_SPACES_LABEL; - public static String _UI_TEXT_XSD_NAMESPACE_PREFIX; - public static String _UI_TEXT_XSD_DEFAULT_PREFIX; - public static String _UI_QUALIFY_XSD; - public static String _UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE; - public static String _UI_VALIDATING_FILES; - public static String _UI_TEXT_HONOUR_ALL_SCHEMA_LOCATIONS; - - public static String _ERROR_LABEL_INVALID_PREFIX; - public static String _UI_ACTION_ADD_INCLUDE; - public static String _UI_ACTION_ADD_IMPORT; - public static String _UI_ACTION_ADD_REDEFINE; - public static String _UI_ACTION_ADD_ATTRIBUTE_REF; - - public static String _UI_LABEL_ELEMENTFORMDEFAULT; - public static String _UI_LABEL_ATTRIBUTEFORMDEFAULT; - public static String _UI_LABEL_CREATE_ANON_TYPE; -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java deleted file mode 100644 index beb583485c..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/SourcePageActionContributor.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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.editor; - -import org.eclipse.ui.IActionBars; -import org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML; - - -/** - * SourcePageActionContributor - * - * This class is for multi page editor's source page contributor. - * - * - */ -public class SourcePageActionContributor extends ActionContributorXML { - - private IActionBars fBars; - - /** - * This method calls: - * <ul> - * <li><code>contributeToMenu</code> with <code>bars</code>' menu manager</li> - * <li><code>contributeToToolBar</code> with <code>bars</code>' tool bar - * manager</li> - * <li><code>contributeToStatusLine</code> with <code>bars</code>' status line - * manager</li> - * </ul> - * The given action bars are also remembered and made accessible via - * <code>getActionBars</code>. - * - * @param bars the action bars - * - */ - public void init(IActionBars bars) { - fBars = bars; - contributeToMenu(bars.getMenuManager()); - contributeToToolBar(bars.getToolBarManager()); - contributeToStatusLine(bars.getStatusLineManager()); - } - - /** - * Returns this contributor's action bars. - * - * @return the action bars - */ - public IActionBars getActionBars() { - return fBars; - } -}
\ No newline at end of file diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java deleted file mode 100644 index 47649de226..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/StructuredTextViewerConfigurationXSD.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 20065 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants; -import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML; - -/** - * Configuration for editing XSD content type - */ -public class StructuredTextViewerConfigurationXSD extends StructuredTextViewerConfigurationXML { - public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { - if (sourceViewer == null || !fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINKS_ENABLED)) - return null; - - List allDetectors = new ArrayList(0); - // add XSD Hyperlink detector - allDetectors.add(new XSDHyperlinkDetector()); - - IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer); - for (int m = 0; m < superDetectors.length; m++) { - IHyperlinkDetector detector = superDetectors[m]; - if (!allDetectors.contains(detector)) { - allDetectors.add(detector); - } - } - return (IHyperlinkDetector[]) allDetectors.toArray(new IHyperlinkDetector[0]); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java deleted file mode 100644 index 515d6f7a21..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDComplexTypeBaseTypeEditManager.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.gef.commands.Command; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDComplexTypeDefinitionCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDSimpleTypeDefinitionCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.SetBaseTypeAndManagerDirectivesCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.SetBaseTypeCommand; -import org.eclipse.wst.xsd.ui.internal.common.util.Messages; -import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDComplexTypeDefinition; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDSimpleTypeDefinition; -import org.eclipse.xsd.XSDTypeDefinition; - -public class XSDComplexTypeBaseTypeEditManager extends XSDTypeReferenceEditManager -{ - public XSDComplexTypeBaseTypeEditManager(IFile currentFile, XSDSchema[] schemas) - { - super(currentFile, schemas); - } - - public ComponentSpecification[] getQuickPicks() - { - return super.getQuickPicks(); - } - - public IComponentDialog getBrowseDialog() - { - XSDSearchListDialogDelegate dialogDelegate = new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.TYPE_META_NAME, currentFile, schemas); - return dialogDelegate; - } - - // TODO common this up - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) - { - XSDConcreteComponent concreteComponent = null; - if (referencingObject instanceof Adapter) - { - Adapter adpater = (Adapter)referencingObject; - if (adpater.getTarget() instanceof XSDConcreteComponent) - { - concreteComponent = (XSDConcreteComponent)adpater.getTarget(); - } - } - else if (referencingObject instanceof XSDConcreteComponent) - { - concreteComponent = (XSDConcreteComponent) referencingObject; - } - - if (concreteComponent instanceof XSDComplexTypeDefinition) - { - if (component.isNew()) - { - XSDTypeDefinition td = null; - if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME) - { - AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand(Messages._UI_ACTION_ADD_COMPLEX_TYPE, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - td = command.getCreatedComplexType(); - } - else - { - AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - td = command.getCreatedSimpleType(); - } - if (td != null) - { - Command command = new SetBaseTypeCommand(concreteComponent, td); - command.execute(); - } - } - else - { - Command command = new SetBaseTypeAndManagerDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile()); - command.setLabel(Messages._UI_ACTION_SET_BASE_TYPE); - command.execute(); - } - } - else if (concreteComponent instanceof XSDSimpleTypeDefinition) - { - if (component.isNew()) - { - XSDTypeDefinition td = null; - if (component.getMetaName() == IXSDSearchConstants.SIMPLE_TYPE_META_NAME) - { - AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - td = command.getCreatedSimpleType(); - } - if (td != null) - { - Command command = new SetBaseTypeCommand(concreteComponent, td); - command.execute(); - } - } - else - { - Command command = new SetBaseTypeAndManagerDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile()); - command.execute(); - } - } - - } - -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java deleted file mode 100644 index 390db12ad5..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorCSHelpIds.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -/** - * - * Context Sensitive Help IDs - * - */ -public class XSDEditorCSHelpIds -{ - public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui"; - - public static final String REGEX_WIZARD_PAGE = PLUGIN_NAME + ".xsduw0010"; - public static final String REGEX_TOKEN_CONTENTS = PLUGIN_NAME + ".xsduw0020"; - public static final String REGEX_JUST_ONCE = PLUGIN_NAME + ".xsduw0030"; - public static final String REGEX_ZERO_OR_MORE = PLUGIN_NAME + ".xsduw0040"; - public static final String REGEX_ONE_OR_MORE = PLUGIN_NAME + ".xsduw0050"; - public static final String REGEX_OPTIONAL = PLUGIN_NAME + ".xsduw0060"; - public static final String REGEX_REPEAT_RADIO = PLUGIN_NAME + ".xsduw0070"; - public static final String REGEX_RANGE_RADIO = PLUGIN_NAME + ".xsduw0080"; - public static final String REGEX_REPEAT_FIELD = PLUGIN_NAME + ".xsduw0090"; - public static final String REGEX_RANGE_MINIMUM_FIELD = PLUGIN_NAME + ".xsduw0100"; - public static final String REGEX_RANGE_MAXIMUM_FIELD = PLUGIN_NAME + ".xsduw0110"; - public static final String REGEX_ADD_BUTTON = PLUGIN_NAME + ".xsduw0120"; - public static final String REGEX_CURRENT_VALUE = PLUGIN_NAME + ".xsduw0130"; - - public static final String REGEX_TEST_PAGE = PLUGIN_NAME + ".xsduw0200"; - public static final String REGEX_SAMPLE_TEXT = PLUGIN_NAME + ".xsduw0210"; - - public static final String RENAME_NEW_NAME = PLUGIN_NAME + ".xsduw0300"; - public static final String RENAME_UPDATE_REFERENCES = PLUGIN_NAME + ".xsduw0310"; - - public static final String NEWTYPE_COMPLEXTYPE = PLUGIN_NAME + ".xsdud0010"; - public static final String NEWTYPE_SIMPLETYPE = PLUGIN_NAME + ".xsdud0020"; - public static final String NEWTYPE_NAME = PLUGIN_NAME + ".xsdud0030"; - - public static final String SETTYPE_NAME = PLUGIN_NAME + ".xsdud0050"; // these 3 are in common.ui - public static final String SETTYPE_TYPES = PLUGIN_NAME + ".xsdud0060"; - public static final String SETTYPE_SEARCHSCOPES = PLUGIN_NAME + ".xsdud0070"; - - public static final String ADD_ENUMERATIONS__NO_NAME = PLUGIN_NAME + ".xsdud0090"; - public static final String ADD_ENUMERATIONS__DELIMITER_CHARS = PLUGIN_NAME + ".xsdud0100"; - public static final String ADD_ENUMERATIONS__PRESERVE_LEAD_AND_TRAIL_WHITESPACES = PLUGIN_NAME + ".xsdud0110"; - - public static final String ADD_EXTENSIONS_COMPONENTS__EXTENSION_CATEGORIES = PLUGIN_NAME + ".xsdud0130"; - public static final String ADD_EXTENSIONS_COMPONENTS__AVAILABLE_COMPONENTS_TO_ADD = PLUGIN_NAME + ".xsdud0140"; - public static final String ADD_EXTENSIONS_COMPONENTS__ADD = PLUGIN_NAME + ".xsdud0150"; - public static final String ADD_EXTENSIONS_COMPONENTS__DELETE = PLUGIN_NAME + ".xsdud0160"; - public static final String ADD_EXTENSIONS_COMPONENTS__EDIT = PLUGIN_NAME + ".xsdud0170"; - - public static final String ADD_CATEGORY__NAME = PLUGIN_NAME + ".xsdud0190"; - public static final String ADD_CATEGORY__SCHEMA = PLUGIN_NAME + ".xsdud0200"; // can't invoke help, this is a CLabel, not text Field - - public static final String XML_CATALOG_ENTRIES__ENTRIES_TREELIST = PLUGIN_NAME + ".xsdud0220"; - public static final String XML_CATALOG_ENTRIES__DETAILS = PLUGIN_NAME + ".xsdud0230"; - - public static final String XMLSCHEMAFILES_PREFERENCES__QUALIFY_XMLSCHEMA_LANGUAGE_CONSTRUCTS = PLUGIN_NAME + ".xsduf0010"; - public static final String XMLSCHEMAFILES_PREFERENCES__XML_SCHEMA_LANGUAGE_CONSTRUCTS_PREFIX = PLUGIN_NAME + ".xsduf0020"; - public static final String XMLSCHEMAFILES_PREFERENCES__DEFAULT_TARGETNAMESPACE = PLUGIN_NAME + ".xsduf0030"; - public static final String XMLSCHEMAFILES_PREFERENCES__HONOUR_ALL_SCHEMA_LOCATIONS = PLUGIN_NAME + ".xsduf0040"; - - public static final String DOCUMENTATION_TAB__NO_LABEL = PLUGIN_NAME + ".xsdup0010"; - - public static final String EXTENSIONS_TAB__EXTENSIONS = PLUGIN_NAME + ".xsdup0030"; - public static final String EXTENSIONS_TAB__ADD = PLUGIN_NAME + ".xsdup0040"; - public static final String EXTENSIONS_TAB__DELETE = PLUGIN_NAME + ".xsdup0050"; - public static final String EXTENSIONS_TAB__EXTENSIONS_DETAILS = PLUGIN_NAME + ".xsdup0060"; - - public static final String CONSTRAINTS_TAB__MINIMUM_LENGTH = PLUGIN_NAME + ".xsdup0080"; - public static final String CONSTRAINTS_TAB__MAXIMUM_LENGTH = PLUGIN_NAME + ".xsdup0090"; - public static final String CONSTRAINTS_TAB__COLLAPSE_WHITESPACE = PLUGIN_NAME + ".xsdup0100"; - public static final String CONSTRAINTS_TAB__ENUMERATIONS = PLUGIN_NAME + ".xsdup0110"; - public static final String CONSTRAINTS_TAB__PATTERNS = PLUGIN_NAME + ".xsdup0120"; - public static final String CONSTRAINTS_TAB__NO_LABEL = PLUGIN_NAME + ".xsdup0130"; - - public static final String GENERAL_TAB__SCHEMA__PREFIX = PLUGIN_NAME + ".xsdup0200"; - public static final String GENERAL_TAB__SCHEMA__TARGETNAMESPACE = PLUGIN_NAME + ".xsdup0210"; - public static final String GENERAL_TAB__SCHEMA__ADVANCED = PLUGIN_NAME + ".xsdup0220"; - - public static final String GENERAL_TAB__ELEMENT__NAME = PLUGIN_NAME + ".xsdup0230"; - public static final String GENERAL_TAB__ELEMENT__TYPE = PLUGIN_NAME + ".xsdup0240"; - public static final String GENERAL_TAB__ELEMENT__REFERENCE = PLUGIN_NAME + ".xsdup0250"; - public static final String GENERAL_TAB__ELEMENT__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180"; - public static final String GENERAL_TAB__ELEMENT__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190"; - - public static final String GENERAL_TAB__COMPLEX_TYPE__NAME = PLUGIN_NAME + ".xsdup0260"; - public static final String GENERAL_TAB__COMPLEX_TYPE__INHERIT_FROM = PLUGIN_NAME + ".xsdup0270"; - public static final String GENERAL_TAB__COMPLEX_TYPE__INHERIT_BY = PLUGIN_NAME + ".xsdup0280"; - - public static final String GENERAL_TAB__SIMPLE_TYPE__NAME = PLUGIN_NAME + ".xsdup0290"; - public static final String GENERAL_TAB__SIMPLE_TYPE__VARIETY = PLUGIN_NAME + ".xsdup0300"; - public static final String GENERAL_TAB__SIMPLE_TYPE__BASE_TYPE = PLUGIN_NAME + ".xsdup0310"; - - public static final String GENERAL_TAB__ATTRIBUTE__NAME = PLUGIN_NAME + ".xsdup0320"; - public static final String GENERAL_TAB__ATTRIBUTE__TYPE = PLUGIN_NAME + ".xsdup0330"; - - public static final String GENERAL_TAB__ATTRIBUTEGROUP__NAME = PLUGIN_NAME + ".xsdup0340"; - - public static final String GENERAL_TAB__MODELGROUP_DEFINITION__NAME = PLUGIN_NAME + ".xsdup0350"; - - public static final String GENERAL_TAB__INCLUDE_REDEFINE__SCHEMALOCATION = PLUGIN_NAME + ".xsdup0360"; - - public static final String GENERAL_TAB__IMPORT__SCHEMALOCATION = PLUGIN_NAME + ".xsdup0370"; - public static final String GENERAL_TAB__IMPORT__NAMESPACE = PLUGIN_NAME + ".xsdup0380"; - public static final String GENERAL_TAB__IMPORT__PREFIX = PLUGIN_NAME + ".xsdup0390"; - - public static final String GENERAL_TAB__ANYELEMENT__NAMESPACE = PLUGIN_NAME + ".xsdup0400"; - public static final String GENERAL_TAB__ANYELEMENT__PROCESSCONTENTS = PLUGIN_NAME + ".xsdup0410"; - public static final String GENERAL_TAB__ANYELEMENT__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180"; - public static final String GENERAL_TAB__ANYELEMENT__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190"; - - public static final String GENERAL_TAB__ANYATTRIBUTE__NAMESPACE = PLUGIN_NAME + ".xsdup0400"; // these 4 are not used, same as anyelement above - public static final String GENERAL_TAB__ANYATTRIBUTE__PROCESSCONTENTS = PLUGIN_NAME + ".xsdup0410"; - public static final String GENERAL_TAB__ANYATTRIBUTE__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180"; - public static final String GENERAL_TAB__ANYATTRIBUTE__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190"; - - public static final String GENERAL_TAB__MODELGROUP__KIND = PLUGIN_NAME + ".xsdup0420"; - public static final String GENERAL_TAB__MODELGROUP__MIN_OCCURENCE = PLUGIN_NAME + ".xsdup0180"; //can't invoke help - public static final String GENERAL_TAB__MODELGROUP__MAX_OCCURENCE = PLUGIN_NAME + ".xsdup0190"; // can't invoke help - - public static final String GENERAL_TAB__MODELGROUP_REFS__REF = PLUGIN_NAME + ".xsdup0430"; - - public static final String GENERAL_TAB__ATTRIBUTEGROUP_REFS__REF = PLUGIN_NAME + ".xsdup0440"; - -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java deleted file mode 100644 index 89e5800fdd..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorConfiguration.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.Platform; -import org.eclipse.gef.EditPartFactory; -import org.eclipse.wst.xsd.ui.internal.actions.IXSDToolbarAction; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory; -import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory; - -public class XSDEditorConfiguration -{ - public static final String XSDEDITORCONFIGURATIONEXTENSIONID = "org.eclipse.wst.xsd.ui.XSDEditorExtensionConfiguration"; //$NON-NLS-1$ - public static final String INTERNALEDITORCONFIGURATION_EXTENSIONID = "org.eclipse.wst.xsd.ui.internalEditorConfiguration"; //$NON-NLS-1$ - public static final String CLASSNAME = "class"; //$NON-NLS-1$ - public static final String ADAPTERFACTORY = "adapterFactory"; //$NON-NLS-1$ - public static final String TOOLBARACTION = "toolbarAction"; //$NON-NLS-1$ - public static final String FIGUREFACTORY = "figureFactory"; //$NON-NLS-1$ - public static final String EDITPARTFACTORY = "editPartFactory"; //$NON-NLS-1$ - - List definedExtensionsList = null; - - public XSDEditorConfiguration() - { - - } - - public XSDAdapterFactory getAdapterFactory() - { - if (definedExtensionsList == null) - { - readXSDConfigurationRegistry(); - } - if (!definedExtensionsList.isEmpty()) - { - return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getAdapterFactory(); - } - return null; - } - - public EditPartFactory getEditPartFactory() - { - if (definedExtensionsList == null) - { - readXSDConfigurationRegistry(); - } - if (!definedExtensionsList.isEmpty()) - { - return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getEditPartFactory(); - } - return null; - } - - public IExtendedFigureFactory getFigureFactory() - { - if (definedExtensionsList == null) - { - readXSDConfigurationRegistry(); - } - if (!definedExtensionsList.isEmpty()) - { - return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getFigureFactory(); - } - return null; - } - - public List getToolbarActions() - { - if (definedExtensionsList == null) - { - readXSDConfigurationRegistry(); - } - if (!definedExtensionsList.isEmpty()) - { - return ((XSDEditorExtensionProperties) definedExtensionsList.get(0)).getActionList(); - } - return Collections.EMPTY_LIST; - } - - protected Object loadClass(IConfigurationElement element, String classString) - { - String pluginId = element.getDeclaringExtension().getContributor().getName(); - - try - { - Class theClass = Platform.getBundle(pluginId).loadClass(classString); - Object instance = theClass.newInstance(); - - return instance; - } - catch (Exception e) - { - - } - return null; - } - - public void readXSDConfigurationRegistry() - { - definedExtensionsList = new ArrayList(); - updateList(INTERNALEDITORCONFIGURATION_EXTENSIONID); - updateList(XSDEDITORCONFIGURATIONEXTENSIONID); - } - - private void updateList(String ID) - { - IConfigurationElement[] xsdEditorExtensionList = Platform.getExtensionRegistry().getConfigurationElementsFor(ID); - boolean definedExtensionsExist = (xsdEditorExtensionList != null && xsdEditorExtensionList.length > 0); - - if (definedExtensionsExist) - { - - for (int i = 0; i < xsdEditorExtensionList.length; i++) - { - XSDEditorExtensionProperties properties = new XSDEditorExtensionProperties(); - definedExtensionsList.add(properties); - - IConfigurationElement element = xsdEditorExtensionList[i]; - String adapterFactoryClass = element.getAttribute(ADAPTERFACTORY); - if (adapterFactoryClass != null) - { - Object object = loadClass(element, adapterFactoryClass); - XSDAdapterFactory adapterFactory = null; - if (object instanceof XSDAdapterFactory) - { - adapterFactory = (XSDAdapterFactory) object; - properties.setAdapterFactory(adapterFactory); - } - } - - String figureFactoryClass = element.getAttribute(FIGUREFACTORY); - if (figureFactoryClass != null) - { - Object object = loadClass(element, figureFactoryClass); - IExtendedFigureFactory figureFactory = null; - if (object instanceof IExtendedFigureFactory) - { - figureFactory = (IExtendedFigureFactory) object; - properties.setFigureFactoryList(figureFactory); - } - } - - IConfigurationElement[] toolbarActions = element.getChildren(TOOLBARACTION); - List actionList = new ArrayList(); - if (toolbarActions != null) - { - for (int j = 0; j < toolbarActions.length; j++) - { - IConfigurationElement actionElement = toolbarActions[j]; - String actionClass = actionElement.getAttribute(CLASSNAME); - IXSDToolbarAction action = null; - if (actionClass != null) - { - Object object = loadClass(actionElement, actionClass); - if (object instanceof IXSDToolbarAction) - { - action = (IXSDToolbarAction) object; - actionList.add(action); - } - } - } - } - properties.setActionList(actionList); - - String editPartFactoryClass = element.getAttribute(EDITPARTFACTORY); - if (editPartFactoryClass != null) - { - Object object = loadClass(element, editPartFactoryClass); - EditPartFactory editPartFactory = null; - if (object instanceof EditPartFactory) - { - editPartFactory = (EditPartFactory) object; - properties.setEditPartFactoryList(editPartFactory); - } - } - } - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java deleted file mode 100644 index a88daff901..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorContextIds.java +++ /dev/null @@ -1,460 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 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.editor; - -/** - * Context help id constants. - */ -public interface XSDEditorContextIds -{ - public static final String PLUGIN_NAME = "org.eclipse.wst.xsd.ui.internal"; - - /* CONTEXT_IDs New XSD Wizard uses the WizardNewFileCreationPage from org.eclipse.ui.dialogs */ - - /* CONTEXT_IDs for XSDEditor follow the xsdexxx context IDs */ - - /* CONTEXT_ID xsde0010 for XSD Editor Design View */ - public static final String XSDE_SCHEMA_DESIGN_VIEW = PLUGIN_NAME + ".xsde0010"; - /* no CONTEXT_ID for File Name Text Edit (not editable) */ - /* CONTEXT_ID xsde0020 for Version Text Edit */ - public static final String XSDE_SCHEMA_VERSION = PLUGIN_NAME + ".xsde0020"; - /* CONTEXT_ID xsde0030 for Language Text Edit */ - public static final String XSDE_SCHEMA_LANGUAGE = PLUGIN_NAME + ".xsde0030"; - /* CONTEXT_ID xsde0040 for Namespace Group */ - public static final String XSDE_SCHEMA_NAMESPACE_GROUP = PLUGIN_NAME + ".xsde0040"; - /* CONTEXT_ID xsde0050 for Prefix Text Edit */ - public static final String XSDE_SCHEMA_PREFIX = PLUGIN_NAME + ".xsde0050"; - /* CONTEXT_ID xsde0060 for Target namespace Text Edit */ - public static final String XSDE_SCHEMA_TARGET_NAMESPACE = PLUGIN_NAME + ".xsde0060"; - /* CONTEXT_ID xsde0070 for Apply Push Button */ - public static final String XSDE_SCHEMA_APPLY = PLUGIN_NAME + ".xsde0070"; - /* CONTEXT_ID xsde0080 for Attribute form default Combo Box */ - public static final String XSDE_SCHEMA_ATTRIBUTE = PLUGIN_NAME + ".xsde0080"; - /* CONTEXT_ID xsde0090 for Element form default Combo Box */ - public static final String XSDE_SCHEMA_ELEMENT = PLUGIN_NAME + ".xsde0090"; - /* CONTEXT_ID xsde0100 for Block default Combo Box */ - public static final String XSDE_SCHEMA_BLOCK = PLUGIN_NAME + ".xsde0100"; - /* CONTEXT_ID xsde0110 for Final Default Combo Box */ - public static final String XSDE_SCHEMA_FINAL = PLUGIN_NAME + ".xsde0110"; - - - /* CONTEXT_ID xsde0200 for Annotations Comment Group - only used generically */ - /* CONTEXT_ID - used in Documentation Design View */ - /* CONTEXT_ID - used in App Info Design View */ - public static final String XSDE_ANNOTATION_COMMENT_GROUP = PLUGIN_NAME + ".xsde0200"; - /* CONTEXT_ID xsde0210 for Annotations Comment Group - only used generically */ - /* CONTEXT_ID - used in Documentation Design View */ - /* CONTEXT_ID - used in App Info Design View */ - public static final String XSDE_ANNOTATION_COMMENT = PLUGIN_NAME + ".xsde0210"; - - /* CONTEXT_ID xsde0300 for Documentation Design View */ - public static final String XSDE_DOCUMENTATION_DESIGN_VIEW = PLUGIN_NAME + ".xsde0300"; - /* CONTEXT_ID xsde0310 for Source Text Edit */ - public static final String XSDE_DOCUMENTATION_SOURCE = PLUGIN_NAME + ".xsde0310"; - /* CONTEXT_ID xsde0320 for Language Text Edit */ - public static final String XSDE_DOCUMENTATION_LANGUAGE = PLUGIN_NAME + ".xsde0320"; - /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */ - /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */ - - /* CONTEXT_ID xsde0400 for App Info Design View */ - public static final String XSDE_APP_INFO_DESIGN_VIEW = PLUGIN_NAME + ".xsde0400"; - /* CONTEXT_ID xsde0410 for App Info Source Text Edit */ - public static final String XSDE_APP_INFO_SOURCE = PLUGIN_NAME + ".xsde0410"; - /* CONTEXT_ID Comment Group is from Annotations Window xsde0200 */ - /* CONTEXT_ID Comment Multi-line Edit is from Annotations Window xsd0210 */ - - /* CONTEXT_ID xsde0500 for Complex Type Design View */ - public static final String XSDE_COMPLEX_DESIGN_VIEW = PLUGIN_NAME + ".xsde0500"; - /* CONTEXT_ID xsde0510 for Name Text Edit */ - public static final String XSDE_COMPLEX_NAME = PLUGIN_NAME + ".xsde0510"; - /* CONTEXT_ID xsde0520 for Abstract Combo Box */ - public static final String XSDE_COMPLEX_ABSTRACT = PLUGIN_NAME + ".xsde0520"; - /* CONTEXT_ID xsde0530 for Mixed Combo Box */ - public static final String XSDE_COMPLEX_MIXED = PLUGIN_NAME + ".xsde0530"; - /* CONTEXT_ID xsde0540 for Block Combo Box */ - public static final String XSDE_COMPLEX_BLOCK = PLUGIN_NAME + ".xsde0540"; - /* CONTEXT_ID xsde0550 for Final Combo Box */ - public static final String XSDE_COMPLEX_FINAL = PLUGIN_NAME + ".xsde0550"; - - /* CONTEXT_ID xsde0600 for Simple Type Design View */ - public static final String XSDE_SIMPLE_DESIGN_VIEW = PLUGIN_NAME + ".xsde0600"; - /* CONTEXT_ID xsde0610 for Name Text Edit */ - public static final String XSDE_SIMPLE_NAME = PLUGIN_NAME + ".xsde0610"; - - /* CONTEXT_ID for Global Element and Element Design Views are the same */ - /* CONTEXT_ID xsde0700 for Element Design View */ - public static final String XSDE_ELEMENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde0700"; - /* CONTEXT_ID xsde0710 for Element Name Text Edit */ - public static final String XSDE_ELEMENT_NAME = PLUGIN_NAME + ".xsde0710"; - /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */ - /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */ - /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */ - /* CONTEXT_ID User-defined complex type Radio Button is from Type Helper xsde0940 */ - /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */ - /* CONTEXT_ID xsde0720 for Abstract Check Box */ - public static final String XSDE_ELEMENT_ABSTRACT = PLUGIN_NAME + ".xsde0720"; - /* CONTEXT_ID xsde0730 for Nillable Check Box */ - public static final String XSDE_ELEMENT_NILLABLE = PLUGIN_NAME + ".xsde0730"; - /* CONTEXT_ID xsde0740 for Value Group */ - public static final String XSDE_ELEMENT_VALUE = PLUGIN_NAME + ".xsde0740"; - /* CONTEXT_ID xsde0750 for Fixed Radio Button */ - public static final String XSDE_ELEMENT_FIXED = PLUGIN_NAME + ".xsde0750"; - /* CONTEXT_ID xsde0760 for Default Radio Button */ - public static final String XSDE_ELEMENT_DEFAULT = PLUGIN_NAME + ".xsde0760"; - /* CONTEXT_ID xsde0770 for Value Group */ - public static final String XSDE_ELEMENT_VALUE_GROUP = PLUGIN_NAME + ".xsde0770"; - /* CONTEXT_ID xsde0780 for Minimum Text Edit */ - public static final String XSDE_ELEMENT_MINIMUM = PLUGIN_NAME + ".xsde0780"; - /* CONTEXT_ID xsde0790 for Maximum Text Edit */ - public static final String XSDE_ELEMENT_MAXIMUM = PLUGIN_NAME + ".xsde0790"; - /* CONTEXT_ID xsde0800 for Block Combo Box */ - public static final String XSDE_ELEMENT_BLOCK = PLUGIN_NAME + ".xsde0800"; - /* CONTEXT_ID xsde0810 for Final Combo Box */ - public static final String XSDE_ELEMENT_FINAL = PLUGIN_NAME + ".xsde0810"; - /* CONTEXT_ID xsde0820 for Substitution Group Combo Box */ - public static final String XSDE_ELEMENT_SUBSTITUTION = PLUGIN_NAME + ".xsde0820"; - /* CONTEXT_ID xsde0830 for Form Qualification Combo Box */ - public static final String XSDE_ELEMENT_FORM = PLUGIN_NAME + ".xsde0830"; - - /* CONTEXT_ID xsde0900 for Type Helper Group - only used generically */ - /* CONTEXT_ID - used in Global Element Design View */ - /* CONTEXT_ID - used in Global Attribute Design View */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Restriction Design View */ - /* CONTEXT_ID - used in List Design View */ - /* CONTEXT_ID - used in Union Design View */ - public static final String XSDE_TYPE_HELPER_GROUP = PLUGIN_NAME + ".xsde0900"; - /* CONTEXT_ID xsde0910 for None Radio Button - only used generically */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Restriction Design View */ - /* CONTEXT_ID - used in List Design View */ - /* CONTEXT_ID - used in Union Design View */ - public static final String XSDE_TYPE_HELPER_NONE = PLUGIN_NAME + ".xsde0910"; - /* CONTEXT_ID xsde0920 for Built-in simple type Radio Button - only used generically */ - /* CONTEXT_ID - used in Global Element Design View */ - /* CONTEXT_ID - used in Global Attribute Design View */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Restriction Design View */ - /* CONTEXT_ID - used in List Design View */ - /* CONTEXT_ID - used in Union Design View */ - public static final String XSDE_TYPE_HELPER_BUILT_IN = PLUGIN_NAME + ".xsde0920"; - /* CONTEXT_ID xsde0930 for User-defined simple type Radio Button - only used generically */ - /* CONTEXT_ID - used in Global Element Design View */ - /* CONTEXT_ID - used in Global Attribute Design View */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Restriction Design View */ - /* CONTEXT_ID - used in List Design View */ - /* CONTEXT_ID - used in Union Design View */ - public static final String XSDE_TYPE_HELPER_USER_DEFINED_SIMPLE = PLUGIN_NAME + ".xsde0930"; - /* CONTEXT_ID xsde0940 for User-defined complex type Radio Button - only used generically */ - /* CONTEXT_ID - used in Global Element Design View */ - public static final String XSDE_TYPE_HELPER_USER_DEFINED_COMPLEX = PLUGIN_NAME + ".xsde0940"; - /* CONTEXT_ID xsde0950 for Type information Combo Box - only used generically */ - /* CONTEXT_ID - used in Global Element Design View */ - /* CONTEXT_ID - used in Global Attribute Design View */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Restriction Design View */ - /* CONTEXT_ID - used in List Design View */ - public static final String XSDE_TYPE_HELPER_TYPE = PLUGIN_NAME + ".xsde0950"; - - /* CONTEXT_ID xsde1000 for Attribute Design View */ - public static final String XSDE_ATTRIBUTE_DESIGN_VIEW = PLUGIN_NAME + ".xsde1000"; - /* CONTEXT_ID xsde1010 for Attribute Name Text Edit */ - public static final String XSDE_ATTRIBUTE_NAME = PLUGIN_NAME + ".xsde1010"; - /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */ - /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */ - /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */ - /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */ - /* CONTEXT_ID xsde1020 for Value Group */ - public static final String XSDE_ATTRIBUTE_VALUE_GROUP = PLUGIN_NAME + ".xsde1020"; - /* CONTEXT_ID xsde1030 for Fixed Radio Button */ - public static final String XSDE_ATTRIBUTE_FIXED = PLUGIN_NAME + ".xsde1030"; - /* CONTEXT_ID xsde1040 for Default Radio Button */ - public static final String XSDE_ATTRIBUTE_DEFAULT = PLUGIN_NAME + ".xsde1040"; - /* CONTEXT_ID xsde1050 for Value Text Edit */ - public static final String XSDE_ATTRIBUTE_VALUE = PLUGIN_NAME + ".xsde1050"; - /* CONTEXT_ID xsde1060 for Usage Combo Box */ - public static final String XSDE_ATTRIBUTE_USAGE = PLUGIN_NAME + ".xsde1060"; - /* CONTEXT_ID xsde1070 for Form qualificaiton Combo Box */ - public static final String XSDE_ATTRIBUTE_FORM = PLUGIN_NAME + ".xsde1070"; - - /* CONTEXT_ID xsde1100 for Element Ref Window Design View */ - public static final String XSDE_ELEMENT_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1100"; - /* CONTEXT_ID xsde1110 for Reference Name Combo Box */ - public static final String XSDE_ELEMENT_REF_REFERENCE = PLUGIN_NAME + ".xsde1110"; - /* CONTEXT_ID xsde1120 for Minimum Text Edit */ - public static final String XSDE_ELEMENT_REF_MINIMUM = PLUGIN_NAME + ".xsde1120"; - /* CONTEXT_ID xsde1130 for Maximum Text Edit */ - public static final String XSDE_ELEMENT_REF_MAXIMUM = PLUGIN_NAME + ".xsde1130"; - - /* CONTEXT_ID xsde1200 for Simple Content Design View - used generically */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Complex Content Design View */ - public static final String XSDE_SIMPLE_CONTENT_DESIGN_VIEW = PLUGIN_NAME + ".xsde1200"; - /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */ - /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */ - /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */ - /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */ - /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */ - /* CONTEXT_ID xsde1210 for Derived by Combo Box - used generically */ - /* CONTEXT_ID - used in Simple Content Design View */ - /* CONTEXT_ID - used in Complex Content Design View */ - public static final String XSDE_SIMPLE_CONTENT_DERIVED = PLUGIN_NAME + ".xsde1210"; - - /* CONTEXT_ID xsde1300 for Restriction Design View */ - public static final String XSDE_RESTRICTION_DESIGN_VIEW = PLUGIN_NAME + ".xsde1300"; - /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */ - /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */ - /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */ - /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */ - /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */ - /* CONTEXT_ID xsde1310 for Facets Group */ - public static final String XSDE_RESTRICTION_FACETS_GROUP = PLUGIN_NAME + ".xsde1310"; - /* CONTEXT_ID xsde1320 for Facets Table */ - public static final String XSDE_RESTRICTION_FACETS = PLUGIN_NAME + ".xsde1320"; - - /* CONTEXT_ID xsde1400 for List Design View */ - public static final String XSDE_LIST_DESIGN_VIEW = PLUGIN_NAME + ".xsde1400"; - /* CONTEXT_ID Base Type Group is from Type Helper xsde0900 */ - /* CONTEXT_ID None Radio Button is from Type Helper xsde0910 */ - /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */ - /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */ - /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */ - - /* CONTEXT_ID xsde1500 for Attribute Group Design View */ - public static final String XSDE_ATTRIBUTE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde1500"; - /* CONTEXT_ID xsde1510 for Name Text Edit */ - public static final String XSDE_ATTRIBUTE_GROUP_NAME = PLUGIN_NAME + ".xsde1510"; - - /* CONTEXT_ID for Global Attribute and Attribute Design Views are the same */ - /* CONTEXT_ID xsde1600 for Attribute Group Reference Design View */ - public static final String XSDE_ATTRIBUTE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1600"; - /* CONTEXT_ID xsde1610 for Reference Name Combo Box */ - public static final String XSDE_ATTRIBUTE_GROUP_REF_NAME = PLUGIN_NAME + ".xsde1610"; - - /* CONTEXT_ID xsde1700 for Attribute Reference Design View */ - public static final String XSDE_ATTRIBUTE_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde1700"; - /* CONTEXT_ID xsde1710 for Reference Name Combo Box */ - public static final String XSDE_ATTRIBUTE_REF_NAME = PLUGIN_NAME + ".xsde1710"; - - /* CONTEXT_ID xsde1800 for Pattern Design View */ - public static final String XSDE_PATTERN_DESIGN_VIEW = PLUGIN_NAME + ".xsde1800"; - /* CONTEXT_ID xsde1810 for Value Text Edit */ - public static final String XSDE_PATTERN_VALUE = PLUGIN_NAME + ".xsde1810"; - /* CONTEXT_ID xsde1820 for Create Regular Expression Push Button */ - public static final String XSDE_PATTERN_REGULAR = PLUGIN_NAME + ".xsde1820"; - - /* CONTEXT_ID xsde1900 for Enum Design View */ - public static final String XSDE_ENUM_DESIGN_VIEW = PLUGIN_NAME + ".xsde1900"; - /* CONTEXT_ID xsde1910 for Value Text Edit */ - public static final String XSDE_ENUM_VALUE = PLUGIN_NAME + ".xsde1910"; - - /* CONTEXT_ID xsde2000 for Include Design Page */ - public static final String XSDE_INCLUDE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2000"; - /* no CONTEXT_ID for Schema Location Text Edit (not editable) */ - /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */ - - /* CONTEXT_ID xsde2100 for Include Helper Select Push Button - used generically */ - /* CONTEXT_ID - used in Include Design View */ - /* CONTEXT_ID - used in Import Design View */ - public static final String XSDE_INCLUDE_HELPER_SELECT = PLUGIN_NAME + ".xsde2100"; - - /* CONTEXT_ID xsde2200 for Import Design Page */ - public static final String XSDE_IMPORT_DESIGN_VIEW = PLUGIN_NAME + ".xsde2200"; - /* no CONTEXT_ID for Schema Location Text Edit (not editable) */ - /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */ - /* CONTEXT_ID xsde2210 for Prefix Text Edit */ - public static final String XSDE_IMPORT_PREFIX = PLUGIN_NAME + ".xsde2210"; - /* no CONTEXT_ID for Namespace Text Edit (not editable) */ - - /* CONTEXT_ID xsde2300 for Redefine Design View */ - public static final String XSDE_REDEFINE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2300"; - /* no CONTEXT_ID for Schema Location Text Edit (not editable) */ - /* CONTEXT_ID Select Push Button is from Include Helper xsde2100 */ - - /* CONTEXT_ID xsde2400 for Group Design View */ - public static final String XSDE_GROUP_DESIGN_VIEW = PLUGIN_NAME + ".xsde2400"; - /* CONTEXT_ID xsde2410 for Name Text Edit */ - public static final String XSDE_GROUP_NAME = PLUGIN_NAME + ".xsde2410"; - - /* CONTEXT_ID xsde2500 for Group Scope Design View */ - public static final String XSDE_GROUP_SCOPE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2500"; - /* CONTEXT_ID xsde2510 for Content model Group */ - public static final String XSDE_GROUP_SCOPE_CONTENT_GROUP = PLUGIN_NAME + ".xsde2510"; - /* CONTEXT_ID xsde2520 for Sequence Radio Button */ - public static final String XSDE_GROUP_SCOPE_SEQUENCE = PLUGIN_NAME + ".xsde2520"; - /* CONTEXT_ID xsde2530 for Choice Radio Button */ - public static final String XSDE_GROUP_SCOPE_CHOICE = PLUGIN_NAME + ".xsde2530"; - /* CONTEXT_ID xsde2540 for All Radio Button */ - public static final String XSDE_GROUP_SCOPE_ALL = PLUGIN_NAME + ".xsde2540"; - /* CONTEXT_ID xsde2550 for Minimum Text Edit */ - public static final String XSDE_GROUP_SCOPE_MINIMUM = PLUGIN_NAME + ".xsde2550"; - /* CONTEXT_ID xsde2560 for Maximum Text Edit*/ - public static final String XSDE_GROUP_SCOPE_MAXIMUM = PLUGIN_NAME + ".xsde2560"; - - /* CONTEXT_ID xsde2600 for Group Ref Design View */ - public static final String XSDE_GROUP_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2600"; - /* CONTEXT_ID xsde2610 for Reference name Combo Box */ - public static final String XSDE_GROUP_REF_REFERENCE = PLUGIN_NAME + ".xsde2610"; - /* CONTEXT_ID xsde2620 for Minimum Text Edit */ - public static final String XSDE_GROUP_REF_MINIMUM = PLUGIN_NAME + ".xsde2620"; - /* CONTEXT_ID xsde2630 for Maximum Text Edit */ - public static final String XSDE_GROUP_REF_MAXIMUM = PLUGIN_NAME + ".xsde2630"; - - /* CONTEXT_ID xsde2700 for Unique Design View */ - public static final String XSDE_UNIQUE_DESIGN_VIEW = PLUGIN_NAME + ".xsde2700"; - /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */ - /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */ - /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */ - /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */ - /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */ - /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */ - /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */ - /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */ - - /* CONTEXT_ID xsde2800 for Unique Base Name Text Edit - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_NAME = PLUGIN_NAME + ".xsde2800"; - /* CONTEXT_ID xsde2810 for Selector Group - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_SELECTOR_GROUP = PLUGIN_NAME + ".xsde2810"; - /* CONTEXT_ID xsde2820 for Selector Multi-line Edit - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_SELECTOR = PLUGIN_NAME + ".xsde2820"; - /* CONTEXT_ID xsde2830 for Fields Group - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_FIELDS_GROUP = PLUGIN_NAME + ".xsde2830"; - /* CONTEXT_ID xsde2840 for Source Text Edit - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_SOURCE = PLUGIN_NAME + ".xsde2840"; - /* CONTEXT_ID xsde2850 for Add Push Button - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_ADD = PLUGIN_NAME + ".xsde2850"; - /* CONTEXT_ID xsde2860 for Remove Push Button - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_REMOVE = PLUGIN_NAME + ".xsde2860"; - /* CONTEXT_ID xsde2870 for Target List Box - used generically */ - /* CONTEXT_ID - used in Unique Design View */ - /* CONTEXT_ID - used in Key Design View */ - /* CONTEXT_ID - used in Key Ref Design View */ - public static final String XSDE_UNIQUE_BASE_TARGET = PLUGIN_NAME + ".xsde2870"; - - /* CONTEXT_ID xsde2900 for Key Design View */ - public static final String XSDE_KEY_DESIGN_VIEW = PLUGIN_NAME + ".xsde2900"; - /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */ - /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */ - /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */ - /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */ - /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */ - /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */ - /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */ - /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */ - /* CONTEXT_ID xsde2900 for Key Design View */ - - /* CONTEXT_ID xsde2950 for Key Ref Design View */ - public static final String XSDE_KEY_REF_DESIGN_VIEW = PLUGIN_NAME + ".xsde2950"; - /* CONTEXT_ID Name Text Edit is from Unique Base xsde2800 */ - /* CONTEXT_ID xsde2960 for Reference Key Combo Box */ - public static final String XSDE_KEY_REF_REFERENCE = PLUGIN_NAME + ".xsde2960"; - /* CONTEXT_ID Selector Group is from Unique Base xsde2810 */ - /* CONTEXT_ID Selector Mulit-line Edit is from Unique Base xsde2820 */ - /* CONTEXT_ID Fields Group is from Unique Base xsde2830 */ - /* CONTEXT_ID Source Text Edit is from Unique Base xsde2840 */ - /* CONTEXT_ID Add Push Button is from Unique Base xsde2850 */ - /* CONTEXT_ID Remove Push Button is from Unique Base xsde2860 */ - /* CONTEXT_ID Target List Box is from Unique Base xsde2870 */ - - /* CONTEXT_ID xsde3000 for Any Element Design View */ - public static final String XSDE_ANY_ELEMENT_VIEW = PLUGIN_NAME + ".xsde3000"; - /* CONTEXT_ID xsde3010 for Namespace Text Edit */ - public static final String XSDE_ANY_ELEMENT_NAMESPACE = PLUGIN_NAME + ".xsde3010"; - /* CONTEXT_ID xsde3020 for Process Contents Combo Box */ - public static final String XSDE_ANY_ELEMENT_PROCESS = PLUGIN_NAME + ".xsde3020"; - /* CONTEXT_ID xsde3030 for Minimum Text Edit */ - public static final String XSDE_ANY_ELEMENT_MINIMUM = PLUGIN_NAME + ".xsde3030"; - /* CONTEXT_ID xsde3040 for Maximum Text Edit */ - public static final String XSDE_ANY_ELEMENT_MAXIMUM = PLUGIN_NAME + ".xsde3040"; - - /* CONTEXT_ID xsde3100 for Any Attribute Design View */ - public static final String XSDE_ANY_ATTRIBUTE_VIEW = PLUGIN_NAME + ".xsde3100"; - /* CONTEXT_ID xsde3110 for Namespace Text Edit */ - public static final String XSDE_ANY_ATTRIBUTE_NAMESPACE = PLUGIN_NAME + ".xsde3110"; - /* CONTEXT_ID xsde3120 for Process Contents Combo Box */ - public static final String XSDE_ANY_ATTRIBUTE_PROCESS = PLUGIN_NAME + ".xsde3120"; - - /* no CONTEXT_ID for Union Design View - uses a generic interface */ - /* CONTEXT_ID Type Information Group is from Type Helper xsde0900 */ - /* CONTEXT_ID Built-in simple type Radio Button is from Type Helper xsde0920 */ - /* CONTEXT_ID User-defined simple type Radio Button is from Type Helper xsde0930 */ - /* CONTEXT_ID Type information Combo Box is from Type Helper xsde0950 */ - - /* CONTEXT_ID xsde3200 for Notation Design View */ - public static final String XSDE_NOTATION_VIEW = PLUGIN_NAME + ".xsde3200"; - - /* CONTEXT_ID xsde4000 for Source View */ - public static final String XSDE_SOURCE_VIEW = PLUGIN_NAME + ".xsde4000"; - - /* CONTEXT_IDs for Regular Expression Wizard follow the xsdrxxx context IDs */ - - /* CONTEXT_ID xsdr0010 for Compose Regular Expression Page */ - public static final String XSDR_COMPOSITION_PAGE = PLUGIN_NAME + ".xsdr0010"; - /* CONTEXT_ID xsdr0015 for Token Contents Combo Box */ - public static final String XSDR_COMPOSITION_TOKEN = PLUGIN_NAME + ".xsdr0015"; - /* CONTEXT_ID xsdr0020 for Occurrece Group */ - public static final String XSDR_COMPOSITION_OCCURRENCE_GROUP = PLUGIN_NAME + ".xsdr0020"; - /* CONTEXT_ID xsdr0030 for Just once Radio Button */ - public static final String XSDR_COMPOSITION_JUST_ONCE = PLUGIN_NAME + ".xsdr0030"; - /* CONTEXT_ID xsdr0040 for Zero or more Radio Button */ - public static final String XSDR_COMPOSITION_ZERO_OR_MORE = PLUGIN_NAME + ".xsdr0040"; - /* CONTEXT_ID xsdr0050 for One or more Radio Button */ - public static final String XSDR_COMPOSITION_ONE_OR_MORE = PLUGIN_NAME + ".xsdr0050"; - /* CONTEXT_ID xsdr0060 for Optional Radio Button */ - public static final String XSDR_COMPOSITION_OPTIONAL = PLUGIN_NAME + ".xsdr0060"; - /* CONTEXT_ID xsdr0070 for Repeat Radio Button */ - public static final String XSDR_COMPOSITION_REPEAT = PLUGIN_NAME + ".xsdr0070"; - /* CONTEXT_ID xsdr0080 for Range Radio Button */ - public static final String XSDR_COMPOSITION_RANGE = PLUGIN_NAME + ".xsdr0080"; - /* CONTEXT_ID xsdr0090 for Repeat Text Edit */ - public static final String XSDR_COMPOSITION_REPEAT_TEXT = PLUGIN_NAME + ".xsdr0090"; - /* CONTEXT_ID xsdr0100 for Range Minimum Text Edit */ - public static final String XSDR_COMPOSITION_RANGE_MIN = PLUGIN_NAME + ".xsdr0100"; - /* CONTEXT_ID xsdr0110 for Range Maximum Text Edit */ - public static final String XSDR_COMPOSITION_RANGE_MAX = PLUGIN_NAME + ".xsdr0110"; - /* CONTEXT_ID xsdr0120 for Add Push Button */ - public static final String XSDR_COMPOSITION_ADD = PLUGIN_NAME + ".xsdr0120"; - /* CONTEXT_ID xsdr0130 for Current Regular Expression Text Edit */ - public static final String XSDR_COMPOSITION_CURRENT = PLUGIN_NAME + ".xsdr0130"; - - /* CONTEXT_ID xsdr0200 for Test Regular Expression Page */ - public static final String XSDR_TEST_PAGE = PLUGIN_NAME + ".xsdr0200"; - /* no CONTEXT_ID for Regular Expression Text Edit (not editable) */ - /* CONTEXT_ID xsdr0210 for Sample Text Text Edit */ - public static final String XSDR_TEST_SAMPLE = PLUGIN_NAME + ".xsdr0210"; - - /* CONTEXT_IDs for Preferences Page follows the xsdpxxx context IDs */ - - /* CONTEXT_ID xsdp0010 for XML Schema Preferences Page */ - public static final String XSDP_PREFERENCE_PAGE = PLUGIN_NAME + ".xsdp0010"; -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java deleted file mode 100644 index f87139aeaf..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorExtensionProperties.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import java.util.List; - -import org.eclipse.gef.EditPartFactory; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory; -import org.eclipse.wst.xsd.ui.internal.design.figures.IExtendedFigureFactory; - -public class XSDEditorExtensionProperties -{ - XSDAdapterFactory adapterFactory; - IExtendedFigureFactory figureFactory; - EditPartFactory editPartFactory; - List actionList; - - public XSDEditorExtensionProperties() - { - - } - - public void setActionList(List actionList) - { - this.actionList = actionList; - } - - public void setAdapterFactory(XSDAdapterFactory adapterFactory) - { - this.adapterFactory = adapterFactory; - } - - public void setEditPartFactoryList(EditPartFactory editPartFactory) - { - this.editPartFactory = editPartFactory; - } - - public void setFigureFactoryList(IExtendedFigureFactory figureFactory) - { - this.figureFactory = figureFactory; - } - - public List getActionList() - { - return actionList; - } - - public XSDAdapterFactory getAdapterFactory() - { - return adapterFactory; - } - - public EditPartFactory getEditPartFactory() - { - return editPartFactory; - } - - public IExtendedFigureFactory getFigureFactory() - { - return figureFactory; - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java deleted file mode 100644 index 76d7a91d17..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDEditorPlugin.java +++ /dev/null @@ -1,373 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.plugin.*; -import org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider; -import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.ExtensionsSchemasRegistry; -import org.eclipse.wst.xsd.ui.internal.common.properties.sections.appinfo.custom.NodeCustomizationRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; -import java.util.*; - -public class XSDEditorPlugin extends AbstractUIPlugin -{ - public static final String PLUGIN_ID = "org.eclipse.wst.xsd.ui"; //$NON-NLS-1$ - public static final String EDITOR_ID = "org.eclipse.wst.xsd.ui.internal.editor.InternalXSDMultiPageEditor"; //$NON-NLS-1$ - public static final String CONST_XSD_DEFAULT_PREFIX_TEXT = "org.eclipse.wst.xmlschema.xsdDefaultPrefixText"; //$NON-NLS-1$ - public static final String CONST_PREFERED_BUILT_IN_TYPES = "org.eclipse.wst.xmlschema.preferedBuiltInTypes"; //$NON-NLS-1$ - public static final String CUSTOM_LIST_SEPARATOR = "\n"; //$NON-NLS-1$ - public static final String EXTENSIONS_SCHEMAS_EXTENSIONID = "org.eclipse.wst.xsd.ui.extensionCategories"; //$NON-NLS-1$ - private static final String DEPRECATED_EXTENSIONS_SCHEMAS_EXTENSIONID = "org.eclipse.wst.xsd.ui.ExtensionsSchemasDescription"; //$NON-NLS-1$ - public final static String DEFAULT_TARGET_NAMESPACE = "http://www.example.org"; //$NON-NLS-1$ - - - //The shared instance. - private static XSDEditorPlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - private ExtensionsSchemasRegistry registry; - private NodeCustomizationRegistry nodeCustomizationRegistry; - private XSDEditorConfiguration xsdEditorConfiguration = null; - - public static final String CONST_USE_SIMPLE_EDIT_MODE = PLUGIN_ID + ".useSimpleEditMode"; //$NON-NLS-1$ - public static final String CONST_SHOW_INHERITED_CONTENT = PLUGIN_ID + ".showInheritedContent"; //$NON-NLS-1$ - - public static final String CONST_XSD_LANGUAGE_QUALIFY = "org.eclipse.wst.xmlschema.xsdQualify"; //$NON-NLS-1$ - public static final String CONST_DEFAULT_TARGET_NAMESPACE = "org.eclipse.wst.xmlschema.defaultTargetnamespaceText"; //$NON-NLS-1$ - public static final String CONST_SHOW_EXTERNALS = PLUGIN_ID + ".showExternals"; //$NON-NLS-1$ - - public static String DEFAULT_PAGE = "org.eclipse.wst.xsd.ui.internal.defaultPage"; - public static String DESIGN_PAGE = "org.eclipse.wst.xsd.ui.internal.designPage"; - public static String SOURCE_PAGE = "org.eclipse.wst.xsd.ui.internal.sourcePage"; - - /** - * The constructor. - */ - public XSDEditorPlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - resourceBundle = null; - } - - /** - * Returns the shared instance. - */ - public static XSDEditorPlugin getDefault() { - return plugin; - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = XSDEditorPlugin.getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } catch (MissingResourceException e) { - return key; - } - } - - public static String getResourceString(String key, Object o) - { - return getResourceString(key, new Object[] { o}); - } - - public static String getResourceString(String key, Object[] objects) - { - return MessageFormat.format(getResourceString(key), objects); - } - - public static String getResourceString(String key, Object o1, Object o2) - { - return getResourceString(key, new Object[] { o1, o2}); - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - try { - if (resourceBundle == null) - // resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.xsd.ui.internal.editor.EditorPluginResources"); - resourceBundle = Platform.getResourceBundle(getBundle()); - } catch (MissingResourceException x) { - resourceBundle = null; - } - return resourceBundle; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path. - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.xsd.ui", path); //$NON-NLS-1$ - } - - public static ImageDescriptor getImageDescriptor(String name, boolean getBaseURL) { - try { - URL installURL = getDefault().getBundle().getEntry("/"); //$NON-NLS-1$ - String imageString = getBaseURL ? "icons/" + name : name; //$NON-NLS-1$ - - URL imageURL = new URL(installURL, imageString); - return ImageDescriptor.createFromURL(imageURL); - } catch (MalformedURLException e) { - return null; - } - } - - public Image getIcon(String name) - { - try { - ImageRegistry imageRegistry = getImageRegistry(); - - if (imageRegistry.get(name) != null) { - return imageRegistry.get(name); - } - else { - URL installURL = getDefault().getBundle().getEntry("/"); //$NON-NLS-1$ - String imageString = "icons/" + name; //$NON-NLS-1$ - - URL imageURL = new URL(installURL, imageString); - imageRegistry.put(name, ImageDescriptor.createFromURL(imageURL)); - return imageRegistry.get(name); - } - - } catch (Exception e) { - return null; - } - } - - public static XSDEditorPlugin getPlugin() { - return plugin; - } - - public static String getXSDString(String key) { - return getResourceString(key); - } - - /** - * This gets the string resource and does one substitution. - */ - public String getString(String key, Object s1) { - return MessageFormat.format(Platform.getResourceBundle(getBundle()).getString(key), new Object[]{s1}); - } - - public static Image getXSDImage(String iconName) { - return getDefault().getImage(iconName); - } - - public Image getImage(String iconName) { - ImageRegistry imageRegistry = getImageRegistry(); - - if (imageRegistry.get(iconName) != null) { - return imageRegistry.get(iconName); - } - else { - imageRegistry.put(iconName, ImageDescriptor.createFromFile(getClass(), iconName)); - return imageRegistry.get(iconName); - } - } - - public URL getBaseURL() { - return getDescriptor().getInstallURL(); - } - - public Image getIconImage(String object) { - try { - return ExtendedImageRegistry.getInstance().getImage(new URL(getBaseURL() + "icons/" + object + ".gif")); //$NON-NLS-1$ //$NON-NLS-2$ - } - catch (MalformedURLException exception) { - - } - return null; - } - - public boolean getShowInheritedContent() - { - return getPreferenceStore().getBoolean(CONST_SHOW_INHERITED_CONTENT); - } - - protected void initializeDefaultPreferences(IPreferenceStore store) - { - store.setDefault(CONST_SHOW_INHERITED_CONTENT, false); - store.setDefault(CONST_XSD_DEFAULT_PREFIX_TEXT, "xsd"); //$NON-NLS-1$ - store.setDefault(CONST_XSD_LANGUAGE_QUALIFY, false); - store.setDefault(DEFAULT_PAGE, DESIGN_PAGE); - store.setDefault(CONST_DEFAULT_TARGET_NAMESPACE, DEFAULT_TARGET_NAMESPACE); - store.setDefault(CONST_SHOW_EXTERNALS, false); - - //Even the last item in the list must contain a trailing List separator - store.setDefault(CONST_PREFERED_BUILT_IN_TYPES, - "boolean"+ CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "date" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "dateTime" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "double" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "float" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "hexBinary" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "int" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "string" + CUSTOM_LIST_SEPARATOR + //$NON-NLS-1$ - "time" + CUSTOM_LIST_SEPARATOR); //$NON-NLS-1$ - } - - public ExtensionsSchemasRegistry getExtensionsSchemasRegistry() - { - if (registry == null) - { - registry = new ExtensionsSchemasRegistry(EXTENSIONS_SCHEMAS_EXTENSIONID); - registry.__internalSetDeprecatedExtensionId(DEPRECATED_EXTENSIONS_SCHEMAS_EXTENSIONID); - registry.setPrefStore(XSDEditorPlugin.getPlugin().getPreferenceStore() ); - } - return registry; - } - - - public XSDEditorConfiguration getXSDEditorConfiguration() - { - if (xsdEditorConfiguration == null) - { - xsdEditorConfiguration = new XSDEditorConfiguration(); - } - return xsdEditorConfiguration; - } - - /** - * Get the xml schema default namespace prefix - */ - public String getXMLSchemaPrefix() - { - return getPreferenceStore().getString(CONST_XSD_DEFAULT_PREFIX_TEXT); - } - - public boolean getShowExternals() - { - return getPreferenceStore().getBoolean(CONST_SHOW_EXTERNALS); - } - - public void setShowExternals(boolean doShow) - { - getPreferenceStore().setValue(CONST_SHOW_EXTERNALS, doShow); - } - - /** - * Get the xml schema default target namespace - */ - public String getXMLSchemaTargetNamespace() { - String targetNamespace = getPreferenceStore().getString(CONST_DEFAULT_TARGET_NAMESPACE); - if (!targetNamespace.endsWith("/")) { //$NON-NLS-1$ - targetNamespace = targetNamespace + "/"; //$NON-NLS-1$ - } - return targetNamespace; - } - - /** - * Get the xml schema language qualification - */ - public boolean isQualifyXMLSchemaLanguage() { - return getPreferenceStore().getBoolean(CONST_XSD_LANGUAGE_QUALIFY); - } - - public static Shell getShell() { - return getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell(); - } - - public void setSourcePageAsDefault() - { - getPreferenceStore().setValue(DEFAULT_PAGE, SOURCE_PAGE); - } - - public void setDesignPageAsDefault() - { - getPreferenceStore().setValue(DEFAULT_PAGE, DESIGN_PAGE); - } - - /** - * Method getDefaultPage. - * - * @return String value of the string constant that is the default page - * the editor should turn to when first opened. Changes to the - * last visible page when the editor was closed - */ - public String getDefaultPage() { - return getPreferenceStore().getString(DEFAULT_PAGE); - } - - public NodeCustomizationRegistry getNodeCustomizationRegistry() - { - if (nodeCustomizationRegistry == null) - { - nodeCustomizationRegistry = new NodeCustomizationRegistry("foo"); - } - return nodeCustomizationRegistry; - } - - private static final String PRODUCT_CUSTOMIZATION_PROVIDER_PLUGIN_ID = "org.eclipse.wst.xsd.ui.productCustomizationProviderPluginId"; //$NON-NLS-1$ - private static final String PRODUCT_CUSTOMIZATION_PROVIDER_CLASS_NAME = "org.eclipse.wst.xsd.ui.productCustomizationProviderClassName"; //$NON-NLS-1$ - - private static ProductCustomizationProvider productCustomizationProvider; - private static boolean productCustomizationProviderInitialized = false; - - public ProductCustomizationProvider getProductCustomizationProvider() - { - if (!productCustomizationProviderInitialized) - { - productCustomizationProviderInitialized = true; - String pluginName = getPreferenceStore().getString(PRODUCT_CUSTOMIZATION_PROVIDER_PLUGIN_ID); - String className = getPreferenceStore().getString(PRODUCT_CUSTOMIZATION_PROVIDER_CLASS_NAME); - if (pluginName != null && pluginName.length() > 0 && - className != null && className.length() > 0) - { - try - { - Bundle bundle = Platform.getBundle(pluginName); - Class clazz = bundle.loadClass(className); - productCustomizationProvider = (ProductCustomizationProvider)clazz.newInstance(); - } - catch (Exception e) - { - } - } - } - return productCustomizationProvider; - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java deleted file mode 100644 index dfc76d3cc5..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDElementReferenceEditManager.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.eclipse.wst.xsd.ui.internal.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.gef.commands.Command; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateElementReferenceAndManageDirectivesCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateElementReferenceCommand; -import org.eclipse.wst.xsd.ui.internal.dialogs.NewElementDialog; -import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDSchema; - -public class XSDElementReferenceEditManager implements ComponentReferenceEditManager -{ - protected IFile currentFile; - protected XSDSchema[] schemas; - - public XSDElementReferenceEditManager(IFile currentFile, XSDSchema[] schemas) - { - this.currentFile = currentFile; - this.schemas = schemas; - } - - public void addToHistory(ComponentSpecification component) - { - // TODO (cs) implement me! - } - - public IComponentDialog getBrowseDialog() - { - //XSDSetExistingTypeDialog dialog = new XSDSetExistingTypeDialog(currentFile, schemas); - //return dialog; - XSDSearchListDialogDelegate dialogDelegate = - new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.ELEMENT_META_NAME, currentFile, schemas); - return dialogDelegate; - } - - public IComponentDescriptionProvider getComponentDescriptionProvider() - { - // TODO Auto-generated method stub - return null; - } - - public ComponentSpecification[] getHistory() - { - // TODO (cs) implement this properly - should this history be global or local to each editor? - // This is something we should play around with ourselves to see what feels right. - // - List list = new ArrayList(); - ComponentSpecification result[] = new ComponentSpecification[list.size()]; - list.toArray(result); - return result; - } - - public IComponentDialog getNewDialog() - { - if (schemas.length > 0) { - return new NewElementDialog(schemas[0]); - } - else { - return new NewElementDialog(); - } - } - - public ComponentSpecification[] getQuickPicks() - { - // TODO (cs) implement this properly - we should be providing a list of the - // most 'common' built in schema types here - // I believe Trung will be working on a perference page to give us this list - // for now let's hard code some values - // - List list = new ArrayList(); - - ComponentSpecification result[] = new ComponentSpecification[list.size()]; - list.toArray(result); - return result; - } - -//TODO not changed yet - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) - { - XSDElementDeclaration concreteComponent = null; - if (referencingObject instanceof Adapter) - { - Adapter adapter = (Adapter)referencingObject; - if (adapter.getTarget() instanceof XSDElementDeclaration) - { - concreteComponent = (XSDElementDeclaration)adapter.getTarget(); - } - } - else if (referencingObject instanceof XSDConcreteComponent) - { - concreteComponent = (XSDElementDeclaration) referencingObject; - } - if (concreteComponent != null) - { - if (component.isNew()) - { - XSDElementDeclaration elementDec = null; - if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME) - { - AddXSDElementCommand command = new AddXSDElementCommand(Messages._UI_ACTION_ADD_ELEMENT, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - elementDec = (XSDElementDeclaration) command.getAddedComponent(); - } - if (elementDec != null) - { - Command command = new UpdateElementReferenceCommand(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE, concreteComponent, elementDec); - command.execute(); - } - } - else - { - Command command = new UpdateElementReferenceAndManageDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile()); - command.setLabel(Messages._UI_ACTION_UPDATE_ELEMENT_REFERENCE); - command.execute(); - } - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java deleted file mode 100644 index 78f1d8930b..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDFileEditorInput.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.core.resources.IFile; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.xsd.XSDSchema; - -public class XSDFileEditorInput extends FileEditorInput -{ - private IFile file; - private XSDSchema schema; - private String editorName; - - public XSDFileEditorInput(IFile file, XSDSchema schema) { - super(file); - if (file == null) { - throw new IllegalArgumentException(); - } - this.file = file; - this.schema = schema; - editorName = file.getName(); - } - - public IFile getFile() - { - return file; - } - - public XSDSchema getSchema() - { - return schema; - } - - public void setEditorName(String name) - { - editorName = name; - } - - public String getName() - { - if (editorName != null) - { - return editorName; - } - return super.getName(); - } - - public String getToolTipText() - { - if (schema != null) - { - String ns = schema.getTargetNamespace(); - if (ns != null && ns.length() > 0) - return Messages._UI_LABEL_TARGET_NAMESPACE + ns; - else - return Messages._UI_LABEL_NO_NAMESPACE; - } - return super.getToolTipText(); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java deleted file mode 100644 index db9b913085..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - *******************************************************************************/ - -package org.eclipse.wst.xsd.ui.internal.editor; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.hyperlink.IHyperlink; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.eclipse.wst.common.uriresolver.internal.util.URIHelper; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDSchema; - -/** - * XSDHyperlink knows how to open links from XSD files. - * - * @see XSDHyperlinkDetector - */ -public class XSDHyperlink implements IHyperlink -{ - private IRegion fRegion; - private XSDConcreteComponent fComponent; - - public XSDHyperlink(IRegion region, XSDConcreteComponent component) - { - fRegion = region; - fComponent = component; - } - - public IRegion getHyperlinkRegion() - { - return fRegion; - } - - public String getTypeLabel() - { - return null; - } - - public String getHyperlinkText() - { - return null; - } - - public void open() - { - XSDSchema schema = fComponent.getSchema(); - - if (schema == null) - { - return; - } - - String schemaLocation = schema.getSchemaLocation(); - schemaLocation = URIHelper.removePlatformResourceProtocol(schemaLocation); - IPath schemaPath = new Path(schemaLocation); - IFile schemaFile = ResourcesPlugin.getWorkspace().getRoot().getFile(schemaPath); - - boolean fileExists = schemaFile != null && schemaFile.exists(); - - if (!fileExists) - { - return; - } - IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (workbenchWindow != null) - { - IWorkbenchPage workbenchPage = workbenchWindow.getActivePage(); - IEditorPart editorPart = workbenchPage.getActiveEditor(); - - workbenchPage.getNavigationHistory().markLocation(editorPart); - - try - { - editorPart = IDE.openEditor(workbenchPage, schemaFile, true); - if (editorPart instanceof InternalXSDMultiPageEditor) - { - ((InternalXSDMultiPageEditor) editorPart).openOnGlobalReference(fComponent); - } - } - catch (PartInitException pie) - { - Logger.log(Logger.WARNING_DEBUG, pie.getMessage(), pie); - } - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java deleted file mode 100644 index 8e27f1484e..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkDetector.java +++ /dev/null @@ -1,151 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 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 - * Jens Lukowski/Innoopract - initial renaming/restructuring - *******************************************************************************/ - -package org.eclipse.wst.xsd.ui.internal.editor; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.hyperlink.IHyperlink; -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.IDOMDocument; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; -import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDConstants; -import org.w3c.dom.Attr; - -/** - * Detects hyperlinks for XSD files. Used by the XSD text editor to provide a - * "Go to declaration" functionality similar with the one provided by the Java - * editor. - */ -public class XSDHyperlinkDetector extends BaseHyperlinkDetector -{ - /** - * Determines whether an attribute is "linkable" that is, the component it - * points to can be the target of a "go to definition" navigation. Derived - * classes should override. - * - * @param name the attribute name. Must not be null. - * @return true if the attribute is linkable, false otherwise. - */ - protected boolean isLinkableAttribute(String name) - { - boolean isLinkable = name.equals(XSDConstants.TYPE_ATTRIBUTE) || - name.equals(XSDConstants.REFER_ATTRIBUTE) || - name.equals(XSDConstants.REF_ATTRIBUTE) || - name.equals(XSDConstants.BASE_ATTRIBUTE) || - name.equals(XSDConstants.SCHEMALOCATION_ATTRIBUTE) || - name.equals(XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE) || - name.equals(XSDConstants.ITEMTYPE_ATTRIBUTE) || - name.equals(XSDConstants.MEMBERTYPES_ATTRIBUTE) - ; - - return isLinkable; - } - - /** - * Creates a hyperlink based on the selected node. Derived classes should - * override. - * - * @param document the source document. - * @param node the node under the cursor. - * @param region the text region to use to create the hyperlink. - * @return a new IHyperlink for the node or null if one cannot be created. - */ - protected IHyperlink createHyperlink(IDocument document, IDOMNode node, IRegion region) - { - XSDSchema xsdSchema = getXSDSchema(document); - - if (xsdSchema == null) - { - return null; - } - - XSDConcreteComponent targetComponent = getTargetXSDComponent(xsdSchema, node); - - if (targetComponent != null) - { - IRegion nodeRegion = getHyperlinkRegion(node); - - return new XSDHyperlink(nodeRegion, targetComponent); - } - - return null; - } - - /** - * Finds the XSD component for the given node. - * - * @param xsdSchema cannot be null - * @param node cannot be null - * @return XSDConcreteComponent - */ - private XSDConcreteComponent getTargetXSDComponent(XSDSchema xsdSchema, IDOMNode node) - { - XSDConcreteComponent xsdComponent = xsdSchema.getCorrespondingComponent(node); - - String attributeName = null; - - if (node instanceof Attr) - { - Attr attribute = (Attr)node; - attributeName = attribute != null ? attribute.getName(): null; - } - - XSDHyperlinkTargetLocator xsdHyperlinkTargetLocator = new XSDHyperlinkTargetLocator(); - XSDConcreteComponent component = xsdHyperlinkTargetLocator.locate(xsdComponent, attributeName); - - return component; - } - - /** - * Gets the xsd schema from document - * - * @param document - * @return XSDSchema or null of one does not exist yet for document - */ - private XSDSchema getXSDSchema(IDocument document) - { - XSDSchema schema = null; - IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document); - if (model != null) - { - try - { - if (model instanceof IDOMModel) - { - IDOMDocument domDoc = ((IDOMModel) model).getDocument(); - if (domDoc != null) - { - XSDModelAdapter modelAdapter = (XSDModelAdapter) domDoc.getExistingAdapter(XSDModelAdapter.class); - /* - * ISSUE: Didn't want to go through initializing schema if it does - * not already exist, so just attempted to get existing adapter. If - * doesn't exist, just don't bother working. - */ - if (modelAdapter != null) - schema = modelAdapter.getSchema(); - } - } - } - finally - { - model.releaseFromRead(); - } - } - return schema; - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java deleted file mode 100644 index c04aebd595..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlinkTargetLocator.java +++ /dev/null @@ -1,301 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.editor; - -import java.util.List; - -import org.eclipse.xsd.XSDAttributeDeclaration; -import org.eclipse.xsd.XSDAttributeGroupDefinition; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDIdentityConstraintDefinition; -import org.eclipse.xsd.XSDModelGroupDefinition; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDSchemaDirective; -import org.eclipse.xsd.XSDSimpleTypeDefinition; -import org.eclipse.xsd.XSDTypeDefinition; -import org.eclipse.xsd.XSDVariety; -import org.eclipse.xsd.util.XSDConstants; -import org.eclipse.xsd.util.XSDSwitch; - -/** - * A custom XSDSwitch used to locate the "referenced" component. Used by the - * hyperlink/F3 navigation mechanism. Made a separate class because it is used - * from the WSDL editor as well. - */ -public class XSDHyperlinkTargetLocator extends XSDSwitch -{ - /** - * Holds the attribute name if the cursor/mouse is over an attribute. - */ - private String attributeName; - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDAttributeDeclaration(org.eclipse.xsd.XSDAttributeDeclaration) - */ - public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration attributeDeclaration) - { - XSDConcreteComponent target = null; - - if (attributeDeclaration.isAttributeDeclarationReference()) - { - target = attributeDeclaration.getResolvedAttributeDeclaration(); - } - else if (attributeDeclaration.getAnonymousTypeDefinition() == null) - { - target = attributeDeclaration.getTypeDefinition(); - - // Avoid navigating to built in data types. - - if (isFromSchemaForSchema(target)) - { - target = null; - } - } - return target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDAttributeGroupDefinition(org.eclipse.xsd.XSDAttributeGroupDefinition) - */ - public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroupDefinition) - { - XSDConcreteComponent target = null; - - if (attributeGroupDefinition.isAttributeGroupDefinitionReference()) - { - target = attributeGroupDefinition.getResolvedAttributeGroupDefinition(); - } - - return target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDElementDeclaration(org.eclipse.xsd.XSDElementDeclaration) - */ - public Object caseXSDElementDeclaration(XSDElementDeclaration elementDeclaration) - { - XSDConcreteComponent target = null; - - if (elementDeclaration.isElementDeclarationReference()) - { - target = elementDeclaration.getResolvedElementDeclaration(); - } - else - { - XSDConcreteComponent typeDefinition = null; - - if (elementDeclaration.getAnonymousTypeDefinition() == null) - { - typeDefinition = elementDeclaration.getTypeDefinition(); - } - - XSDConcreteComponent substitutionGroupAffiliation = elementDeclaration.getSubstitutionGroupAffiliation(); - - if (typeDefinition != null && substitutionGroupAffiliation != null) - { - // There are 2 things we can navigate to: if the cursor is anywhere on - // the - // substitution attribute then jump to that, otherwise just go to the - // base type. - - if (XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE.equals(attributeName)) - { - target = substitutionGroupAffiliation; - } - else - { - target = typeDefinition; - } - } - else - { - target = typeDefinition != null ? typeDefinition : substitutionGroupAffiliation; - } - - if (isFromSchemaForSchema(target)) - { - target = null; - } - } - - return target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDIdentityConstraintDefinition(org.eclipse.xsd.XSDIdentityConstraintDefinition) - */ - public Object caseXSDIdentityConstraintDefinition(XSDIdentityConstraintDefinition idConstraintDefinition) - { - Object target = null; - - XSDIdentityConstraintDefinition referencedKey = idConstraintDefinition.getReferencedKey(); - - if (referencedKey != null) - { - target = referencedKey; - } - - return target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDModelGroupDefinition(org.eclipse.xsd.XSDModelGroupDefinition) - */ - public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition modelGroupDefinition) - { - XSDConcreteComponent target = null; - - if (modelGroupDefinition.isModelGroupDefinitionReference()) - { - target = modelGroupDefinition.getResolvedModelGroupDefinition(); - } - - return target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) - */ - public Object caseXSDSchemaDirective(XSDSchemaDirective directive) - { - XSDSchema schema = directive.getResolvedSchema(); - - return schema; - } - - public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition typeDefinition) - { - XSDConcreteComponent target = null; - - // Simple types can be one of: atomic, list or union. - - XSDVariety variety = typeDefinition.getVariety(); - int varietyType = variety.getValue(); - - switch (varietyType) - { - case XSDVariety.ATOMIC: - { - target = typeDefinition.getBaseTypeDefinition(); - } - break; - case XSDVariety.LIST: - { - target = typeDefinition.getItemTypeDefinition(); - } - break; - case XSDVariety.UNION: - { - List memberTypes = typeDefinition.getMemberTypeDefinitions(); - if (memberTypes != null && memberTypes.size() > 0) - { - // ISSUE: What if there are more than one type? - // This could be a case for multiple hyperlinks at the same - // location. - target = (XSDConcreteComponent) memberTypes.get(0); - } - } - break; - } - - // Avoid navigating to built in data types. - - if (isFromSchemaForSchema(target)) - { - target = null; - } - - return target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.xsd.util.XSDSwitch#caseXSDTypeDefinition(org.eclipse.xsd.XSDTypeDefinition) - */ - public Object caseXSDTypeDefinition(XSDTypeDefinition typeDefinition) - { - XSDConcreteComponent target = null; - - XSDTypeDefinition baseType = typeDefinition.getBaseType(); - - if (baseType != null) - { - target = baseType; - } - - // Avoid navigating to built in data types. - - if (isFromSchemaForSchema(target)) - { - target = null; - } - - return target; - } - - /** - * Detects if a given schema component is from the schema for schema (built in - * data types). Used to avoid navigating to this type of components as they - * don't have an accessible physical location. - * - * @param component the component to check. - * @return true if the component is from the schema for schema namespace, - * false otherwise. - */ - public boolean isFromSchemaForSchema(XSDConcreteComponent component) - { - if (component == null) - { - return false; - } - - XSDSchema schema = component.getSchema(); - - if (schema != null && schema.equals(schema.getSchemaForSchema())) - { - return true; - } - - return false; - } - - /** - * Locates the target component - for example the element declaration pointed - * to by an element reference, etc. - * - * @param component the current component. - * @param attributeName the attribute name if the cursor/mouse is over an - * attribute. This is used to provide fine grained navigation for - * components with more than one "active" attribute. - * @return the referenced XSD concrete component or null if none is found. - */ - public XSDConcreteComponent locate(XSDConcreteComponent component, String attributeName) - { - this.attributeName = attributeName; - - return (XSDConcreteComponent) doSwitch(component); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java deleted file mode 100644 index 6025e2d117..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDMultiPageEditorContributor.java +++ /dev/null @@ -1,263 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 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.editor; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.gef.editparts.ZoomManager; -import org.eclipse.gef.ui.actions.ActionRegistry; -import org.eclipse.gef.ui.actions.GEFActionConstants; -import org.eclipse.gef.ui.actions.ZoomComboContributionItem; -import org.eclipse.gef.ui.actions.ZoomInRetargetAction; -import org.eclipse.gef.ui.actions.ZoomOutRetargetAction; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorActionBarContributor; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPartSite; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.actions.RetargetAction; -import org.eclipse.ui.part.MultiPageEditorActionBarContributor; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.wst.sse.ui.internal.ISourceViewerActionBarContributor; -import org.eclipse.wst.xsd.ui.internal.actions.IXSDToolbarAction; -import org.eclipse.wst.xsd.ui.internal.adt.actions.CaptureScreenAction; -import org.eclipse.wst.xsd.ui.internal.adt.actions.DeleteAction; - -/** - * Manages the installation/deinstallation of global actions for multi-page - * editors. Responsible for the redirection of global actions to the active - * editor. Multi-page contributor replaces the contributors for the individual - * editors in the multi-page editor. - */ -public class XSDMultiPageEditorContributor extends MultiPageEditorActionBarContributor -{ - private IEditorPart activeEditorPart; - private InternalXSDMultiPageEditor xsdEditor; - protected ITextEditor textEditor; - protected IEditorActionBarContributor sourceViewerActionContributor = null; - protected List fPartListeners= new ArrayList(); - ZoomInRetargetAction zoomInRetargetAction; - ZoomOutRetargetAction zoomOutRetargetAction; - Action captureScreenAction; - ZoomComboContributionItem zoomComboContributionItem; - /** - * Creates a multi-page contributor. - */ - public XSDMultiPageEditorContributor() - { - super(); - sourceViewerActionContributor = new SourcePageActionContributor(); - zoomInRetargetAction = new ZoomInRetargetAction(); - zoomOutRetargetAction = new ZoomOutRetargetAction(); - captureScreenAction = new CaptureScreenAction(); - fPartListeners.add(zoomInRetargetAction); - fPartListeners.add(zoomOutRetargetAction); - } - - /** - * Returns the action registed with the given text editor. - * - * @return IAction or null if editor is null. - */ - protected IAction getAction(ITextEditor editor, String actionID) - { - return (editor == null ? null : editor.getAction(actionID)); - } - - /* - * (non-JavaDoc) Method declared in - * AbstractMultiPageEditorActionBarContributor. - */ - - public void setActivePage(IEditorPart part) - { - if (activeEditorPart == part) - return; - - activeEditorPart = part; - - IActionBars actionBars = getActionBars(); - boolean isSource = false; - - if (activeEditorPart != null && activeEditorPart instanceof ITextEditor) - { - isSource = true; - zoomInRetargetAction.setEnabled(false); - zoomOutRetargetAction.setEnabled(false); - captureScreenAction.setEnabled(false); - activateSourcePage(activeEditorPart, true); - } - else - { - activateSourcePage(xsdEditor, false); - if (part instanceof InternalXSDMultiPageEditor) - { - xsdEditor = (InternalXSDMultiPageEditor) part; - } - if (xsdEditor != null) - { - // cs: here's we ensure the UNDO and REDO actions are available when - // the design view is active - IWorkbenchPartSite site = xsdEditor.getSite(); - if (site instanceof IEditorSite) - { - ITextEditor textEditor = xsdEditor.getTextEditor(); - IActionBars siteActionBars = ((IEditorSite) site).getActionBars(); - siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, getAction(textEditor, ITextEditorActionConstants.UNDO)); - siteActionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, getAction(textEditor, ITextEditorActionConstants.REDO)); - siteActionBars.updateActionBars(); - } - - Object adapter = xsdEditor.getAdapter(ActionRegistry.class); - if (adapter instanceof ActionRegistry) - { - ActionRegistry registry = (ActionRegistry) adapter; - actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), registry.getAction(DeleteAction.ID)); - actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_IN, registry.getAction(GEFActionConstants.ZOOM_IN)); - actionBars.setGlobalActionHandler(GEFActionConstants.ZOOM_OUT, registry.getAction(GEFActionConstants.ZOOM_OUT)); - actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(), registry.getAction(ActionFactory.PRINT.getId())); - zoomInRetargetAction.setEnabled(true); - zoomOutRetargetAction.setEnabled(true); - captureScreenAction.setEnabled(true); - } - } - } - - if (actionBars != null) { - // update menu bar and tool bar - actionBars.updateActionBars(); - } - - if (zoomComboContributionItem != null) - { - zoomComboContributionItem.setVisible(!isSource); - zoomComboContributionItem.update(); - } - } - - protected void activateSourcePage(IEditorPart activeEditor, boolean state) - { - if (sourceViewerActionContributor != null && sourceViewerActionContributor instanceof ISourceViewerActionBarContributor) - { - sourceViewerActionContributor.setActiveEditor(activeEditor); - ((ISourceViewerActionBarContributor) sourceViewerActionContributor).setViewerSpecificContributionsEnabled(state); - } - } - - public void setActiveEditor(IEditorPart part) - { - IEditorPart activeNestedEditor = null; - if (part instanceof MultiPageEditorPart) - { - activeNestedEditor = part; - } - setActivePage(activeNestedEditor); - - if (part instanceof InternalXSDMultiPageEditor) - { - xsdEditor = (InternalXSDMultiPageEditor) part; - - textEditor = xsdEditor.getTextEditor(); - if (textEditor != null) - { -// updateActions(); - getActionBars().updateActionBars(); - } - } - - List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions(); - for (Iterator i = list.iterator(); i.hasNext(); ) - { - ((IXSDToolbarAction)i.next()).setEditorPart(activeNestedEditor); - } - - super.setActiveEditor(part); - } - - public void contributeToMenu(IMenuManager manager) - { - IMenuManager menu = new MenuManager(Messages._UI_MENU_XSD_EDITOR); - manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu); - - // Add extension menu actions - List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions(); - for (Iterator i = list.iterator(); i.hasNext(); ) - { - menu.add((IXSDToolbarAction)i.next()); - } - - menu.add(zoomInRetargetAction); - menu.add(zoomOutRetargetAction); - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - menu.add(captureScreenAction); - - menu.updateAll(true); - } - - public void contributeToToolBar(IToolBarManager manager) - { - manager.add(new Separator()); - // Add extension toolbar actions - List list = XSDEditorPlugin.getPlugin().getXSDEditorConfiguration().getToolbarActions(); - for (Iterator i = list.iterator(); i.hasNext(); ) - { - manager.add((IXSDToolbarAction)i.next()); - } - - manager.add(new Separator()); - String[] zoomStrings = new String[] { ZoomManager.FIT_ALL, ZoomManager.FIT_HEIGHT, ZoomManager.FIT_WIDTH }; - zoomComboContributionItem = new ZoomComboContributionItem(getPage(), zoomStrings); - manager.add(zoomComboContributionItem); - manager.add(captureScreenAction); - } - - - public void init(IActionBars bars, IWorkbenchPage page) - { - Iterator e = fPartListeners.iterator(); - while (e.hasNext()) - { - page.addPartListener((RetargetAction) e.next()); - } - - initSourceViewerActionContributor(bars); - - super.init(bars, page); - } - - - protected void initSourceViewerActionContributor(IActionBars actionBars) { - if (sourceViewerActionContributor != null) - sourceViewerActionContributor.init(actionBars, getPage()); - } - - public void dispose() - { - fPartListeners = null; - if (sourceViewerActionContributor != null) - sourceViewerActionContributor.dispose(); - super.dispose(); - } - -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java deleted file mode 100644 index e5275999e0..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSelectionMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; - -public class XSDSelectionMapper implements ISelectionMapper -{ - public ISelection mapSelection(ISelection selection) - { - List list = new ArrayList(); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection)selection; - for (Iterator i = structuredSelection.iterator(); i.hasNext(); ) - { - Object o = i.next(); - if (o instanceof Adapter) - { - list.add(((Adapter)o).getTarget()); - } - else - { - list.add(o); - } - } - } - return new StructuredSelection(list); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java deleted file mode 100644 index a6f9641561..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDSubstitutionGroupEditManager.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.gef.commands.Command; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDElementCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateAttributeValueCommand; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDConstants; - -public class XSDSubstitutionGroupEditManager extends XSDElementReferenceEditManager -{ - - public XSDSubstitutionGroupEditManager(IFile currentFile, XSDSchema[] schemas) - { - super(currentFile, schemas); - } - - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) - { - XSDElementDeclaration concreteComponent = null; - if (referencingObject instanceof Adapter) - { - Adapter adapter = (Adapter)referencingObject; - if (adapter.getTarget() instanceof XSDElementDeclaration) - { - concreteComponent = (XSDElementDeclaration)adapter.getTarget(); - } - } - else if (referencingObject instanceof XSDConcreteComponent) - { - concreteComponent = (XSDElementDeclaration) referencingObject; - } - if (concreteComponent != null) - { - if (component.isNew()) - { - XSDElementDeclaration elementDec = null; - if (component.getMetaName() == IXSDSearchConstants.ELEMENT_META_NAME) - { - AddXSDElementCommand command = new AddXSDElementCommand(Messages._UI_ACTION_ADD_ELEMENT, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - elementDec = (XSDElementDeclaration) command.getAddedComponent(); - } - if (elementDec != null) - { - Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, elementDec.getQName(concreteComponent.getSchema())); - command.execute(); - } - } - else - { - Command command = new UpdateAttributeValueCommand(concreteComponent.getElement(), XSDConstants.SUBSTITUTIONGROUP_ATTRIBUTE, ((XSDElementDeclaration)component.getObject()).getQName(concreteComponent.getSchema())); - command.execute(); - } - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java deleted file mode 100644 index 49c408a5f1..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTabbedPropertySheetPage.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; -import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter; -import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDAdapterFactory; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDElementDeclarationAdapter; -import org.eclipse.wst.xsd.ui.internal.adapters.XSDParticleAdapter; -import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObjectListener; -import org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; - -public class XSDTabbedPropertySheetPage extends TabbedPropertySheetPage implements IADTObjectListener -{ - XSDBaseAdapter oldSelection; - XSDModelAdapter xsdModelAdapter; - public XSDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor) - { - super(tabbedPropertySheetPageContributor); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - - Object selected = ((StructuredSelection)selection).getFirstElement(); - if (selected instanceof XSDBaseAdapter) - { - XSDBaseAdapter adapter = (XSDBaseAdapter)selected; - if (oldSelection != null) - { - oldSelection.unregisterListener(this); - if (oldSelection instanceof XSDElementDeclarationAdapter) - { - XSDElementDeclaration elem = (XSDElementDeclaration)((XSDElementDeclarationAdapter)oldSelection).getTarget(); - if (elem.getContainer() != null) - { - Adapter adap = XSDAdapterFactory.getInstance().adapt(elem.getContainer()); - if (adap instanceof XSDParticleAdapter) - { - XSDParticleAdapter particleAdapter = (XSDParticleAdapter)adap; - particleAdapter.unregisterListener(this); - } - } - if (elem.isElementDeclarationReference()) - { - XSDElementDeclarationAdapter resolvedElementAdapter = (XSDElementDeclarationAdapter)XSDAdapterFactory.getInstance().adapt(elem.getResolvedElementDeclaration()); - resolvedElementAdapter.unregisterListener(this); - } - } - } - if (adapter instanceof XSDElementDeclarationAdapter) - { - XSDElementDeclaration elem = (XSDElementDeclaration)((XSDElementDeclarationAdapter)adapter).getTarget(); - Adapter adap = XSDAdapterFactory.getInstance().adapt(elem.getContainer()); - if (adap instanceof XSDParticleAdapter) - { - XSDParticleAdapter particleAdapter = (XSDParticleAdapter)adap; - particleAdapter.registerListener(this); - } - if (elem.isElementDeclarationReference()) - { - XSDElementDeclarationAdapter resolvedElementAdapter = (XSDElementDeclarationAdapter)XSDAdapterFactory.getInstance().adapt(elem.getResolvedElementDeclaration()); - resolvedElementAdapter.registerListener(this); - } - } - adapter.registerListener(this); - oldSelection = adapter; - Object model = adapter.getTarget(); - - if (xsdModelAdapter != null && xsdModelAdapter.getModelReconcileAdapter() != null) - { - xsdModelAdapter.getModelReconcileAdapter().removeListener(internalNodeAdapter); - } - - xsdModelAdapter = XSDModelAdapter.lookupOrCreateModelAdapter(((XSDConcreteComponent)adapter.getTarget()).getElement().getOwnerDocument()); - if (xsdModelAdapter != null && xsdModelAdapter.getModelReconcileAdapter() != null) - { - xsdModelAdapter.getModelReconcileAdapter().addListener(internalNodeAdapter); - } - - if (model instanceof XSDConcreteComponent) - { - selection = new StructuredSelection(model); - } - super.selectionChanged(part, selection); - return; - } - super.selectionChanged(part, selection); - } - - public void propertyChanged(Object object, String property) - { - if (getCurrentTab() != null) - { - refresh(); - } - } - - public void dispose() - { - if (xsdModelAdapter != null && xsdModelAdapter.getModelReconcileAdapter() != null) - { - xsdModelAdapter.getModelReconcileAdapter().removeListener(internalNodeAdapter); - xsdModelAdapter = null; - } - super.dispose(); - } - - protected INodeAdapter internalNodeAdapter = new InternalNodeAdapter(); - class InternalNodeAdapter implements INodeAdapter - { - public boolean isAdapterForType(Object type) - { - return false; - } - - public void notifyChanged(INodeNotifier notifier, int eventType, Object changedFeature, Object oldValue, Object newValue, int pos) - { - refresh(); - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java deleted file mode 100644 index 1a78dde0bf..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDTypeReferenceEditManager.java +++ /dev/null @@ -1,190 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.gef.commands.Command; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -import org.eclipse.wst.xsd.ui.internal.adt.edit.ComponentReferenceEditManager; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDComplexTypeDefinitionCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.AddXSDSimpleTypeDefinitionCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTypeReferenceAndManageDirectivesCommand; -import org.eclipse.wst.xsd.ui.internal.common.commands.UpdateTypeReferenceCommand; -import org.eclipse.wst.xsd.ui.internal.dialogs.NewTypeDialog; -import org.eclipse.wst.xsd.ui.internal.editor.search.XSDSearchListDialogDelegate; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDComplexTypeDefinition; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDFactory; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDSimpleTypeDefinition; -import org.eclipse.xsd.XSDTypeDefinition; -import org.eclipse.xsd.util.XSDConstants; -import org.eclipse.xsd.util.XSDSchemaBuildingTools; - -public class XSDTypeReferenceEditManager implements ComponentReferenceEditManager -{ - protected IFile currentFile; - protected XSDSchema[] schemas; - - private static ComponentSpecification result[]; - - public XSDTypeReferenceEditManager(IFile currentFile, XSDSchema[] schemas) - { - this.currentFile = currentFile; - this.schemas = schemas; - } - - public void addToHistory(ComponentSpecification component) - { - // TODO (cs) implement me! - } - - public IComponentDialog getBrowseDialog() - { - //XSDSetExistingTypeDialog dialog = new XSDSetExistingTypeDialog(currentFile, schemas); - //return dialog; - XSDSearchListDialogDelegate dialogDelegate = new XSDSearchListDialogDelegate(XSDSearchListDialogDelegate.TYPE_META_NAME, currentFile, schemas); - return dialogDelegate; - } - - public IComponentDescriptionProvider getComponentDescriptionProvider() - { - // TODO Auto-generated method stub - return null; - } - - public ComponentSpecification[] getHistory() - { - // TODO (cs) implement this properly - should this history be global or local to each editor? - // This is something we should play around with ourselves to see what feels right. - // - List list = new ArrayList(); - ComponentSpecification result[] = new ComponentSpecification[list.size()]; - list.toArray(result); - return result; - } - - public IComponentDialog getNewDialog() - { - if (schemas.length > 0) { - return new NewTypeDialog(schemas[0]); - } - else { - return new NewTypeDialog(); - } - } - - public ComponentSpecification[] getQuickPicks() - { - if (result != null) - return result; - - // TODO (cs) implement this properly - we should be providing a list of the - // most 'common' built in schema types here - // I believe Trung will be working on a perference page to give us this list - // for now let's hard code some values - // - List list = new ArrayList(); - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "boolean", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "date", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "dateTime", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "double", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "float", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "hexBinary", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "int", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string", null)); //$NON-NLS-1$ - list.add(new ComponentSpecification(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "time", null)); //$NON-NLS-1$ - result = new ComponentSpecification[list.size()]; - list.toArray(result); - return result; - } - - - public void modifyComponentReference(Object referencingObject, ComponentSpecification component) - { - XSDConcreteComponent concreteComponent = null; - if (referencingObject instanceof Adapter) - { - Adapter adpater = (Adapter)referencingObject; - if (adpater.getTarget() instanceof XSDConcreteComponent) - { - concreteComponent = (XSDConcreteComponent)adpater.getTarget(); - } - } - else if (referencingObject instanceof XSDConcreteComponent) - { - concreteComponent = (XSDConcreteComponent) referencingObject; - } - - if (concreteComponent != null) - { - if (component.isNew()) - { - XSDTypeDefinition td = null; - if (component.getName() == null // This means we set to anonymous type - && concreteComponent instanceof XSDElementDeclaration) - { - XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory(); - XSDElementDeclaration elementDeclaration = (XSDElementDeclaration) concreteComponent; - // TODO (cs) we should use actions here so that UNDO/REDO can work nicely - // with the proper undo descriptions - if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME) - { - XSDComplexTypeDefinition complexType = factory.createXSDComplexTypeDefinition(); - elementDeclaration.setAnonymousTypeDefinition(complexType); - } - else - { - XSDSimpleTypeDefinition simpleType = factory.createXSDSimpleTypeDefinition(); - simpleType.setBaseTypeDefinition( - elementDeclaration.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string") ); //$NON-NLS-1$ - elementDeclaration.setAnonymousTypeDefinition(simpleType); - } - elementDeclaration.getElement().removeAttribute("type"); //TODO use external literal string - } - else if (component.getMetaName() == IXSDSearchConstants.COMPLEX_TYPE_META_NAME) - { - AddXSDComplexTypeDefinitionCommand command = new AddXSDComplexTypeDefinitionCommand(Messages._UI_ACTION_ADD_COMPLEX_TYPE, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - td = command.getCreatedComplexType(); - } - else - { - AddXSDSimpleTypeDefinitionCommand command = new AddXSDSimpleTypeDefinitionCommand(Messages._UI_ACTION_ADD_SIMPLE_TYPE, concreteComponent.getSchema()); - command.setNameToAdd(component.getName()); - command.execute(); - td = command.getCreatedSimpleType(); - } - if (td != null) - { - Command command = new UpdateTypeReferenceCommand(concreteComponent, td); - command.setLabel(Messages._UI_ACTION_SET_TYPE); - command.execute(); - } - } - else - { - Command command = new UpdateTypeReferenceAndManageDirectivesCommand(concreteComponent, component.getName(), component.getQualifier(), component.getFile()); - command.setLabel(Messages._UI_ACTION_SET_TYPE); - command.execute(); - } - } - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif Binary files differdeleted file mode 100644 index 210bb24ce0..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/Dot.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif Binary files differdeleted file mode 100644 index ac58c1e8ab..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateDtd.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif Binary files differdeleted file mode 100644 index 2375c655d8..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GenerateJava.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif Binary files differdeleted file mode 100644 index d535dac36d..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/GraphViewElementRef.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.png b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.png Binary files differdeleted file mode 100644 index 0c4caf1cc2..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/NewXSD.png +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif Binary files differdeleted file mode 100644 index 3d550a30e8..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/RegexWizardArrow.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif Binary files differdeleted file mode 100644 index bd37eb50b5..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/TriangleToolBar.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif Binary files differdeleted file mode 100644 index 2b347ac458..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/ValidateXSD.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif Binary files differdeleted file mode 100644 index 6d74e802b5..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAll.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif Binary files differdeleted file mode 100644 index d2108c0368..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnnotate.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif Binary files differdeleted file mode 100644 index a39f93cdce..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAny.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif Binary files differdeleted file mode 100644 index 5280cc2904..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAnyAttribute.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif Binary files differdeleted file mode 100644 index 2da001e3e9..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAppInfo.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif Binary files differdeleted file mode 100644 index 79d49d037b..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttribute.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif Binary files differdeleted file mode 100644 index 648462ff67..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroup.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif Binary files differdeleted file mode 100644 index a89fa8f187..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeGroupRef.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif Binary files differdeleted file mode 100644 index 8365af2f3c..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDAttributeRef.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif Binary files differdeleted file mode 100644 index 89ba825253..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDChoice.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif Binary files differdeleted file mode 100644 index 41c68dda8c..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexContent.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif Binary files differdeleted file mode 100644 index 007f8522af..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDComplexType.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif Binary files differdeleted file mode 100644 index 4fc84e4c3a..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDateAndTimeTypes.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif Binary files differdeleted file mode 100644 index d349a05f2b..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDDoc.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif Binary files differdeleted file mode 100644 index dd45f08fb1..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElement.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif Binary files differdeleted file mode 100644 index 749acfc9c9..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDElementRef.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif Binary files differdeleted file mode 100644 index 0cfb8076dd..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDExtension.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif Binary files differdeleted file mode 100644 index 378e43e14d..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDField.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif Binary files differdeleted file mode 100644 index 3900f1b55d..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDFile.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif Binary files differdeleted file mode 100644 index 79d49d037b..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalAttribute.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif Binary files differdeleted file mode 100644 index dd45f08fb1..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGlobalElement.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif Binary files differdeleted file mode 100644 index 555ef53306..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroup.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif Binary files differdeleted file mode 100644 index 34a7fb3f23..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDGroupRef.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif Binary files differdeleted file mode 100644 index 9e44ce52a9..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDImport.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif Binary files differdeleted file mode 100644 index b26c527f5e..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDInclude.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif Binary files differdeleted file mode 100644 index 04032a915a..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKey.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif Binary files differdeleted file mode 100644 index ee5829d693..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDKeyRef.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif Binary files differdeleted file mode 100644 index ce9df985b8..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNotation.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif Binary files differdeleted file mode 100644 index 7134210d0a..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDNumberTypes.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif Binary files differdeleted file mode 100644 index 56964c13a5..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDRedefine.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif Binary files differdeleted file mode 100644 index 2399a58204..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSelector.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif Binary files differdeleted file mode 100644 index 8bf3f972d2..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSequence.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif Binary files differdeleted file mode 100644 index 7ef38df720..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleContent.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif Binary files differdeleted file mode 100644 index 11d7958525..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleEnum.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif Binary files differdeleted file mode 100644 index d08e78f891..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleList.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif Binary files differdeleted file mode 100644 index a113cf45a0..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimplePattern.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif Binary files differdeleted file mode 100644 index 38bc12e32f..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleRestrict.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif Binary files differdeleted file mode 100644 index 75f33c24fa..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleType.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif Binary files differdeleted file mode 100644 index 9aefeb27b6..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleTypeForEditPart.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif Binary files differdeleted file mode 100644 index 292adafc8e..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDSimpleUnion.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif Binary files differdeleted file mode 100644 index 5a8a650f3d..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/XSDUnique.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif Binary files differdeleted file mode 100644 index 85f9baaf44..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_browse.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif Binary files differdeleted file mode 100644 index 9e665d5c78..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/appinfo_category.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif Binary files differdeleted file mode 100644 index 24d1a279e5..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/back.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif Binary files differdeleted file mode 100644 index 13dae59bea..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/browsebutton.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif Binary files differdeleted file mode 100644 index 0bc60689c6..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/error_st_obj.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif Binary files differdeleted file mode 100644 index eab699e385..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/forward.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif Binary files differdeleted file mode 100644 index f2e363564f..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/generate_xml.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif Binary files differdeleted file mode 100644 index 94ae2a0ee2..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/quickassist.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.png b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.png Binary files differdeleted file mode 100644 index 2b1477a3f6..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/regx_wiz.png +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif Binary files differdeleted file mode 100644 index c705db0c1e..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/reloadgrammar.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif Binary files differdeleted file mode 100644 index 3c65dc4ba1..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/sort.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif Binary files differdeleted file mode 100644 index a61441f2a8..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/icons/xmlcatalog_obj.gif +++ /dev/null diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties deleted file mode 100644 index dcdc5a5741..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/messages.properties +++ /dev/null @@ -1,113 +0,0 @@ -############################################################################### -# Copyright (c) 2001, 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 -############################################################################### - -UI_LABEL_BASE_TYPE = Base Type: -UI_LABEL_DERIVED_BY = Derived By: - -UI_LABEL_INHERIT_FROM = Inherit From: -UI_LABEL_INHERIT_BY = Inherit By: - -UI_LABEL_DOCUMENTATION = Documentation -UI_LABEL_APP_INFO = App Info - -UI_LABEL_SET_TYPE = Set Type -UI_LABEL_TYPE = Type: - -UI_LABEL_NAME = Name: - -UI_LABEL_KIND = Kind: - -UI_LABEL_MINOCCURS = Minimum Occurrence: -UI_LABEL_MAXOCCURS = Maximum Occurrence: - -UI_PAGE_HEADING_REFERENCE = Reference -UI_LABEL_READ_ONLY = Read-Only - -UI_NO_TYPE = No Type - -UI_LABEL_COMPONENTS = Components: - -! Additional Categories -_UI_GRAPH_TYPES = Types -_UI_GRAPH_ELEMENTS = Elements -_UI_GRAPH_ATTRIBUTES = Attributes -_UI_GRAPH_ATTRIBUTE_GROUPS = Attribute Groups -_UI_GRAPH_NOTATIONS = Notations -_UI_GRAPH_IDENTITY_CONSTRAINTS = Identity Constraints -_UI_GRAPH_ANNOTATIONS = Annotations -_UI_GRAPH_DIRECTIVES = Directives -_UI_GRAPH_GROUPS = Groups - -_UI_LABEL_NO_LOCATION_SPECIFIED = No Location Specified -_UI_ACTION_SET_MULTIPLICITY = Set Multiplicity -_UI_LABEL_ABSENT = absent -_UI_GRAPH_UNKNOWN_OBJECT = Unknown object -_UI_GRAPH_XSDSCHEMA_NO_NAMESPACE = (no target namespace specified) -_UI_GRAPH_XSDSCHEMA = Schema -_UI_MENU_XSD_EDITOR = &XSD -_UI_LABEL_SET_TYPE = Set Type - -! -! Preference Page -! -_UI_TEXT_INDENT_LABEL = Indentation -_UI_TEXT_INDENT_SPACES_LABEL = &Number of spaces: -_UI_TEXT_XSD_NAMESPACE_PREFIX = XML schema language -_UI_TEXT_XSD_DEFAULT_PREFIX = XML schema language constructs &prefix: -_UI_QUALIFY_XSD = &Qualify XML schema language constructs -_UI_TEXT_XSD_DEFAULT_TARGET_NAMESPACE = Default Target Namespace: -_UI_VALIDATING_FILES = Validating files -_UI_TEXT_HONOUR_ALL_SCHEMA_LOCATIONS = Honour all schema locations - -_ERROR_LABEL_INVALID_PREFIX = IWAX1004E Invalid prefix. A prefix must not be empty or contain any space. - -_UI_NO_TYPE_DEFINED=(no type defined) -_UI_ACTION_UPDATE_NAME=Update Name -_UI_ACTION_UPDATE_ELEMENT_REFERENCE=Update Element reference -_UI_ACTION_ADD_FIELD=Add Field -_UI_ACTION_ADD_ELEMENT=Add Element -_UI_ACTION_ADD_INCLUDE=Add Include -_UI_ACTION_ADD_IMPORT=Add Import -_UI_ACTION_ADD_REDEFINE=Add Redefine -_UI_ACTION_ADD_ELEMENT_REF=Add Element Ref -_UI_ACTION_ADD_COMPLEX_TYPE=Add Complex Type -_UI_ACTION_ADD_SIMPLE_TYPE=Add Simple Type -_UI_ACTION_SET_TYPE=Set Type -_UI_ACTION_ADD_ATTRIBUTE_REF=Add Attribute Ref -_UI_ACTION_NEW=New... -_UI_ACTION_BROWSE=Browse... - -_UI_LABEL_OPTIONAL=Optional -_UI_LABEL_ZERO_OR_MORE=Zero or more -_UI_LABEL_ONE_OR_MORE=One or more -_UI_LABEL_LOCAL_TYPE=local type -_UI_LABEL_REQUIRED=Required -_UI_LABEL_ARRAY=array - -_UI_LABEL_SET_COMMON_BUILT_IN_TYPES=Set common Built-In types -_UI_LABEL_SELECT_TYPES_FILTER_OUT=Select the types that you do not want to filter out: -_UI_LABEL_NAME_SEARCH_FILTER_TEXT=Name (? = any character, * = any string): -_UI_LABEL_SET_ELEMENT_REFERENCE=Set element reference - -_UI_LABEL_NEW_TYPE=New Type -_UI_LABEL_NEW_ELEMENT=New Element -_UI_LABEL_COMPLEX_TYPE=Complex Type -_UI_LABEL_TARGET_NAMESPACE=Target Namespace: -_UI_LABEL_NO_NAMESPACE=No Namespace -_UI_LABEL_ELEMENTS_COLON=Elements: -_UI_LABEL_SIMPLE_TYPE=Simple Type -_UI_LABEL_TYPES_COLON=Types: - -_UI_LABEL_SOURCE=Source - -_UI_LABEL_ELEMENTFORMDEFAULT=Prefix qualification of local elements: -_UI_LABEL_ATTRIBUTEFORMDEFAULT=Prefix qualification of attributes: -_UI_LABEL_CREATE_ANON_TYPE=Create as local anonymous type diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java deleted file mode 100644 index 4e3c62acfb..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/IXSDTypesFilter.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor.search; - -public interface IXSDTypesFilter { - /** - * Give me an Object o, if I know it and it should be filtered out, I will - * return true. Otherwise I'll return false, even if I don't know the object - * @param o - * @return - */ - public boolean shouldFilterOut(Object o); - - public void turnOn(); - public void turnOff(); - public boolean isOn(); -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java deleted file mode 100644 index aa9a0342c8..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDComponentDescriptionProvider.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor.search; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.wst.common.core.search.SearchMatch; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentDescriptionProvider; -import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDComplexTypeDefinition; -import org.eclipse.xsd.XSDConcreteComponent; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDNamedComponent; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDSimpleTypeDefinition; - -public class XSDComponentDescriptionProvider extends LabelProvider implements IComponentDescriptionProvider -{ - public boolean isApplicable(Object component) - { - // TODO (cs) if this provider is used in a multi language context - // we'll need to provide some logic here - return true; - } - - private static final Image SIMPLE_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDSimpleType.gif"); - private static final Image COMPLEX_TYPE_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDComplexType.gif"); - private static final Image ELEMENT_IMAGE = XSDEditorPlugin.getXSDImage("icons/XSDElement.gif"); - //private final static Image BUILT_IN_TYPE)IMAGE = - - public String getQualifier(Object component) - { - String result = null; - if (component instanceof ComponentSpecification) - { - result = ((ComponentSpecification)component).getQualifier(); - } - else if (component instanceof XSDNamedComponent) - { - result = ((XSDNamedComponent)component).getTargetNamespace(); - } - else if (component instanceof SearchMatch) - { - QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component); - if (qualifiedName != null) - { - result = qualifiedName.getNamespace(); - } - } - return result; - } - - // TODO... this will be much easier with Hiroshi's proposed SearchMatch changes - // - private QualifiedName getQualifiedNameForSearchMatch(SearchMatch match) - { - QualifiedName qualifiedName = null; - Object o = match.map.get("name"); - if (o != null && o instanceof QualifiedName) - { - qualifiedName = (QualifiedName)o; - } - return qualifiedName; - } - - public String getName(Object component) - { - String result = null; - if (component instanceof ComponentSpecification) - { - result = ((ComponentSpecification)component).getName(); - } - else if (component instanceof XSDNamedComponent) - { - result = ((XSDNamedComponent)component).getName(); - } - else if (component instanceof SearchMatch) - { - QualifiedName qualifiedName = getQualifiedNameForSearchMatch((SearchMatch)component); - if (qualifiedName != null) - { - result = qualifiedName.getLocalName(); - } - } - return result; - } - - public IFile getFile(Object component) - { - IFile result = null; - if (component instanceof ComponentSpecification) - { - result = ((ComponentSpecification)component).getFile(); - } - else if (component instanceof SearchMatch) - { - result = ((SearchMatch)component).getFile(); - } - else if (component instanceof XSDConcreteComponent) - { - XSDConcreteComponent concreteComponent = (XSDConcreteComponent)component; - XSDSchema schema = concreteComponent.getSchema(); - if (schema != null) - { - // TODO (cs) revisit and test more - // - String location = schema.getSchemaLocation(); - String platformResource = "platform:/resource"; - if (location != null && location.startsWith(platformResource)) - { - Path path = new Path(location.substring(platformResource.length())); - result = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - } - } - } - return result; - } - - public ILabelProvider getLabelProvider() - { - return this; - } - - public String getText(Object element) - { - String result = ""; - String name = getName(element); - if (name != null) - { - result += name; - /* - String qualifier = getQualifier(element); - if (qualifier != null) - { - result += " - " + qualifier; - } - IFile file = getFile(element); - if (file != null) - { - result += " (" + file.getProject().getName() + ")"; - }*/ - } - return result; - } - - public Image getImage(Object component) - { - Image result = null; - if (component instanceof SearchMatch) - { - SearchMatch searchMatch = (SearchMatch)component; - QualifiedName qualifiedName = (QualifiedName)searchMatch.map.get("metaName"); - if ( qualifiedName != null ){ - if ( qualifiedName.equals(IXSDSearchConstants.SIMPLE_TYPE_META_NAME)) - result = SIMPLE_TYPE_IMAGE; - else if ( qualifiedName.equals(IXSDSearchConstants.COMPLEX_TYPE_META_NAME)) - result = COMPLEX_TYPE_IMAGE; - else if ( qualifiedName.equals(IXSDSearchConstants.ELEMENT_META_NAME)) - result = ELEMENT_IMAGE; - } - } - else if (component instanceof XSDComplexTypeDefinition) - result = COMPLEX_TYPE_IMAGE; - else if (component instanceof XSDSimpleTypeDefinition) - result = SIMPLE_TYPE_IMAGE; - else if (component instanceof XSDElementDeclaration) - result = ELEMENT_IMAGE; - return result; - } - - public Image getFileIcon(Object component) { - return XSDEditorPlugin.getXSDImage("icons/XSDFile.gif"); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java deleted file mode 100644 index 337fa15fad..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDElementsSearchListProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.wst.xsd.ui.internal.editor.search; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.core.search.SearchEngine; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDSchema; - -public class XSDElementsSearchListProvider extends XSDSearchListProvider -{ - public XSDElementsSearchListProvider(IFile currentFile, XSDSchema[] schemas) - { - super(currentFile, schemas); - } - - public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) - { - // now we traverse the types already defined within the visible schemas - // we do this in addition to the component search since this should execute - // very quickly and there's a good chance the user wants to select a time that's - // already imported/included - // TODO (cs) ensure we don't add duplicates when we proceed to use the search list - // - List visitedSchemas = new ArrayList(); - for (int i = 0; i < schemas.length; i++) - { - XSDSchema schema = schemas[i]; - ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, IXSDSearchConstants.ELEMENT_META_NAME); - visitor.visitSchema(schema, true); - visitedSchemas.addAll(visitor.getVisitedSchemas()); - } - // finally we call the search API's to do a potentially slow search - if (scope != null) - { - populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas)); - } - } - - private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files) - { - SearchEngine searchEngine = new SearchEngine(); - InternalSearchRequestor requestor = new InternalSearchRequestor(list, files); - findMatches(searchEngine, requestor, scope, IXSDSearchConstants.ELEMENT_META_NAME); - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java deleted file mode 100644 index 8bbc6abee4..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListDialogDelegate.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor.search; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSearchListDialogConfiguration; -import org.eclipse.wst.common.ui.internal.search.dialogs.ComponentSpecification; -import org.eclipse.wst.common.ui.internal.search.dialogs.ScopedComponentSearchListDialog; -import org.eclipse.wst.xsd.ui.internal.adt.edit.IComponentDialog; -import org.eclipse.wst.xsd.ui.internal.editor.Messages; -import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.util.XSDConstants; - -public class XSDSearchListDialogDelegate implements IComponentDialog -{ - public final static QualifiedName TYPE_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "type"); //$NON-NLS-1$ - public final static QualifiedName ELEMENT_META_NAME = new QualifiedName(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element"); //$NON-NLS-1$ - // protected Object setObject; - protected ComponentSpecification selection; - protected IFile currentFile; - protected XSDSchema[] schemas; - protected QualifiedName metaName; - protected boolean showComplexTypes = true; - - public XSDSearchListDialogDelegate(QualifiedName metaName, IFile currentFile, XSDSchema[] schemas) - { - super(); - this.metaName = metaName; - this.currentFile = currentFile; - this.schemas = schemas; - } - - public ComponentSpecification getSelectedComponent() - { - return selection; - } - - public void setInitialSelection(ComponentSpecification componentSpecification) - { - // TODO Auto-generated method stub - } - - /** - * Whether to show complex types in the Dialog's List, has no effect if the - * dialog populates list of elements instead of type - * @param value - */ - public void showComplexTypes(boolean value) - { - showComplexTypes = value; - } - - public int createAndOpen() - { - Shell shell = XSDEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(); - int returnValue = Window.CANCEL; - ScopedComponentSearchListDialog dialog = null; - - // TODO (cs) lot's of code is common to both these blocks. Can we re-org it a bit - // so it's easier to see the difference between how we config for an element vs type? - if ( metaName == ELEMENT_META_NAME) - { - XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider(); - final XSDElementsSearchListProvider searchListProvider = new XSDElementsSearchListProvider(currentFile, schemas); - ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration(); - - configuration.setDescriptionProvider(descriptionProvider); - configuration.setSearchListProvider(searchListProvider); - configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT); - configuration.setListLabelText(Messages._UI_LABEL_ELEMENTS_COLON); -// configuration.setNewComponentHandler(new NewElementButtonHandler()); - //TODO externalize string - dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_ELEMENT_REFERENCE, configuration); - } - else if (metaName == TYPE_META_NAME) - { - XSDComponentDescriptionProvider descriptionProvider = new XSDComponentDescriptionProvider(); - final XSDTypesSearchListProvider searchListProvider = new XSDTypesSearchListProvider(currentFile, schemas); - if (!showComplexTypes) - searchListProvider.showComplexTypes(false); - - ComponentSearchListDialogConfiguration configuration = new ComponentSearchListDialogConfiguration(); - configuration.setDescriptionProvider(descriptionProvider); - configuration.setSearchListProvider(searchListProvider); -// configuration.setNewComponentHandler(new NewTypeButtonHandler()); - configuration.setFilterLabelText(Messages._UI_LABEL_NAME_SEARCH_FILTER_TEXT); - configuration.setListLabelText(Messages._UI_LABEL_TYPES_COLON); - dialog = new ScopedComponentSearchListDialog(shell, Messages._UI_LABEL_SET_TYPE, configuration); //$NON-NLS-1$ - } - - if (dialog != null) - { - dialog.setCurrentResource(currentFile); - dialog.setBlockOnOpen(true); - dialog.create(); - returnValue = dialog.open(); - if (returnValue == Window.OK) - { - selection = dialog.getSelectedComponent(); - } - } - return returnValue; - } - -// private IEditorPart getActiveEditor() -// { -// IWorkbench workbench = PlatformUI.getWorkbench(); -// IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); -// IEditorPart editorPart = workbenchWindow.getActivePage().getActiveEditor(); -// return editorPart; -// } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java deleted file mode 100644 index bcb1eb2a94..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDSearchListProvider.java +++ /dev/null @@ -1,234 +0,0 @@ -package org.eclipse.wst.xsd.ui.internal.editor.search; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.wst.common.core.search.SearchEngine; -import org.eclipse.wst.common.core.search.SearchMatch; -import org.eclipse.wst.common.core.search.SearchParticipant; -import org.eclipse.wst.common.core.search.SearchPlugin; -import org.eclipse.wst.common.core.search.SearchRequestor; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.core.search.pattern.SearchPattern; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentSearchListProvider; -import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDElementDeclaration; -import org.eclipse.xsd.XSDImport; -import org.eclipse.xsd.XSDInclude; -import org.eclipse.xsd.XSDRedefine; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDSchemaContent; -import org.eclipse.xsd.XSDSchemaDirective; -import org.eclipse.xsd.XSDSimpleTypeDefinition; -import org.eclipse.xsd.XSDTypeDefinition; - - -public abstract class XSDSearchListProvider implements IComponentSearchListProvider -{ - protected XSDSchema[] schemas; - protected IFile currentFile; - // TODO (cs) remove these and use proper search scopes! - // - public static final int ENCLOSING_PROJECT_SCOPE = 0; - public static final int ENTIRE_WORKSPACE_SCOPE = 1; - - public XSDSearchListProvider(IFile currentFile, XSDSchema[] schemas) - { - this.schemas = schemas; - this.currentFile = currentFile; - - try - { - IProject[] refs = currentFile.getProject().getReferencedProjects(); - - System.out.println("dependencies:----"); - for (int i=0; i < refs.length; i++) - { - System.out.println("dep " + refs[i].getName()); - } - } - catch (Exception e) - { - e.printStackTrace(); - } - - } - - - class ComponentCollectingXSDVisitor - { - protected List visitedSchemas = new ArrayList(); - IComponentList list; - QualifiedName searchKind; - - ComponentCollectingXSDVisitor(IComponentList list, QualifiedName searchKind) - { - this.list = list; - this.searchKind = searchKind; - } - - public void visitSchema(XSDSchema schema, boolean visitImportedSchema) - { - visitedSchemas.add(schema); - for (Iterator contents = schema.getContents().iterator(); contents.hasNext();) - { - XSDSchemaContent content = (XSDSchemaContent) contents.next(); - if (content instanceof XSDSchemaDirective) - { - XSDSchemaDirective schemaDirective = (XSDSchemaDirective) content; - XSDSchema extSchema = schemaDirective.getResolvedSchema(); - if (extSchema != null && !visitedSchemas.contains(extSchema)) - { - if (schemaDirective instanceof XSDImport && visitImportedSchema) - { - visitSchema(extSchema, false); - } - else if (schemaDirective instanceof XSDInclude || schemaDirective instanceof XSDRedefine) - { - visitSchema(extSchema, false); - } - } - } - else if (content instanceof XSDElementDeclaration && searchKind == IXSDSearchConstants.ELEMENT_META_NAME) - { - list.add(content); - } - else if (content instanceof XSDSimpleTypeDefinition && searchKind == IXSDSearchConstants.SIMPLE_TYPE_META_NAME) - { - // in this case we only want to show simple types - list.add(content); - } - else if (content instanceof XSDTypeDefinition && searchKind == IXSDSearchConstants.TYPE_META_NAME) - { - // in this case we want to show all types - list.add(content); - } - } - } - - public List getVisitedSchemas() - { - return visitedSchemas; - } - } - - - class InternalSearchRequestor extends SearchRequestor - { - IComponentList componentList; - HashMap files; - - InternalSearchRequestor(IComponentList componentList, HashMap files) - { - this.componentList = componentList; - this.files = files; - } - - public void acceptSearchMatch(SearchMatch match) throws CoreException - { - // we filter out the matches from the current file since we assume the - // info derived from our schema models is more update to date - // (in the event that we haven't saved our latest modifications) - // - if (files.get(match.getFile()) == null) - { - // TODO... this ugly qualified name stashing will go away soon - // - QualifiedName qualifiedName = null; - Object o = match.map.get("name"); - if (o != null && o instanceof QualifiedName) - { - qualifiedName = (QualifiedName)o; - } - if (qualifiedName != null && qualifiedName.getLocalName() != null) - { - componentList.add(match); - } - } - } - } - - protected void findMatches(SearchEngine searchEngine, SearchRequestor requestor, SearchScope scope, QualifiedName metaName) - { - try - { - XMLComponentDeclarationPattern pattern = new XMLComponentDeclarationPattern(new QualifiedName("*", "*"), metaName, SearchPattern.R_PATTERN_MATCH); - // TODO (cs) revist this... we shouldn't be needing to hard-code partipant id's - // All we're really doing here is trying to avoid finding matches in - // wsdl's since we don't ever want to import/include a wsdl from a schema! - // Maybe we should just scope out any file types that aren't xsd's using a - // custom SearchScope? - // - SearchParticipant particpant = SearchPlugin.getDefault().getSearchParticipant("org.eclipse.wst.xsd.search.XSDSearchParticipant"); - Assert.isNotNull(particpant); - SearchParticipant[] participants = {particpant}; - searchEngine.search(pattern, requestor, participants, scope, null, new NullProgressMonitor()); - } - catch (CoreException e) - { - e.printStackTrace(); - } - } - - - protected HashMap createFileMap(List visitedSchemas) - { - HashMap fileMap = new HashMap(); - for (Iterator i = visitedSchemas.iterator(); i.hasNext(); ) - { - XSDSchema theSchema = (XSDSchema)i.next(); - String location = theSchema.getSchemaLocation(); - IFile file = computeFile(location); - if (file != null) - { - fileMap.put(file, Boolean.TRUE); - } - } - return fileMap; - } - - private IFile computeFile(String baseLocation) - { - IFile file = null; - if (baseLocation != null) - { - String fileScheme = "file:"; //$NON-NLS-1$ - String platformResourceScheme = "platform:/resource"; - if (baseLocation.startsWith(fileScheme)) - { - baseLocation = baseLocation.substring(fileScheme.length()); - baseLocation = removeLeading(baseLocation, "/"); - IPath path = new Path(baseLocation); - file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path); - } - else if (baseLocation.startsWith(platformResourceScheme)) - { - baseLocation = baseLocation.substring(platformResourceScheme.length()); - baseLocation = removeLeading(baseLocation, "/"); - IPath path = new Path(baseLocation); - file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - } - } - return file; - } - - private String removeLeading(String path, String pattern) - { - while (path.startsWith(pattern)) - { - path = path.substring(pattern.length()); - } - return path; - } -} diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java deleted file mode 100644 index 9d80faeaab..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/search/XSDTypesSearchListProvider.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 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.editor.search; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.wst.common.core.search.SearchEngine; -import org.eclipse.wst.common.core.search.pattern.QualifiedName; -import org.eclipse.wst.common.core.search.scope.SearchScope; -import org.eclipse.wst.common.ui.internal.search.dialogs.IComponentList; -import org.eclipse.wst.xsd.ui.internal.search.IXSDSearchConstants; -import org.eclipse.xsd.XSDSchema; -import org.eclipse.xsd.XSDTypeDefinition; -import org.eclipse.xsd.impl.XSDSchemaImpl; -import org.eclipse.xsd.util.XSDConstants; -public class XSDTypesSearchListProvider extends XSDSearchListProvider -{ - protected IXSDTypesFilter builtInFilter; - /** - * Determines if we should use the filter This us used to turn the filter on - * and off - */ - protected boolean supportFilter = true; - private boolean showComplexTypes = true; - - public XSDTypesSearchListProvider(IFile currentFile, XSDSchema[] schemas) - { - super(currentFile, schemas); - } - - public void populateComponentList(IComponentList list, SearchScope scope, IProgressMonitor pm) - { - // first we add the 'built in' types - // - XSDSchema schemaForSchema = XSDSchemaImpl.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); - for (Iterator i = schemaForSchema.getSimpleTypeIdMap().values().iterator(); i.hasNext();) - { - XSDTypeDefinition td = (XSDTypeDefinition) i.next(); - if (builtInFilter == null || !builtInFilter.shouldFilterOut(td)) - { - list.add(td); - } - } - // now we traverse the types already defined within the visible schemas - // we do this in addition to the component search since this should execute - // very quickly and there's a good chance the user wants to select a time - // that's - // already imported/included - // TODO (cs) ensure we don't add duplicates when we proceed to use the - // search list - // - List visitedSchemas = new ArrayList(); - for (int i = 0; i < schemas.length; i++) - { - XSDSchema schema = schemas[i]; - QualifiedName kind = showComplexTypes ? IXSDSearchConstants.TYPE_META_NAME : IXSDSearchConstants.SIMPLE_TYPE_META_NAME; - ComponentCollectingXSDVisitor visitor = new ComponentCollectingXSDVisitor(list, kind); - visitor.visitSchema(schema, true); - visitedSchemas.addAll(visitor.getVisitedSchemas()); - } - // finally we call the search API's to do a potentially slow search - // - if (scope != null) - { - populateComponentListUsingSearch(list, scope, pm, createFileMap(visitedSchemas)); - } - } - - private void populateComponentListUsingSearch(IComponentList list, SearchScope scope, IProgressMonitor pm, HashMap files) - { - SearchEngine searchEngine = new SearchEngine(); - InternalSearchRequestor requestor = new InternalSearchRequestor(list, files); - if (showComplexTypes) - { - findMatches(searchEngine, requestor, scope, IXSDSearchConstants.COMPLEX_TYPE_META_NAME); - } - findMatches(searchEngine, requestor, scope, IXSDSearchConstants.SIMPLE_TYPE_META_NAME); - } - - - public void _populateComponentListQuick(IComponentList list, IProgressMonitor pm) - { - } - - public void turnBuiltInFilterOn(boolean option) - { - supportFilter = option; - } - - public void setBuiltInFilter(IXSDTypesFilter filter) - { - this.builtInFilter = filter; - } - - public void showComplexTypes(boolean show) - { - showComplexTypes = show; - } -} |