blob: c3068c4ffd79a23e70f7c865f8f90edcca6a1657 [file] [log] [blame]
<?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 :
&lt;p&gt;
&lt;pre&gt;
&lt;extension
point=&quot;org.eclipse.sirius.analysisSelectorProvider&quot;&gt;
&lt;provider
id = &quot;viewpoint.sample.DAnalysisSelectorProvider&quot;
providerClass=&quot;org.eclipse.sirius.sample.DAnalysisSelectorProvider1&quot;&gt;
&lt;/provider&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Here is the sample provider implementation :
&lt;pre&gt;
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&lt;DAnalysis&gt; allAnalysis) {
return allAnalysis.iterator().next();
}
public DAnalysis selectSmartlyAnalysisForAddedResource(Resource resource, Collection&lt;DAnalysis&gt; allAnalysis) {
return allAnalysis.iterator().next();
}
public DAnalysis selectSmartlyAnalysisForAddedRepresentation(DRepresentation representation, Collection&lt;DAnalysis&gt; 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;
}
}
&lt;/pre&gt;
&lt;/p&gt;
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="copyright"/>
</appInfo>
<documentation>
Copyright (c) 2009, 2012 THALES GLOBAL SERVICES&lt;br&gt;
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
&lt;a href=&quot;https://www.eclipse.org/legal/epl-2.0&quot;&gt;https://www.eclipse.org/legal/epl-v20.html&lt;/a&gt;/
SPDX-License-Identifier: EPL-2.0
</documentation>
</annotation>
</schema>