Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Linking custom view on a selected element
Linking custom view on a selected element [message #231851] Mon, 01 June 2009 03:50 Go to next message
Eclipse UserFriend
Hi all,

I want to ba able to display a custom view when the user selects a diagram
element. I.e., when selecting an element of type A, I want to display
View1 and when the user selects an element of type B, I want to open the
"B View".
Can you tell me how I can do that ?

In addition, I have problems writing the custom view. I took the eclipse
dedicated project in CVS and read the following article but the view seems
to be incomplete
( http://www.eclipse.org/articles/Article-Tabbed-Properties/ta bbed_properties_view.html).
I think this feature is a common one, so if you have an example I can use
it will speed my developments !

FYI, I am using Eclipse 3.4.2.

Regards
Charles
Re: Linking custom view on a selected element [message #231910 is a reply to message #231851] Mon, 01 June 2009 07:38 Go to previous messageGo to next message
Eclipse UserFriend
Hello Charles,

If you are talking about properties view then see extension to the point="org.eclipse.ui.views.properties.tabbed.propertySections "
generated in plugin.xml of diagram editor.
This is a way to display particular properties tab for some particular selection
class. You can create your own properties tab and register it for some selection
type using "filter" class.

-----------------
Alex Shatalin
Re: Linking custom view on a selected element [message #231918 is a reply to message #231910] Mon, 01 June 2009 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

thanks for your reply.

I have already read and tried the following :
- http://wiki.eclipse.org/GMF_Propsheet_Customization : but I can't manage
to create a new Property Section Container

I think it is better to add my sections to gmfgen instead of directly in
the generated plugin.xml ?
Maybe is is better to create a separate plugin for the view and only add
the filter in the gmfgen ?
What is your feedback on those points ?

Thanks
Charles
Re: Linking custom view on a selected element [message #231935 is a reply to message #231918] Mon, 01 June 2009 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Hello Charles,

> I think it is better to add my sections to gmfgen instead of directly
> in
> the generated plugin.xml ?
> Maybe is is better to create a separate plugin for the view and only
> add
> the filter in the gmfgen ?
> What is your feedback on those points ?
You can choose any possibility. First you can try modifying plugin.xml. Then
you can move these settings to .gmfgen model and if you have explicit requirements
to move this functionality into the separqate plugin - you can do it too.

-----------------
Alex Shatalin
Re: Linking custom view on a selected element [message #232013 is a reply to message #231935] Tue, 02 June 2009 07:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi ALex,

I have succesfully created a plugin that updates the properties view. I
have decided to create a separate plugin because I will need to
extends/override this one for later uses.
I had a look at my plugin.xml file in my diagram plugin and I have seen
the filter attribute. It is hard for me to understand how this works. In
fact the filter is
<propertySection id="property.section.RulerGridPropertySection"

filter=" org.eclipse.gmf.runtime.diagram.ui.properties.filters.Diagra mEditPartPropertySectionFilter "

class=" org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid. RulerGridPropertySection "
tab="property.tab.DiagramPropertySection">
</propertySection>

My questions are :
- my sections are already defined in my "external" plugin. Do I need to
add a filter in my external plugin ? Or I need to "duplicate" the section
in my diagram plugin ?
- filters in the diagram plugin.xml (gmf generated) is using eclipse
filters. If I want to display my properties view only for one element, do
I need to write a specific filter ? If yes, can you give me a link with an
example ?

Thanks a lot
Charles
Re: Linking custom view on a selected element [message #232043 is a reply to message #232013] Tue, 02 June 2009 12:05 Go to previous messageGo to next message
Eclipse UserFriend
Hello Charles,

> My questions are :
> - my sections are already defined in my "external" plugin. Do I need
> to
> add a filter in my external plugin ? Or I need to "duplicate" the
> section
> in my diagram plugin ?
Filter is a class implementing org.eclipse.jface.viewers.IFilter interface.
In general this is a way to hide/show particular property section, so it
depends on your section implementation if you need it ot be visible always
you can skip filter othervise - specify some filter class.

> - filters in the diagram plugin.xml (gmf generated) is using eclipse
> filters. If I want to display my properties view only for one element,
> do
> I need to write a specific filter ? If yes, can you give me a link
Yes. See javadoc for IFilter interface - it is simple.

-----------------
Alex Shatalin
Re: Linking custom view on a selected element [message #232304 is a reply to message #232043] Thu, 04 June 2009 04:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

thanks again for your quick answers. I am a newbie on Eclipse plugins and
GMF. I am able to run the tabbed properties example in a separate plugin
without any problem now. My problem is when I want to integrate it in my
studio. I want to display this cutom properties view xhen I choose a
specific element on my diagram.

My questions is :
in my separate plugin.xml, I have the following extension points declared
:
* org.eclipse.ui.views.properties.tabbed.propertyContributor
* org.eclipse.ui.views.properties.tabbed.propertyTabs
* org.eclipse.ui.views.properties.tabbed.propertySections
-> these E.P. are already defined in my diagram plugin.xml, do I need to
merge them or do I need to delete those defined in my diagram ? In brief,
is it possible to have many time the same E.P. and if not where do I need
to declare it ?

Thanks a lot for your help, I have troubles finding the doc on the
internet showing me a complete example of a custom properties view inside
a gmf editor...

Best regards
Charles
Re: Linking custom view on a selected element [message #232405 is a reply to message #232304] Thu, 04 June 2009 11:09 Go to previous messageGo to next message
Eclipse UserFriend
Hello Charles,

AFAIU:

<propertyContributor contributorId="<editorID>" labelProvider="<labelProviderClass>">
is something unique for the editor with current ID (generated diagram editor)
so there can be several contributors but only one is applicable to the selected
editor.

<propertyTabs contributorId="<editorID>">
you can contribute new tabs using this extension point element several times
from different plugins to the same property page declared by "propertyContributor"
above.

<propertySections contributorId="<editorID>">
again you can declare sections in any plugins by referencing proper propertyContributor/tab
using their Ids.

-----------------
Alex Shatalin
Re: Linking custom view on a selected element [message #232468 is a reply to message #232405] Thu, 04 June 2009 13:08 Go to previous messageGo to next message
Eclipse UserFriend
hi Alex,

thanks a lot for your help. I am no able to display a specific tab &
section for a given element.

My last problem is that I can only do that if my tab and section are
declared in my diagram plugin.xml. I tried moving my Section and Filter
java code to another plugin and section and tab xml declaration into this
other plugin but it doesn't work...

Do I need to do something specific ?

I tried launching in debug mode, my Filter is not called.

best regards
Charles
Re: Linking custom view on a selected element [message #232581 is a reply to message #232468] Fri, 05 June 2009 06:43 Go to previous message
Eclipse UserFriend
Hello Charles,

Do not have an idea why does it happen... Try to debug more..

-----------------
Alex Shatalin
Previous Topic:How to remove the edit commands (cut,copy,paste,duplicate) in editGroup under edit
Next Topic:validation between diagrams
Goto Forum:
  


Current Time: Sun Nov 09 16:07:38 EST 2025

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

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

Back to the top