Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » ModelingAssistant Popup for ShapeCompartments
ModelingAssistant Popup for ShapeCompartments [message #988191] Wed, 28 November 2012 18:28
Daniel König is currently offline Daniel KönigFriend
Messages: 24
Registered: November 2012
Junior Member

I had to change my compartments to ShapeCompartments (ListLayout = false).
Since I changed this I do not get the ModelingAssistant Popup anymore.

The EditPolicy should be installed by default:


protected void createDefaultEditPolicies() {
new CreationEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy());
installEditPolicy(EditPolicy.CONTAINER_ROLE, new ContainerEditPolicy());
// TODO: this edit policy get overriden by code at the end of this
// function
// may be this breaks some use cases; it needs to be checked
new DiagramLinkDragDropEditPolicy());
new ContainerNodeEditPolicy());
// Install an edit policy for snap
new SnapFeedbackPolicy());
new ShapeCompartmentDropEditPolicy());
new PopupBarEditPolicy());

ComponentStateCompartmentEditPart extends ShapeCompartmentEditPart:

protected void createDefaultEditPolicies() {
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentComponentStateCompartmentItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ComponentComponentStateCompartmentCanonicalEditPolicy());

The ModelingAssistantProvider should also be fine:

public List getTypesForPopupBar(IAdaptable host) {
IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
if (editPart instanceof ModelEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
return types;
if (editPart instanceof MachineEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
return types;
if (editPart instanceof ComponentStateCompartmentEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
return types;
if (editPart instanceof StateComponentValueCompartmentEditPart) {
ArrayList<IElementType> types = new ArrayList<IElementType>(1);
return types;
return Collections.EMPTY_LIST;

Is there any way I can get the ModelingAssistant back for my ShapeCompartment?
I recognized in the ModelingAssistantProvider that the EditPart for ListCompartments is the Node itself (for example "MachineEditPart"). If it's a ShapeCompartment, the CompartmentEditPart is used ("ComponentStateCompartmentEditPart" resp. "StateComponentValueCompartmentEditPart").

Manually changing to the Node which contains the Compartment did not have any effect.

I hope someone can help me.
Thank you! :)
Previous Topic:Custom ModelAssistant Popup Names and Icons
Next Topic:How to create a new Papyrus diagram
Goto Forum:

Current Time: Tue Apr 07 12:01:39 GMT 2020

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

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

Back to the top