Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 185584 Details for
Bug 332961
ODA Driver Improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
changes to edit.ui
edit_ui.patch (text/plain), 16.76 KB, created by
Kenn Hussey
on 2010-12-20 13:57:22 EST
(
hide
)
Description:
changes to edit.ui
Filename:
MIME Type:
Creator:
Kenn Hussey
Created:
2010-12-20 13:57:22 EST
Size:
16.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.edit.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.edit.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.15 >diff -u -r1.15 MANIFEST.MF >--- META-INF/MANIFEST.MF 11 Aug 2009 20:00:52 -0000 1.15 >+++ META-INF/MANIFEST.MF 20 Dec 2010 18:55:26 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.emf.edit.ui;singleton:=true >-Bundle-Version: 2.6.0.qualifier >+Bundle-Version: 2.7.0.qualifier > Bundle-ClassPath: . > Bundle-Activator: org.eclipse.emf.edit.ui.EMFEditUIPlugin$Implementation > Bundle-Vendor: %providerName >@@ -21,6 +21,7 @@ > org.eclipse.emf.edit;visibility:=reexport, > org.eclipse.emf.common.ui;visibility:=reexport, > org.eclipse.core.resources;resolution:=optional, >- org.eclipse.ui.ide;resolution:=optional >+ org.eclipse.ui.ide;resolution:=optional, >+ org.eclipse.jface.text;resolution:=optional > Eclipse-LazyStart: true > Bundle-ActivationPolicy: lazy >Index: build.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.edit.ui/build.properties,v >retrieving revision 1.13 >diff -u -r1.13 build.properties >--- build.properties 27 May 2010 19:13:51 -0000 1.13 >+++ build.properties 20 Dec 2010 18:55:26 -0000 >@@ -6,7 +6,9 @@ > .,\ > icons/,\ > plugin.properties,\ >- META-INF/ >+ plugin.xml,\ >+ META-INF/,\ >+ schema/ > src.includes = about.html > source.. = src/ > output.. = bin/ >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.edit.ui/plugin.properties,v >retrieving revision 1.20 >diff -u -r1.20 plugin.properties >--- plugin.properties 7 Apr 2009 18:58:45 -0000 1.20 >+++ plugin.properties 20 Dec 2010 18:55:26 -0000 >@@ -1,7 +1,7 @@ > # /** > # * <copyright> > # * >-# * Copyright (c) 2002-2008 IBM Corporation and others. >+# * Copyright (c) 2002-2010 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 >@@ -89,3 +89,5 @@ > _UI_MultiLineInputDialog_message = &Enter a value: > > _UI_DiagnosisOfNObjects_message = Diagnosis of {0} objects >+ >+_UI_QueryDelegateTextViewerFactory_extensionpoint = Registered Query Delegate Text Viewer Factories >Index: plugin.xml >=================================================================== >RCS file: plugin.xml >diff -N plugin.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,5 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.0"?> >+<plugin> >+ <extension-point id="queryDelegateTextViewerFactories" name="%_UI_QueryDelegateTextViewerFactory_extensionpoint" schema="schema/queryDelegateTextViewerFactories.exsd"/> >+</plugin> >Index: schema/queryDelegateTextViewerFactories.exsd >=================================================================== >RCS file: schema/queryDelegateTextViewerFactories.exsd >diff -N schema/queryDelegateTextViewerFactories.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/queryDelegateTextViewerFactories.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,124 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.emf.edit.ui" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.emf.edit.ui" id="queryDelegateTextViewerFactories" name="Query Delegate Text Viewer Factory Registry"/> >+ </appInfo> >+ <documentation> >+ This extension point is used to register factories for query delegate text viewers whose type is identified by a URI. The global EMF query delegate text viewer factory registry, <samp>QueryDelegateTextViewer.Factory.Registry.INSTANCE</samp>, is used to record the registration. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appInfo> >+ <meta.element /> >+ </appInfo> >+ </annotation> >+ <complexType> >+ <sequence> >+ <element ref="factory" minOccurs="1" maxOccurs="unbounded"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ A fully qualified identifier of the target extension point. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ An optional identifier of the extension instance. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ An optional name of the extension instance. >+ </documentation> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="factory"> >+ <annotation> >+ <appInfo> >+ <meta.element labelAttribute="id"/> >+ </appInfo> >+ </annotation> >+ <complexType> >+ <attribute name="uri" type="string" use="required"> >+ <annotation> >+ <documentation> >+ A URI identifying the type of query delegate text viewers that can be created by the factory. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The fully qualified name of a Java class implementing <samp>org.eclipse.emf.edit.ui.util.QueryDelegateTextViewer.Factory</samp>. >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.emf.edit.ui.util.QueryDelegateTextViewer.Factory"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ 2.7.0 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ Following is an example of how a query delegate text viewer factory can be registered: >+<pre> >+ <extension point="org.eclipse.emf.edit.ui.queryDelegateTextViewerFactories" > >+ <factory uri="http://www.eclipse.org/emf/2002/Ecore/OCL" class="org.eclipse.ocl.examples.interpreter.delegate.OCLQueryDelegateTextViewerFactory"/> >+ </extension> >+</pre> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ The value of the class attribute must represent a class that implements <samp>org.eclipse.emf.edit.ui.util.QueryDelegateTextViewer.Factory</samp> and has a no argument contructor. >+<p> >+A query delegate text viewer factory can be also registered from the source code with the <samp>QueryDelegateTextViewer.Factory.Registry.INSTANCE</samp> as follows: >+</p> >+<pre> >+ QueryDelegateTextViewer.Factory.Registry.INSTANCE.put("http://www.eclipse.org/emf/2002/Ecore/OCL", new OCLQueryDelegateTextViewerFactory()); >+</pre> >+ </documentation> >+ </annotation> >+ >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2010 Kenn Hussey and others.<br> >+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 <a >+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >+ </documentation> >+ </annotation> >+ >+</schema> >Index: src/org/eclipse/emf/edit/ui/EMFEditUIPlugin.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.edit.ui/src/org/eclipse/emf/edit/ui/EMFEditUIPlugin.java,v >retrieving revision 1.7 >diff -u -r1.7 EMFEditUIPlugin.java >--- src/org/eclipse/emf/edit/ui/EMFEditUIPlugin.java 14 Jun 2007 18:32:37 -0000 1.7 >+++ src/org/eclipse/emf/edit/ui/EMFEditUIPlugin.java 20 Dec 2010 18:55:26 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2006 IBM Corporation and others. >+ * Copyright (c) 2002-2010 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 >@@ -16,10 +16,15 @@ > */ > package org.eclipse.emf.edit.ui; > >- >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.emf.common.EMFPlugin; > import org.eclipse.emf.common.ui.EclipseUIPlugin; > import org.eclipse.emf.common.util.ResourceLocator; >+import org.eclipse.emf.ecore.plugin.RegistryReader; >+import org.eclipse.emf.edit.ui.util.QueryDelegateTextViewer; >+import org.osgi.framework.Bundle; >+import org.osgi.framework.BundleContext; > > > /** >@@ -34,7 +39,7 @@ > * In this case, emf.edit.resources.jar must be on the CLASSPATH. > * @see #INSTANCE > */ >-public final class EMFEditUIPlugin extends EMFPlugin >+public final class EMFEditUIPlugin extends EMFPlugin > { > /** > * The singleton instance of the plugin. >@@ -46,12 +51,14 @@ > */ > private static Implementation plugin; > >+ public static final String QUERY_DELEGATE_TEXT_VIEWER_FACTORIES_PPID = "queryDelegateTextViewerFactories"; >+ > /** > * Creates the singleton instance. > */ > private EMFEditUIPlugin() > { >- super(new ResourceLocator[] {}); >+ super(new ResourceLocator []{}); > } > > /* >@@ -75,7 +82,7 @@ > /** > * The actual implementation of the Eclipse <b>Plugin</b>. > */ >- public static class Implementation extends EclipseUIPlugin >+ public static class Implementation extends EclipseUIPlugin > { > /** > * Creates an instance. >@@ -88,5 +95,85 @@ > // > plugin = this; > } >+ >+ /** >+ * Starts up this plugin by reading some extensions and populating the relevant registries. >+ * <p> >+ * @throws Exception if there is a show stopping problem. >+ */ >+ @Override >+ public void start(BundleContext context) throws Exception >+ { >+ super.start(context); >+ >+ Bundle bundle = Platform.getBundle("org.eclipse.jface.text"); >+ if (bundle != null && (bundle.getState() & (Bundle.ACTIVE | Bundle.STARTING | Bundle.RESOLVED)) != 0) >+ { >+ new RegistryReader( >+ Platform.getExtensionRegistry(), >+ EMFEditUIPlugin.getPlugin().getBundle().getSymbolicName(), >+ QUERY_DELEGATE_TEXT_VIEWER_FACTORIES_PPID) >+ { >+ @Override >+ protected boolean readElement(IConfigurationElement element, boolean add) >+ { >+ if (element.getName().equals("factory")) >+ { >+ String uri = element.getAttribute("uri"); >+ if (uri == null) >+ { >+ logMissingAttribute(element, "uri"); >+ } >+ else if (element.getAttribute("class") == null) >+ { >+ logMissingAttribute(element, "class"); >+ } >+ >+ class FactoryDescriptor extends PluginClassDescriptor implements QueryDelegateTextViewer.Factory.Descriptor >+ { >+ protected QueryDelegateTextViewer.Factory factory; >+ >+ public FactoryDescriptor(IConfigurationElement e, String attrName) >+ { >+ super(e, attrName); >+ } >+ >+ public QueryDelegateTextViewer.Factory getFactory() >+ { >+ if (factory == null) >+ { >+ factory = (QueryDelegateTextViewer.Factory)createInstance(); >+ } >+ return factory; >+ } >+ >+ public IConfigurationElement getElement() >+ { >+ return element; >+ } >+ } >+ >+ if (add) >+ { >+ Object previous = QueryDelegateTextViewer.Factory.Registry.INSTANCE.put(uri, new FactoryDescriptor(element, "class")); >+ if (previous instanceof FactoryDescriptor) >+ { >+ FactoryDescriptor descriptor = (FactoryDescriptor)previous; >+ EMFEditUIPlugin.INSTANCE.log("Both '" + descriptor.getElement().getContributor().getName() + "' and '" >+ + element.getContributor().getName() + "' register a query delegate text viewer factory for '" + uri + "'"); >+ } >+ return true; >+ } >+ else >+ { >+ QueryDelegateTextViewer.Factory.Registry.INSTANCE.remove(uri); >+ return true; >+ } >+ } >+ return false; >+ } >+ }.readRegistry(); >+ } >+ } > } > } >Index: src/org/eclipse/emf/edit/ui/util/QueryDelegateTextViewer.java >=================================================================== >RCS file: src/org/eclipse/emf/edit/ui/util/QueryDelegateTextViewer.java >diff -N src/org/eclipse/emf/edit/ui/util/QueryDelegateTextViewer.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/edit/ui/util/QueryDelegateTextViewer.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,108 @@ >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2010 Kenn Hussey and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * Kenn Hussey - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.edit.ui.util; >+ >+import java.util.HashMap; >+import java.util.Map; >+ >+import org.eclipse.emf.ecore.EClassifier; >+import org.eclipse.jface.text.ITextViewer; >+import org.eclipse.swt.widgets.Composite; >+ >+ >+/** >+ * An interface for text viewers of query delegate expressions. >+ * >+ * @since 2.7 >+ */ >+public interface QueryDelegateTextViewer extends ITextViewer >+{ >+ /** >+ * A factory for creating query delegate source viewers. >+ */ >+ interface Factory >+ { >+ /** >+ * Creates a query delegate for the specified <tt>parent</tt>. >+ * >+ * @param parent the parent container for the text viewer >+ * @param styles the styles to apply to the text viewer >+ * @return a query delegate text viewer >+ */ >+ QueryDelegateTextViewer createTextViewer(Composite parent, int styles); >+ >+ /** >+ * A <code>Factory</code> wrapper that is used by the {@link Factory.Registry}. >+ */ >+ interface Descriptor >+ { >+ Factory getFactory(); >+ } >+ >+ /** >+ * A registry of query delegate text viewer factories. >+ */ >+ interface Registry extends Map<String, Object> >+ { >+ Registry INSTANCE = new Impl(); >+ >+ Factory getFactory(String uri); >+ >+ class Impl extends HashMap<String, Object> implements Registry >+ { >+ private static final long serialVersionUID = 1L; >+ >+ @Override >+ public Object get(Object key) >+ { >+ Object factory = super.get(key); >+ if (factory instanceof Descriptor) >+ { >+ Descriptor factoryDescriptor = (Descriptor)factory; >+ factory = factoryDescriptor.getFactory(); >+ put((String)key, factory); >+ return factory; >+ } >+ else >+ { >+ return factory; >+ } >+ } >+ >+ public Factory getFactory(String uri) >+ { >+ return (Factory)get(uri); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Sets the context for the text viewer's query. >+ * >+ * @param context the type of object against which the query will be executed >+ */ >+ void setContext(EClassifier context); >+ >+ /** >+ * Sets the parameters for the text viewer's query. >+ * >+ * @param parameters a map of parameter names to types >+ */ >+ void setParameters(Map<String, EClassifier> parameters); >+ >+} >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
Kenn.Hussey
:
review?
Actions:
View
|
Diff
Attachments on
bug 332961
: 185584 |
185606
|
185607