Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Customized tabbed property view section and editPart issue
Customized tabbed property view section and editPart issue [message #184524] Mon, 28 April 2008 09:10 Go to next message
Eclipse UserFriend
Hi,
I have one domain element E that contains an enumeration which specifies
its type : E1, E2 or E3. I have added a constraint in my gmfmap to
distinguish which element would be created (multiple toolbar item for
one domain element). GMF has generated 3 different editparts: edt1,
edt2, edt3. So, the mapping object => EditPart is defined by the value
of type of the E element.

I have customized my own tabbed property. These E elements have
different displayed sections. There is a section where user can change
the type of the selected element.
When selection change, I would like to change dynamically the display of
the sections by changing the instance of the editPart. Is it possible ?
How can I do that ?

If I close my diagram and reopen it, the correct editPart is created.
But I would like to do it without closing the diagram.

Thanks for your help.

Regards,

Philippe
Re: Customized tabbed property view section and editPart issue [message #184533 is a reply to message #184524] Mon, 28 April 2008 09:37 Go to previous messageGo to next message
Eclipse UserFriend
Hello Philippe,

You have to listen for the corresponding event (in EditPart code) and fire
diagram update to refresh links (see generated EcoreDiagramUpdateCommand).

-----------------
Alex Shatalin
Re: Customized tabbed property view section and editPart issue [message #184556 is a reply to message #184533] Mon, 28 April 2008 09:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,
Thank you for your response.
I managed to force diagram refreshing with the following code :

===================
List editPolicies =
CanonicalEditPolicy.getRegisteredEditPolicies(event.eContain er());
for (Iterator it = editPolicies.iterator(); it.hasNext();) {
CanonicalEditPolicy nextEditPolicy =
(CanonicalEditPolicy) it.next();
nextEditPolicy.refresh();

}
===============

But now, my current tabbed view is out of date. I have to manually
reselect my element to see the changements. Can I force the update of my
tabbed view page ? Or automatically reselect my element ?

Thank you.

Philippe


Alex Shatalin a écrit :
> Hello Philippe,
>
> You have to listen for the corresponding event (in EditPart code) and
> fire diagram update to refresh links (see generated
> EcoreDiagramUpdateCommand).
>
> -----------------
> Alex Shatalin
>
>
Re: Customized tabbed property view section and editPart issue [message #184628 is a reply to message #184556] Tue, 29 April 2008 04:10 Go to previous messageGo to next message
Eclipse UserFriend
Is it possible to set the new created Edit Part in the selection mode ?
How and where (method, class) can I do that ?

Thank you for your help!

Philippe
Re: Customized tabbed property view section and editPart issue [message #184674 is a reply to message #184628] Tue, 29 April 2008 06:56 Go to previous messageGo to next message
Eclipse UserFriend
Hello Philippe,

You can use ???DiagramEditor.getGraphicalViewer().setSelection() for it.

-----------------
Alex Shatalin
Re: Customized tabbed property view section and editPart issue [message #184705 is a reply to message #184674] Tue, 29 April 2008 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

I tried two different methods :

//////////
EditPartViewer v = newEdt.getRoot().getViewer();
v.setSelection(new StructuredSelection(newEdt));

/////////
final EditPartViewer viewer = newEdt.getViewer();
final EditPart elementPart = newEdt;

if (elementPart != null) {
Display.getCurrent().asyncExec(new Runnable() {

public void run() {
viewer.setSelection(new StructuredSelection(elementPart));
Request der = new Request(RequestConstants.REQ_SELECTION);
elementPart.performRequest(der);
}
});
}


Both give the same result : my element is well selected (it is dark
colored), but my property tab is not updated.

Any ideas ?

Thanks.

Philippe BLANC
Re: Customized tabbed property view section and editPart issue [message #184730 is a reply to message #184705] Tue, 29 April 2008 11:28 Go to previous message
Eclipse UserFriend
In fact, id I do a "REQ_DIRECT_EDIT" request, the property tab is well
updated. But I don't want to set my element in the direct edit mode,
just select it.

Philippe BLANC a écrit :
> Hi Alex,
>
> I tried two different methods :
>
> //////////
> EditPartViewer v = newEdt.getRoot().getViewer();
> v.setSelection(new StructuredSelection(newEdt));
>
> /////////
> final EditPartViewer viewer = newEdt.getViewer();
> final EditPart elementPart = newEdt;
>
> if (elementPart != null) {
> Display.getCurrent().asyncExec(new Runnable() {
>
> public void run() {
> viewer.setSelection(new
> StructuredSelection(elementPart));
> Request der = new
> Request(RequestConstants.REQ_SELECTION);
> elementPart.performRequest(der);
> }
> });
> }
>
>
> Both give the same result : my element is well selected (it is dark
> colored), but my property tab is not updated.
>
> Any ideas ?
>
> Thanks.
>
> Philippe BLANC
Previous Topic:How to prevent auto resizing of shape/compartment
Next Topic:Attribute With Line
Goto Forum:
  


Current Time: Wed Nov 05 11:11:55 EST 2025

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

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

Back to the top