Skip to main content


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 08:47 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
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 10:23 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
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 10:55 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
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 13:58 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
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 14:10 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
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 14:38]

Report message to a moderator

Re: GMF Palette Stack Tool Group [message #1715101 is a reply to message #1061696] Thu, 19 November 2015 09:17 Go to previous message
Xiao Zhang is currently offline Xiao ZhangFriend
Messages: 2
Registered: November 2015
Junior Member
Hi, I'm learning something about GMF recently, and met the same problem as you did two years ago.

I made a Stack Tool Group, and when I generated the *.gmfgen model, an error occured as below:

"The opposite features 'palette' of 'Tool Group Relationships' and 'groups' of 'Palette mindmap.diagram.part' do not refer to each other".

My palette definition is :
<palette>
<groups
title="mindmap">
<entries
xsi:type="gmfgen:ToolEntry"
title="Topic"
description="Create new Topic"
genNodes="//@diagram/@topLevelNodes.0"/>
<entries
xsi:type="gmfgen:ToolEntry"
title="TopicSubtopics"
description="Create new TopicSubtopics"
genLinks="//@diagram/@links.0"/>
<entries
xsi:type="gmfgen:ToolGroup"
title="Relationships"
stack="true">
<entries
xsi:type="gmfgen:ToolEntry"
title="Dependency"
description="Create new Dependency"
default="true"
genLinks="//@diagram/@links.1"/>
<entries
xsi:type="gmfgen:ToolEntry"
title="Include"
description="Create new Include"
genLinks="//@diagram/@links.2"/>
<entries
xsi:type="gmfgen:ToolEntry"
title="Extend"
description="Create new Extend"
genLinks="//@diagram/@links.3"/>
</entries>
</groups>
</palette>

Have you resolved the problem? Can you help me?
Previous Topic:Old GMF application confilicting with Papyrus
Next Topic:GMF Palette Stack Tool Group
Goto Forum:
  


Current Time: Tue Apr 23 11:25:14 GMT 2024

Powered by FUDForum. Page generated in 0.03778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top