Sirius – Provide custom bundled image shape

Goals

Define a bundled image shape extension

Note that it is possible to provide a non SVG file but the colors and border size will not be synchronized with the selected information in the VSM.

Example

The following example defines a new bundled image shape using an image file donut.svg.

	<extension
        id="org.eclipse.sirius.tests.swtbot.donut"
        point="org.eclipse.sirius.diagram.bundledImageShape">
     <image
           imagePath="/org.eclipse.sirius.tests.swtbot/images/donut.svg"
           label="Donut">
        <colorIdentifier
              colorIdentifier="stop8224-2">
        </colorIdentifier>
        <colorAttribute
              colorAttribute="style">
        </colorAttribute>
        <borderColorIdentifier
              borderColorIdentifier="path10796-2-6-2-7">
        </borderColorIdentifier>
        <borderColorAttribute
              borderColorAttribute="style">
        </borderColorAttribute>
        <borderSizeIdentifier
              borderSizeIdentifier="path10796-2-6-2-7">
        </borderSizeIdentifier>
        <borderSizeAttribute
              borderSizeAttribute="style">
        </borderSizeAttribute>
     </image>
  </extension>

In this sample, the identifier concerning the tags for the inner color (colorIdentifier), the border color (borderColorIdentifier) and the border size (borderSizeIdentifier) are not the default one. However, the attributes are all the default values. Therefore, we can simplify the extension as follows.

	<extension
        id="org.eclipse.sirius.tests.swtbot.donut"
        point="org.eclipse.sirius.diagram.bundledImageShape">
     <image
           imagePath="/org.eclipse.sirius.tests.swtbot/images/donut.svg"
           label="Donut">
        <colorIdentifier
              colorIdentifier="stop8224-2">
        </colorIdentifier>
        <borderColorIdentifier
              borderColorIdentifier="path10796-2-6-2-7">
        </borderColorIdentifier>
        <borderSizeIdentifier
              borderSizeIdentifier="path10796-2-6-2-7">
        </borderSizeIdentifier>
     </image>
  </extension>