Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » props "types in selection" & more
props "types in selection" & more [message #158574] Wed, 07 November 2007 09:35 Go to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
hi, I'm always trying to obtain my custom property sheet tab.
What I've done in my trials is this:

1) from .gmfgen by contextual menu option,I added a "custom property tab",
labeled it "xyz", named "example", Implementation class I don't know what
to set, so I left diagram as the others, as Implementation class I set
"myAdvancedPropertySection"

2)added in it a "typed in selection filter" (?? what does it mean anyway?)
with
Generated Types: abstractNavigatorItem
Types in selection: org.eclipse.gmf.runtime.notation.View,
org.eclipse.gef.EditPart
(these I left as the default "Core" custom tab present from
auto-generation, since I have no Idea on how to set these values and I
can't find docs anywhere)

[I regenerate code...] With these settings only, nothing happens, exept
the "Core" property sheet is 'doubled', so appeares twice in the same tab.
I may wonder why, but really can't know how to avoid this.

Then I try the hack way inserting manually in the plugin.xml this:

<extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" >
<propertyTabs
contributorId="org.eclipse.gmf.runtime.diagram.ui.properties ">
<propertyTab
category="Advanced"
id="components.diagram.sheet.YourAdvancedPropertySection"
label="XYZ"/>
</propertyTabs>
</extension>

<extension
point="org.eclipse.ui.views.properties.tabbed.propertySections ">
<propertySections
contributorId="org.eclipse.gmf.runtime.diagram.ui.properties ">
<propertySection
class="components.diagram.sheet.CustomPropertySheet"
filter=" components.diagram.sheet.CustomEditPartPropertySectionFilter "
id="components.diagram.sheet.YourAdvancedPropertySection"
tab="components.diagram.sheet.YourAdvancedPropertySection"/ >
</propertySections>
</extension>

But absolutely nothing happens, I also referred from a post I found here
and I made some debug "system.out" in the two new custom classes I created
under components.diagram.sheet, but again, no news and no console output.

How can I get a tiny cute new tab to work?

Thanks
Re: props "types in selection" & more [message #158690 is a reply to message #158574] Wed, 07 November 2007 14:41 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Paolo,

> class I set "myAdvancedPropertySection"
.....
> [I regenerate code...] With these settings only, nothing happens,
> exept the "Core" property sheet is 'doubled', so appeares twice in the
> same tab. I may wonder why, but really can't know how to avoid this.

myAdvancedPropertySection class (implementation class specified in corresponding
property) should be generated for you and registered in plugin.xml file as
a result of these modifications. This class is a "stub" for you to start
writing your own propertiers tab.

> 2)added in it a "typed in selection filter" (?? what does it mean
> anyway?)
This is a information "<input type="....."/>" parameters are generated in
your plugin.xml by this filter you can specify properties for some exisitng
classes (org.eclipse.gmf.runtime.notation.View) or the class generated by
GMF (currently - only abstractNavigatorItem)

-----------------
Alex Shatalin
Re: props "types in selection" & more [message #158872 is a reply to message #158690] Thu, 08 November 2007 11:44 Go to previous messageGo to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
I did it, finally, thanks to this japanese guy who pragmatically explains
the moves to do to set up your custom property tab in gmf2, and explains
what your click-arounds mean.
This is exellent guys, worths having a look. (It's a link to the google
translation engine because the document is in japanese so expect a fantasy
english, therefore is crisp clear also to a uml/emf/gmf newbie like me.
Someone brave in gmf2 should *really* do a similar tut. in english... just
try googling for [gmf "Typed Selection Filter"] without square brackets
and see yourself how many results!!)
Re: props "types in selection" & more [message #158880 is a reply to message #158872] Thu, 08 November 2007 11:45 Go to previous messageGo to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
I forget to paste the link of this tutorial in japanese.. here it is:
http://translate.google.com/translate?u=http%3A%2F%2Fd.haten a.ne.jp%2Fkojihashi%2Fcomment%3Fdate%3D20070807&langpair =ja%7Cen&hl=it&ie=UTF-8&oe=UTF-8&prev=%2Flan guage_tools
Re: props "types in selection" & more [message #159039 is a reply to message #158872] Thu, 08 November 2007 16:28 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Paolo,

> Someone brave in gmf2 should *really* do a similar tut. in english...
Will be great if you can do it in english on GMF wiki pages.

-----------------
Alex Shatalin
Re: props "types in selection" & more [message #159055 is a reply to message #159039] Thu, 08 November 2007 16:53 Go to previous messageGo to next message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
As soon as I get out of this mess :) perhaps!!!
By now I'm trying to intercept where, what class is responsible for
handling, or have something in common with the property fields name. This
by filling every method with some system.outs(hello1)..2..3 etc but I
couldn't find yet.
I can only put my hands on the code providing tabs and selection listeners
(when you click on an instance of some custom palette tool you placed on
the stage).
If only I could achieve to click on a property field (e.g. "Border Color")
and see the console message "You have clicked: Boder Color".... I will be
really happy ^_^
Don't know how, but I will do it.
Re: props "types in selection" & more [message #159430 is a reply to message #158880] Sat, 10 November 2007 14:30 Go to previous messageGo to next message
Koji Hashimoto is currently offline Koji HashimotoFriend
Messages: 28
Registered: July 2009
Junior Member
Wow, I'm very surprised to see that my blog can be read in English! I
interestingly read the translation, and found that it was hard for you
to understand, of course...

This blog entry describes the way to add a custom property view by
simply replacing the generated XXPropertySection with a custom class
extending AbstractPropertySection.

I would be happy if the blog entry had helped you.

Koji


From: paolo.russian@italtbs.com (Paolo Russian)
Subject: Re: props "types in selection" & more
Date: Thu, 8 Nov 2007 11:45:43 +0000 (UTC)

> I forget to paste the link of this tutorial in japanese.. here it is:
> http://translate.google.com/translate?u=http%3A%2F%2Fd.haten a.ne.jp%2Fkojihashi%2Fcomment%3Fdate%3D20070807&langpair =ja%7Cen&hl=it&ie=UTF-8&oe=UTF-8&prev=%2Flan guage_tools
>
Re: props "types in selection" & more [message #159563 is a reply to message #159430] Mon, 12 November 2007 07:57 Go to previous message
paolo russian is currently offline paolo russianFriend
Messages: 81
Registered: July 2009
Member
Awesome, it is you! Well, I owe you one dude, you're the only one that
explained (in a practical short way) how to do this thing.
Now I have my swt properties sheet, what I have to find out now is if
there is a way to "auto populate" this property sheet (I modified the core
tab so it becomes swt, because I need to place buttons and similar custom
components in order to pop out some custom dialogs I already had in old
gmf version) basing on the custom properties defined in the model.
As you know(being my teacher eheh) overriding the property sheet like
you've done, gives you a blank property sheet. If I have a gigantic model
with dozens of palette components, each of them with dozens of custom
property vaules, I have to make editable the all of them in my
propsheet. The very big problem is that we can't afford so much time to
insert/edit one by one from zero all of the custom fields for each of the
palette tools, would be appreciable for me if I manage to implement a
method that as you select a istantiated item from the palette, the code
searches for all of its properties in the model and progamatically create
in the swt propsheet tab the gui components to edit them (e.g. it finds a
property named "binding" and adds to the propsheet form a label named
"binding" a textinput with the actual value readed from wherever it is,
and a button to save, eventually. In the case the field is "color", writes
a label "Color:", a tiny square representing the actual color, and a
button that pops out a color dialog).
If you wish I can provide a translation in english for your tutorial page,
that can be enlarged whithin time as long as I get my work done, but since
some text parts are not translated (and since I may have misunderstood
some parts for sure) you should correct it :)
Previous Topic:Attribute Symbols
Next Topic:programmatically reconnect target of connection
Goto Forum:
  


Current Time: Thu Apr 25 23:27:10 GMT 2024

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

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

Back to the top