Jump to: navigation, search

Difference between revisions of "SCA/Components/SCA CompositeDesignerExtension"

< SCA
(Example)
Line 47: Line 47:
  
 
<plugin>
 
<plugin>
 +
  <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
 +
    <metamodel nsURI="http://frascati.ow2.org">
 +
      <metamodelType
 +
          id="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"
 +
          name="FractalImplementation"
 +
          eclass="FractalImplementation"
 +
          kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
 +
        <param name="semanticHint" value="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"/>
 +
      </metamodelType>
 +
      <metamodelType
 +
          id="org.eclipse.stp.sca.diagram.frascati.JBIBinding"
 +
          name="JBIBinding"
 +
          eclass="JBIBinding"
 +
          kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
 +
        <param name="semanticHint" value="org.eclipse.stp.sca.diagram.frascati.JBIBinding"/>
 +
      </metamodelType>
 +
    </metamodel>
 +
  </extension>
  
    <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
+
  <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
        <metamodel nsURI="http://frascati.ow2.org">
+
    <clientContext id="ScaClientContext">
            <metamodelType id="org.eclipse.stp.sca.diagram.frascati.FractalImplementation" name="FractalImplementation" eclass="FractalImplementation" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+
      <enablement>
                <param name="semanticHint" value="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"/>
+
        <test property="org.eclipse.gmf.runtime.emf.core.editingDomain" value="org.eclipse.stp.sca.diagram.EditingDomain"/>
            </metamodelType>
+
      </enablement>
            <metamodelType id="org.eclipse.stp.sca.diagram.frascati.JBIBinding" name="JBIBinding" eclass="JBIBinding" kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
+
    </clientContext>
                <param name="semanticHint" value="org.eclipse.stp.sca.diagram.frascati.JBIBinding"/>
+
    <binding context="ScaClientContext">
            </metamodelType>
+
      <elementType ref="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"/>
        </metamodel>
+
      <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
    </extension>
+
    </binding>
 +
    <binding context="ScaClientContext">
 +
      <elementType ref="org.eclipse.stp.sca.diagram.frascati.JBIBinding"/>
 +
      <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
 +
    </binding>
 +
  </extension>
  
    <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
+
  <extension point="org.eclipse.stp.sca.diagram.extension.implementations">
        <clientContext id="ScaClientContext">
+
    <element
            <enablement>
+
      typeId="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"  
                <test property="org.eclipse.gmf.runtime.emf.core.editingDomain" value="org.eclipse.stp.sca.diagram.EditingDomain"/>
+
      literalClass="org.eclipse.stp.sca.domainmodel.frascati.FrascatiPackage$Literals"  
            </enablement>
+
      literalField="DOCUMENT_ROOT__IMPLEMENTATION_FRACTAL"  
        </clientContext>
+
      iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/FractalImplementation.gif"/>
        <binding context="ScaClientContext">
+
  </extension>
            <elementType ref="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"/>
+
            <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
+
        </binding>
+
        <binding context="ScaClientContext">
+
            <elementType ref="org.eclipse.stp.sca.diagram.frascati.JBIBinding"/>
+
            <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
+
        </binding>
+
    </extension>
+
  
    <extension point="org.eclipse.stp.sca.diagram.extension.implementations">
+
  <extension point="org.eclipse.stp.sca.diagram.extension.bindings">
        <element typeId="org.eclipse.stp.sca.diagram.frascati.FractalImplementation" literalClass="org.eclipse.stp.sca.domainmodel.frascati.FrascatiPackage$Literals" literalField="DOCUMENT_ROOT__IMPLEMENTATION_FRACTAL" iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/FractalImplementation.gif"/>
+
    <element  
    </extension>
+
      typeId="org.eclipse.stp.sca.diagram.frascati.JBIBinding"  
 +
      literalClass="org.eclipse.stp.sca.domainmodel.frascati.FrascatiPackage$Literals"  
 +
      literalField="DOCUMENT_ROOT__BINDING_JBI"  
 +
      iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/JBIBinding.gif"/>
 +
  </extension>
  
    <extension point="org.eclipse.stp.sca.diagram.extension.bindings">
+
  <extension point="org.eclipse.stp.sca.diagram.AdaptorFactories">
        <element typeId="org.eclipse.stp.sca.diagram.frascati.JBIBinding" literalClass="org.eclipse.stp.sca.domainmodel.frascati.FrascatiPackage$Literals" literalField="DOCUMENT_ROOT__BINDING_JBI" iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/JBIBinding.gif"/>
+
    <adaptorFactory class="org.eclipse.stp.sca.domainmodel.frascati.provider.FrascatiItemProviderAdapterFactory"/>
    </extension>
+
  </extension>
  
    <extension point="org.eclipse.stp.sca.diagram.AdaptorFactories">
+
  <!-- Palette Provider -->
        <adaptorFactory class="org.eclipse.stp.sca.domainmodel.frascati.provider.FrascatiItemProviderAdapterFactory"/>
+
  <extension point="org.eclipse.stp.sca.diagram.ImplementationEntryPalette">
     </extension>
+
    <implementationEntry
 +
      description="Create a new FractalImplementation"
 +
      iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/FractalImplementation.gif"
 +
      label="Fractal (Frascati 0.4)"
 +
      type="org.eclipse.stp.sca.diagram.frascati.FractalImplementation">
 +
     </implementationEntry>
 +
  </extension>
  
    <!-- Palette Provider -->
+
  <extension point="org.eclipse.stp.sca.diagram.BindingEntryPalette">
    <extension point="org.eclipse.stp.sca.diagram.ImplementationEntryPalette">
+
     <bindingEntry
        <implementationEntry description="Create a new FractalImplementation" iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/FractalImplementation.gif" label="Fractal (Frascati 0.4)"
+
      description="Create a new JBIBinding"  
type="org.eclipse.stp.sca.diagram.frascati.FractalImplementation">
+
      iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/JBIBinding.gif"  
        </implementationEntry>
+
      label="JBI (Frascati 0.4)"  
     </extension>
+
      type="org.eclipse.stp.sca.diagram.frascati.JBIBinding">
 
+
    </bindingEntry>
    <extension point="org.eclipse.stp.sca.diagram.BindingEntryPalette">
+
  </extension>
        <bindingEntry description="Create a new JBIBinding" iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/JBIBinding.gif" label="JBI (Frascati 0.4)" type="org.eclipse.stp.sca.diagram.frascati.JBIBinding">
+
        </bindingEntry>
+
    </extension>
+
  
 
</plugin>
 
</plugin>
 
</source>
 
</source>

Revision as of 11:39, 25 March 2009

To extend the SCA Composite Designer:

  • Create a new plugin-in
  • Add the following dependencies:
    • org.eclipse.core.runtime,
    • org.eclipse.core.resources,
    • org.eclipse.core.expressions,
    • org.eclipse.jface,
    • org.eclipse.ui.ide,
    • org.eclipse.ui.views,
    • org.eclipse.ui.navigator,
    • org.eclipse.ui.navigator.resources,
    • org.eclipse.emf.ecore,
    • org.eclipse.emf.ecore.xmi,
    • org.eclipse.emf.edit.ui,
    • org.eclipse.gmf.runtime.emf.core,
    • org.eclipse.gmf.runtime.emf.commands.core,
    • org.eclipse.gmf.runtime.emf.ui.properties,
    • org.eclipse.gmf.runtime.diagram.ui,
    • org.eclipse.gmf.runtime.diagram.ui.properties,
    • org.eclipse.gmf.runtime.diagram.ui.providers,
    • org.eclipse.gmf.runtime.diagram.ui.providers.ide,
    • org.eclipse.gmf.runtime.diagram.ui.render,
    • org.eclipse.gmf.runtime.diagram.ui.resources.editor,
    • org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
    • org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
    • org.eclipse.gef;visibility:=reexport,
    • org.eclipse.stp.sca.diagram.extension,
    • org.eclipse.stp.sca.diagram,
    • xyz.youmodel,
    • xyz.youmodel.edit
  • Extend the required extension points:
    • org.eclipse.gmf.runtime.emf.type.core.elementTypes
    • org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings
    • org.eclipse.stp.sca.diagram.AdaptorFactories
    • org.eclipse.stp.sca.diagram.extension.implementations
    • org.eclipse.stp.sca.diagram.extension.interfaces
    • org.eclipse.stp.sca.diagram.extension.bindings
    • org.eclipse.stp.sca.diagram.ImplementationEntryPalette
    • org.eclipse.stp.sca.diagram.InterfaceEntryPalette
    • org.eclipse.stp.sca.diagram.BindingEntryPalette


Example

<?xml version="1.0" encoding="UTF-8"?>
 
<plugin>
  <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
    <metamodel nsURI="http://frascati.ow2.org">
      <metamodelType 
          id="org.eclipse.stp.sca.diagram.frascati.FractalImplementation" 
          name="FractalImplementation" 
          eclass="FractalImplementation"
          kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
        <param name="semanticHint" value="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"/>
      </metamodelType>
      <metamodelType 
          id="org.eclipse.stp.sca.diagram.frascati.JBIBinding" 
          name="JBIBinding" 
          eclass="JBIBinding" 
          kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
        <param name="semanticHint" value="org.eclipse.stp.sca.diagram.frascati.JBIBinding"/>
      </metamodelType>
    </metamodel>
  </extension>
 
  <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
    <clientContext id="ScaClientContext">
      <enablement>
        <test property="org.eclipse.gmf.runtime.emf.core.editingDomain" value="org.eclipse.stp.sca.diagram.EditingDomain"/>
      </enablement>
    </clientContext>
    <binding context="ScaClientContext">
      <elementType ref="org.eclipse.stp.sca.diagram.frascati.FractalImplementation"/>
      <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
    </binding>
    <binding context="ScaClientContext">
      <elementType ref="org.eclipse.stp.sca.diagram.frascati.JBIBinding"/>
      <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
    </binding>
  </extension>
 
  <extension point="org.eclipse.stp.sca.diagram.extension.implementations">
    <element 
       typeId="org.eclipse.stp.sca.diagram.frascati.FractalImplementation" 
       literalClass="org.eclipse.stp.sca.domainmodel.frascati.FrascatiPackage$Literals" 
       literalField="DOCUMENT_ROOT__IMPLEMENTATION_FRACTAL" 
       iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/FractalImplementation.gif"/>
  </extension>
 
  <extension point="org.eclipse.stp.sca.diagram.extension.bindings">
    <element 
       typeId="org.eclipse.stp.sca.diagram.frascati.JBIBinding" 
       literalClass="org.eclipse.stp.sca.domainmodel.frascati.FrascatiPackage$Literals" 
       literalField="DOCUMENT_ROOT__BINDING_JBI" 
       iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/JBIBinding.gif"/>
  </extension>
 
  <extension point="org.eclipse.stp.sca.diagram.AdaptorFactories">
    <adaptorFactory class="org.eclipse.stp.sca.domainmodel.frascati.provider.FrascatiItemProviderAdapterFactory"/>
  </extension>
 
  <!-- Palette Provider -->
  <extension point="org.eclipse.stp.sca.diagram.ImplementationEntryPalette">
    <implementationEntry 
       description="Create a new FractalImplementation" 
       iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/FractalImplementation.gif" 
       label="Fractal (Frascati 0.4)"
       type="org.eclipse.stp.sca.diagram.frascati.FractalImplementation">
    </implementationEntry>
  </extension>
 
  <extension point="org.eclipse.stp.sca.diagram.BindingEntryPalette">
    <bindingEntry 
       description="Create a new JBIBinding" 
       iconPath="/org.eclipse.stp.sca.domainmodel.frascati.edit/icons/full/obj16/JBIBinding.gif" 
       label="JBI (Frascati 0.4)" 
       type="org.eclipse.stp.sca.diagram.frascati.JBIBinding">
    </bindingEntry>
  </extension>
 
</plugin>