| <?xml version='1.0' encoding='UTF-8'?> |
| <!-- Schema file written by PDE --> |
| <schema targetNamespace="org.eclipse.sirius" xmlns="http://www.w3.org/2001/XMLSchema"> |
| <annotation> |
| <appInfo> |
| <meta.schema plugin="org.eclipse.sirius" id="analysisSelectorProvider" name="org.eclipse.sirius.analysisSelectorProvider"/> |
| </appInfo> |
| <documentation> |
| This extension point allows clients to provide specific analysis selectors. A default one is provided by Sirius (but this last is used only if there is no client specific analysis selector). |
| </documentation> |
| </annotation> |
| |
| <element name="extension"> |
| <annotation> |
| <appInfo> |
| <meta.element /> |
| </appInfo> |
| </annotation> |
| <complexType> |
| <sequence> |
| <element ref="provider" 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="name" type="string"> |
| <annotation> |
| <documentation> |
| an optional name of the extension instance |
| </documentation> |
| <appInfo> |
| <meta.attribute translatable="true"/> |
| </appInfo> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <element name="provider"> |
| <annotation> |
| <documentation> |
| This element defines new Analysis Selector Provider. |
| </documentation> |
| </annotation> |
| <complexType> |
| <attribute name="providerClass" type="string" use="required"> |
| <annotation> |
| <documentation> |
| The provider implementation. |
| </documentation> |
| <appInfo> |
| <meta.attribute kind="java" basedOn=":org.eclipse.sirius.business.api.session.danalysis.DAnalysisSelectorProvider"/> |
| </appInfo> |
| </annotation> |
| </attribute> |
| <attribute name="id" type="string" use="required"> |
| <annotation> |
| <documentation> |
| the identifier of the provider instance |
| </documentation> |
| </annotation> |
| </attribute> |
| </complexType> |
| </element> |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="since"/> |
| </appInfo> |
| <documentation> |
| 4.5.b |
| </documentation> |
| </annotation> |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="examples"/> |
| </appInfo> |
| <documentation> |
| The following is an example of an analysis selector provider : |
| <p> |
| <pre> |
| <extension |
| point="org.eclipse.sirius.analysisSelectorProvider"> |
| <provider |
| id = "viewpoint.sample.DAnalysisSelectorProvider" |
| providerClass="org.eclipse.sirius.sample.DAnalysisSelectorProvider1"> |
| </provider> |
| </extension> |
| </pre> |
| </p> |
| <p> |
| Here is the sample provider implementation : |
| <pre> |
| package org.eclipse.sirius.sample.analysis; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.ecore.resource.Resource; |
| |
| import org.eclipse.sirius.DAnalysis; |
| import org.eclipse.sirius.DRepresentation; |
| import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSelector; |
| import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSelectorProvider; |
| import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession; |
| import org.eclipse.sirius.description.Sirius; |
| |
| /** |
| * Simple implementation. |
| */ |
| public class SampleAnalysisSelectorProvider implements DAnalysisSelectorProvider { |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.sirius.business.api.session.danalysis.DAnalysisSelectorProvider#getSelector(org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession) |
| */ |
| public DAnalysisSelector getSelector(final DAnalysisSession session) { |
| return new DAnalysisSelector() { |
| public DAnalysis selectSmartlyAnalysisForCreatedView(Sirius viewpoint, Collection<DAnalysis> allAnalysis) { |
| return allAnalysis.iterator().next(); |
| } |
| |
| public DAnalysis selectSmartlyAnalysisForAddedResource(Resource resource, Collection<DAnalysis> allAnalysis) { |
| return allAnalysis.iterator().next(); |
| } |
| |
| public DAnalysis selectSmartlyAnalysisForAddedRepresentation(DRepresentation representation, Collection<DAnalysis> allAnalysis) { |
| return allAnalysis.iterator().next(); |
| } |
| }; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.sirius.business.api.session.danalysis.DAnalysisSelectorProvider#provides(org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession) |
| */ |
| public boolean provides(DAnalysisSession session) { |
| return false; |
| } |
| |
| } |
| |
| </pre> |
| </p> |
| </documentation> |
| </annotation> |
| |
| |
| |
| <annotation> |
| <appInfo> |
| <meta.section type="copyright"/> |
| </appInfo> |
| <documentation> |
| Copyright (c) 2009, 2012 THALES GLOBAL SERVICES<br> |
| |
| This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License 2.0 |
| which accompanies this distribution, and is available at |
| <a href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-v20.html</a>/ |
| |
| SPDX-License-Identifier: EPL-2.0 |
| </documentation> |
| |
| </annotation> |
| |
| </schema> |