props "types in selection" & more [message #158574] |
Wed, 07 November 2007 09:35 |
paolo russian 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 #159563 is a reply to message #159430] |
Mon, 12 November 2007 07:57 |
paolo russian 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 :)
|
|
|
Powered by
FUDForum. Page generated in 0.03779 seconds