Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF Palette Stack Tool Group
GMF Palette Stack Tool Group [message #1061327] Fri, 31 May 2013 04:47 Go to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi

I make palette as ;

<?xml version="1.0" encoding="ASCII"?>
<gmftool:ToolRegistry
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
  <palette
      title="contentPalette">
    <tools
        xsi:type="gmftool:ToolGroup"
        title="Objects"
        collapsible="true"
        stack="true">
      <tools
          xsi:type="gmftool:CreationTool"
          title="ContentType"
          description="Create new ContentType">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:CreationTool"
          title="CustomList"
          description="Create new CustomList">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:CreationTool"
          title="SiteCollection"
          description="Create new SiteCollection">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:CreationTool"
          title="View"
          description="Create new View">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:CreationTool"
          title="ViewField"
          description="Create new ViewField">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:CreationTool"
          title="Web"
          description="Create new Web">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:CreationTool"
          title="WebApplication"
          description="Create new WebApplication">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
      <tools
          xsi:type="gmftool:ToolGroup"
          title="Fields"
          collapsible="true">
        <tools
            xsi:type="gmftool:CreationTool"
            title="TextField"
            description="Create new TextField">
          <smallIcon
              xsi:type="gmftool:DefaultImage"/>
          <largeIcon
              xsi:type="gmftool:DefaultImage"/>
        </tools>
        <tools
            xsi:type="gmftool:CreationTool"
            title="NumberField"
            description="Create new NumberField">
          <smallIcon
              xsi:type="gmftool:DefaultImage"/>
          <largeIcon
              xsi:type="gmftool:DefaultImage"/>
        </tools>
        <tools
            xsi:type="gmftool:CreationTool"
            title="BooleanField"
            description="Create new BooleanField">
          <smallIcon
              xsi:type="gmftool:DefaultImage"/>
          <largeIcon
              xsi:type="gmftool:DefaultImage"/>
        </tools>
        <tools
            xsi:type="gmftool:CreationTool"
            title="LookUp"
            description="Create new LookUp">
          <smallIcon
              xsi:type="gmftool:DefaultImage"/>
          <largeIcon
              xsi:type="gmftool:DefaultImage"/>
        </tools>
      </tools>
    </tools>
    <tools
        xsi:type="gmftool:ToolGroup"
        title="Connections"
        collapsible="true">
      <tools
          xsi:type="gmftool:CreationTool"
          title="ParentContentType"
          description="Create new ParentContentType">
        <smallIcon
            xsi:type="gmftool:DefaultImage"/>
        <largeIcon
            xsi:type="gmftool:DefaultImage"/>
      </tools>
    </tools>
  </palette>
</gmftool:ToolRegistry>


But When i Create Generator model i always get this error;

The opposite features 'palette' of 'Tool Group Fields' and 'groups' of 'Palette com.mdd4cca.msf.content.content.diagram.part' do not refer to each other


But why dont understand anyone can help me to solve this ?

Clearly i cant make a sub Tool Group

Regards
Re: GMF Palette Stack Tool Group [message #1061360 is a reply to message #1061327] Fri, 31 May 2013 06:23 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

rightclick the root of your select validate. An error dialog will pop up. Select the error in this dialog and press OK. The node producing the error will be selected. You can now fix the error.

Ralph
Re: GMF Palette Stack Tool Group [message #1061366 is a reply to message #1061360] Fri, 31 May 2013 06:55 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi,

Okey i do this and "Tool Group Fields" selected. But how can i fix this error i dont

understand ?

Regards
Re: GMF Palette Stack Tool Group [message #1061691 is a reply to message #1061366] Mon, 03 June 2013 09:58 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

if I validate the model (which you pasted here) it looks fine... Is it possible that your error is caused by the gmfmap model? Did you check there?

Ralph
Re: GMF Palette Stack Tool Group [message #1061696 is a reply to message #1061691] Mon, 03 June 2013 10:10 Go to previous message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member
Hi,

i dont look gmfmap cause i generate gmf from epsilon and dont know much gmfmap

u know which relations i must look on gmfmap ?

my gmfmap is;

<?xml version="1.0" encoding="ASCII"?>
<gmfmap:Mapping
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
    xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
    xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
  <nodes>
    <containmentFeature
        href="Content.ecore#//ContentModel/ownedWebApplication"/>
    <ownedChild
        relatedDiagrams="//@diagram">
      <domainMetaElement
          href="Content.ecore#//WebApplication"/>
      <labelMappings
          xsi:type="gmfmap:FeatureLabelMapping">
        <diagramLabel
            href="Content.gmfgraph#WebApplicationLabel"/>
        <features
            href="Content.ecore#//ContentUnit/displayName"/>
      </labelMappings>
      <tool
          xsi:type="gmftool:CreationTool"
          href="Content.gmftool#//@palette/@tools.0/@tools.6"/>
      <diagramNode
          href="Content.gmfgraph#WebApplication"/>
      <children
          compartment="//@nodes.0/@ownedChild/@compartments.0">
        <containmentFeature
            href="Content.ecore#//WebApplication/ownedSiteColection"/>
        <ownedChild
            relatedDiagrams="//@diagram">
          <domainMetaElement
              href="Content.ecore#//SiteCollection"/>
          <labelMappings
              xsi:type="gmfmap:FeatureLabelMapping">
            <diagramLabel
                href="Content.gmfgraph#SiteCollectionLabel"/>
            <features
                href="Content.ecore#//ContentUnit/displayName"/>
          </labelMappings>
          <tool
              xsi:type="gmftool:CreationTool"
              href="Content.gmftool#//@palette/@tools.0/@tools.2"/>
          <diagramNode
              href="Content.gmfgraph#SiteCollection"/>
          <children
              compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@compartments.0">
            <containmentFeature
                href="Content.ecore#//SiteCollection/ownedWeb"/>
            <ownedChild
                relatedDiagrams="//@diagram">
              <domainMetaElement
                  href="Content.ecore#//Web"/>
              <labelMappings
                  xsi:type="gmfmap:FeatureLabelMapping">
                <diagramLabel
                    href="Content.gmfgraph#WebLabel"/>
                <features
                    href="Content.ecore#//ContentUnit/displayName"/>
              </labelMappings>
              <tool
                  xsi:type="gmftool:CreationTool"
                  href="Content.gmftool#//@palette/@tools.0/@tools.5"/>
              <diagramNode
                  href="Content.gmfgraph#Web"/>
              <children
                  compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.0">
                <containmentFeature
                    href="Content.ecore#//Web/ownedList"/>
                <ownedChild
                    relatedDiagrams="//@diagram">
                  <domainMetaElement
                      href="Content.ecore#//CustomList"/>
                  <labelMappings
                      xsi:type="gmfmap:FeatureLabelMapping">
                    <diagramLabel
                        href="Content.gmfgraph#CustomListLabel"/>
                    <features
                        href="Content.ecore#//ContentUnit/displayName"/>
                  </labelMappings>
                  <tool
                      xsi:type="gmftool:CreationTool"
                      href="Content.gmftool#//@palette/@tools.0/@tools.1"/>
                  <diagramNode
                      href="Content.gmfgraph#CustomList"/>
                  <children
                      compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.0">
                    <containmentFeature
                        href="Content.ecore#//CustomList/ownedContentType"/>
                    <ownedChild
                        relatedDiagrams="//@diagram">
                      <domainMetaElement
                          href="Content.ecore#//ContentType"/>
                      <labelMappings
                          xsi:type="gmfmap:FeatureLabelMapping">
                        <diagramLabel
                            href="Content.gmfgraph#ContentTypeLabel"/>
                        <features
                            href="Content.ecore#//ContentUnit/displayName"/>
                      </labelMappings>
                      <tool
                          xsi:type="gmftool:CreationTool"
                          href="Content.gmftool#//@palette/@tools.0/@tools.0"/>
                      <diagramNode
                          href="Content.gmfgraph#ContentType"/>
                      <children
                          compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.0">
                        <containmentFeature
                            href="Content.ecore#//ContentType/ownedField"/>
                        <ownedChild>
                          <domainMetaElement
                              href="Content.ecore#//TextField"/>
                          <labelMappings
                              xsi:type="gmfmap:FeatureLabelMapping"
                              viewPattern="{0} :' &#xab;Text&#xbb;'"
                              editorPattern="{0} :' &#xab;Text&#xbb;'"
                              editPattern="{0} :' &#xab;Text&#xbb;'">
                            <diagramLabel
                                href="Content.gmfgraph#TextFieldLabel"/>
                            <features
                                href="Content.ecore#//ContentUnit/displayName"/>
                          </labelMappings>
                          <tool
                              xsi:type="gmftool:CreationTool"
                              href="Content.gmftool#//@palette/@tools.0/@tools.7/@tools.0"/>
                          <diagramNode
                              href="Content.gmfgraph#TextField"/>
                        </ownedChild>
                      </children>
                      <children
                          compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.0">
                        <containmentFeature
                            href="Content.ecore#//ContentType/ownedField"/>
                        <ownedChild>
                          <domainMetaElement
                              href="Content.ecore#//NumberField"/>
                          <labelMappings
                              xsi:type="gmfmap:FeatureLabelMapping"
                              viewPattern="{0} :' &#xab;Number&#xbb;'"
                              editorPattern="{0} :' &#xab;Number&#xbb;'"
                              editPattern="{0} :' &#xab;Number&#xbb;'">
                            <diagramLabel
                                href="Content.gmfgraph#NumberFieldLabel"/>
                            <features
                                href="Content.ecore#//ContentUnit/displayName"/>
                          </labelMappings>
                          <tool
                              xsi:type="gmftool:CreationTool"
                              href="Content.gmftool#//@palette/@tools.0/@tools.7/@tools.1"/>
                          <diagramNode
                              href="Content.gmfgraph#NumberField"/>
                        </ownedChild>
                      </children>
                      <children
                          compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.0">
                        <containmentFeature
                            href="Content.ecore#//ContentType/ownedField"/>
                        <ownedChild>
                          <domainMetaElement
                              href="Content.ecore#//BooleanField"/>
                          <labelMappings
                              xsi:type="gmfmap:FeatureLabelMapping"
                              viewPattern="{0} :' &#xab;Boolean&#xbb;'"
                              editorPattern="{0} :' &#xab;Boolean&#xbb;'"
                              editPattern="{0} :' &#xab;Boolean&#xbb;'">
                            <diagramLabel
                                href="Content.gmfgraph#BooleanFieldLabel"/>
                            <features
                                href="Content.ecore#//ContentUnit/displayName"/>
                          </labelMappings>
                          <tool
                              xsi:type="gmftool:CreationTool"
                              href="Content.gmftool#//@palette/@tools.0/@tools.7/@tools.2"/>
                          <diagramNode
                              href="Content.gmfgraph#BooleanField"/>
                        </ownedChild>
                      </children>
                      <compartments
                          children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0 //@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.1 //@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.2">
                        <compartment
                            href="Content.gmfgraph#ContentTypeOwnedFieldCompartment"/>
                      </compartments>
                    </ownedChild>
                  </children>
                  <children
                      compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.1">
                    <containmentFeature
                        href="Content.ecore#//CustomList/ownedView"/>
                    <ownedChild
                        relatedDiagrams="//@diagram">
                      <domainMetaElement
                          href="Content.ecore#//View"/>
                      <labelMappings
                          xsi:type="gmfmap:FeatureLabelMapping">
                        <diagramLabel
                            href="Content.gmfgraph#ViewLabel"/>
                        <features
                            href="Content.ecore#//ContentUnit/displayName"/>
                      </labelMappings>
                      <tool
                          xsi:type="gmftool:CreationTool"
                          href="Content.gmftool#//@palette/@tools.0/@tools.3"/>
                      <diagramNode
                          href="Content.gmfgraph#View"/>
                      <children
                          compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.1/@ownedChild/@compartments.0">
                        <containmentFeature
                            href="Content.ecore#//View/ownedViewField"/>
                        <ownedChild>
                          <domainMetaElement
                              href="Content.ecore#//ViewField"/>
                          <labelMappings
                              xsi:type="gmfmap:ExpressionLabelMapping">
                            <diagramLabel
                                href="Content.gmfgraph#ViewFieldLabel"/>
                            <viewExpression
                                body="self.field.displayName.concat(' : ').concat(if  self.field.oclIsTypeOf(TextField) then '&#xab;Text&#xbb;' else if self.field.oclIsTypeOf(NumberField) then '&#xab;Number&#xbb;' else if self.field.oclIsTypeOf(BooleanField) then '&#xab;Boolean&#xbb;' else if self.field.oclIsTypeOf(LookUp) then '&#xab;LookUp&#xbb;' else '' endif endif endif endif)"/>
                          </labelMappings>
                          <tool
                              xsi:type="gmftool:CreationTool"
                              href="Content.gmftool#//@palette/@tools.0/@tools.4"/>
                          <diagramNode
                              href="Content.gmfgraph#ViewField"/>
                        </ownedChild>
                      </children>
                      <compartments
                          children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.1/@ownedChild/@children.0">
                        <compartment
                            href="Content.gmfgraph#ViewOwnedViewFieldCompartment"/>
                      </compartments>
                    </ownedChild>
                  </children>
                  <compartments
                      children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0">
                    <compartment
                        href="Content.gmfgraph#CustomListOwnedContentTypeCompartment"/>
                  </compartments>
                  <compartments
                      children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.1">
                    <compartment
                        href="Content.gmfgraph#CustomListOwnedViewCompartment"/>
                  </compartments>
                </ownedChild>
              </children>
              <children
                  compartment="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@compartments.1"
                  referencedChild="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild">
                <containmentFeature
                    href="Content.ecore#//Web/ownedWeb"/>
              </children>
              <compartments
                  children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.0">
                <compartment
                    href="Content.gmfgraph#WebOwnedListCompartment"/>
              </compartments>
              <compartments
                  children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0/@ownedChild/@children.1">
                <compartment
                    href="Content.gmfgraph#WebOwnedWebCompartment"/>
              </compartments>
            </ownedChild>
          </children>
          <compartments
              children="//@nodes.0/@ownedChild/@children.0/@ownedChild/@children.0">
            <compartment
                href="Content.gmfgraph#SiteCollectionOwnedWebCompartment"/>
          </compartments>
        </ownedChild>
      </children>
      <compartments
          children="//@nodes.0/@ownedChild/@children.0">
        <compartment
            href="Content.gmfgraph#WebApplicationOwnedSiteColectionCompartment"/>
      </compartments>
    </ownedChild>
  </nodes>
  <links>
    <domainMetaElement
        href="Content.ecore#//LookUp"/>
    <labelMappings
        xsi:type="gmfmap:ExpressionLabelMapping">
      <diagramLabel
          href="Content.gmfgraph#LookUpLabel"/>
      <viewExpression
          body="self.contentType.displayName.concat(' -> ').concat(self.showField.displayName).concat('   ').concat(self.displayName).concat(' : &#xab;LookUp&#xbb;')"/>
    </labelMappings>
    <containmentFeature
        href="Content.ecore#//ContentType/ownedField"/>
    <tool
        xsi:type="gmftool:CreationTool"
        href="Content.gmftool#//@palette/@tools.0/@tools.7/@tools.3"/>
    <diagramLink
        href="Content.gmfgraph#LookUp"/>
    <linkMetaFeature
        xsi:type="ecore:EReference"
        href="Content.ecore#//LookUp/contentType"/>
  </links>
  <links>
    <labelMappings
        xsi:type="gmfmap:DesignLabelMapping"
        readOnly="true">
      <diagramLabel
          href="Content.gmfgraph#ContentTypeParentContentTypeExternalLabel"/>
    </labelMappings>
    <tool
        xsi:type="gmftool:CreationTool"
        href="Content.gmftool#//@palette/@tools.1/@tools.0"/>
    <diagramLink
        href="Content.gmfgraph#ContentTypeParentContentType"/>
    <linkMetaFeature
        xsi:type="ecore:EReference"
        href="Content.ecore#//ContentType/parentContentType"/>
  </links>
  <diagram>
    <diagramCanvas
        href="Content.gmfgraph#content"/>
    <domainModel
        href="Content.ecore#/"/>
    <domainMetaElement
        href="Content.ecore#//ContentModel"/>
    <palette
        href="Content.gmftool#//@palette"/>
  </diagram>
</gmfmap:Mapping>



Regards

[Updated on: Mon, 03 June 2013 10:38]

Report message to a moderator

Previous Topic:Where are NLS messages defined?
Next Topic:Qualified names on referance labels
Goto Forum:
  


Current Time: Thu Jul 31 07:35:43 EDT 2014

Powered by FUDForum. Page generated in 0.01829 seconds