| <?xml version='1.0' encoding='UTF-8'?> |
| <!-- Schema file written by PDE --> |
| <schema targetNamespace="org.eclipse.ui" xmlns="http://www.w3.org/2001/XMLSchema"> |
| <annotation> |
| <appinfo> |
| <meta.schema plugin="org.eclipse.ui" id="services" name="Services"/> |
| </appinfo> |
| <documentation> |
| Define service factories so that services can be contributed declaratively and will be available through <code>IServiceLocator#getService(Class)</code>. The implementation of <code>AbstractServiceFactory</code> must be able to return a global service and multiple child services (if applicable). |
| <p> |
| Services must follow a general contract: |
| <ul> |
| <li>The top level service has no parent.</li> |
| <li>The child service may use the supplied parent, which can be cast to the service interface.</li> |
| <li>Any other services needed for initialization should be retrieved from the <code>IServiceLocator</code>.</li> |
| <li>If the service needs to clean up any state (like listeners) it should implement <code>IDisposable</code>.</li> |
| <li>Services should clearly specify when they perform cleanup for clients, such as removing listeners automatically on disposal.</li> |
| </ul> |
| </p> |
| </documentation> |
| </annotation> |
| |
| <element name="extension"> |
| <annotation> |
| <documentation> |
| Contribute services to the workbench. |
| </documentation> |
| </annotation> |
| <complexType> |
| <sequence minOccurs="1" maxOccurs="unbounded"> |
| <element ref="serviceFactory" minOccurs="0" maxOccurs="1"/> |
| <element ref="sourceProvider" minOccurs="0" maxOccurs="1"/> |
| </sequence> |
| <attribute name="point" type="string" use="required"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| </annotation> |
| </attribute> |
| <attribute name="id" type="string"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| </annotation> |
| </attribute> |
| <attribute name="name" type="string"> |
| <annotation> |
| <documentation> |
| |
| </documentation> |
| <appinfo> |
| <meta.attribute translatable="true"/> |
| </appinfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <element name="serviceFactory"> |
| <annotation> |
| <documentation> |
| Match a service interface to a factory that can supply a hierachical implementation of that service. |
| </documentation> |
| </annotation> |
| <complexType> |
| <sequence> |
| <element ref="service" minOccurs="1" maxOccurs="unbounded"/> |
| </sequence> |
| <attribute name="factoryClass" type="string" use="required"> |
| <annotation> |
| <documentation> |
| The factory that extends <code>AbstractServiceFactory</code> and can create the implementation for the serviceClass. |
| </documentation> |
| <appinfo> |
| <meta.attribute kind="java" basedOn="org.eclipse.ui.services.AbstractServiceFactory:"/> |
| </appinfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <element name="service"> |
| <annotation> |
| <documentation> |
| A service this factory can provide. |
| </documentation> |
| </annotation> |
| <complexType> |
| <attribute name="serviceClass" type="string"> |
| <annotation> |
| <documentation> |
| The interface that represents a service contract. |
| </documentation> |
| <appinfo> |
| <meta.attribute kind="java"/> |
| </appinfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <element name="sourceProvider"> |
| <annotation> |
| <documentation> |
| A Source Provider supplies source variables to the IEvaluationService. It can also notify the IEvaluationService when one or more of the variables change. |
| </documentation> |
| </annotation> |
| <complexType> |
| <sequence> |
| <element ref="variable" minOccurs="1" maxOccurs="unbounded"/> |
| </sequence> |
| <attribute name="provider" type="string" use="required"> |
| <annotation> |
| <documentation> |
| This class must provide variables and call the appropriate fireSourceChanged(*) method when any of the variables change. |
| </documentation> |
| <appinfo> |
| <meta.attribute kind="java" basedOn="org.eclipse.ui.AbstractSourceProvider:"/> |
| </appinfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <element name="variable"> |
| <annotation> |
| <documentation> |
| A source variable from this provider. A source provider must declare all variables that it provides. |
| </documentation> |
| </annotation> |
| <complexType> |
| <attribute name="name" type="string" use="required"> |
| <annotation> |
| <documentation> |
| The name of a contributed source variable. It is a good practice to prepend the plugin id to the variable name to avoid collisions with other source providers. |
| </documentation> |
| </annotation> |
| </attribute> |
| <attribute name="priorityLevel" use="required"> |
| <annotation> |
| <documentation> |
| For conflict resolution used by services like the IHandlerService. The source must select a priority for all contributed variables. <b>workbench</b> is the global default priority. See <code>ISources</code> for relative priority information. |
| </documentation> |
| </annotation> |
| <simpleType> |
| <restriction base="string"> |
| <enumeration value="workbench"> |
| </enumeration> |
| <enumeration value="activeContexts"> |
| </enumeration> |
| <enumeration value="activeShell"> |
| </enumeration> |
| <enumeration value="activeWorkbenchWindow"> |
| </enumeration> |
| <enumeration value="activeEditorId"> |
| </enumeration> |
| <enumeration value="activePartId"> |
| </enumeration> |
| <enumeration value="activeSite"> |
| </enumeration> |
| </restriction> |
| </simpleType> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <annotation> |
| <appinfo> |
| <meta.section type="since"/> |
| </appinfo> |
| <documentation> |
| 3.4 |
| </documentation> |
| </annotation> |
| |
| <annotation> |
| <appinfo> |
| <meta.section type="examples"/> |
| </appinfo> |
| <documentation> |
| <p> |
| Here is a basic definition: |
| <pre> |
| <extension |
| point="org.eclipse.ui.services"> |
| <serviceFactory |
| factoryClass="org.eclipse.ui.tests.services.LevelServiceFactory"> |
| <service |
| serviceClass="org.eclipse.ui.tests.services.ILevelService"> |
| </service> |
| </serviceFactory> |
| </extension> |
| </pre></p> |
| <p> |
| The <code>LevelServiceFactory</code> can return an <code>ILevelService</code> when it is requested from the <code>IServiceLocator</code>: |
| <pre> |
| ILevelService s = (ILevelService) getSite().getService(ILevelService.class); |
| System.out.println(s.getLevel()); |
| </pre> |
| </p> |
| <p> |
| In this test example, the factory would instantiate three <code>ILevelService</code> implementations during the first call to <code>getSite().getService(*)</code>. The global one in the workbench, one for the workbench window, and one for the site. |
| </p> |
| </documentation> |
| </annotation> |
| |
| <annotation> |
| <appinfo> |
| <meta.section type="apiInfo"/> |
| </appinfo> |
| <documentation> |
| <p> |
| Please see <code>org.eclipse.ui.services.AbstractServiceFactory</code>, <code>org.eclipse.ui.services.IDisposable</code>, and <code>org.eclipse.ui.services.IServiceWithSources</code> for more information. |
| </p> |
| </documentation> |
| </annotation> |
| |
| |
| <annotation> |
| <appinfo> |
| <meta.section type="copyright"/> |
| </appinfo> |
| <documentation> |
| Copyright (c) 2007 IBM Corporation 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> |