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 #988175] Wed, 28 November 2012 18:28 Go to next message
Daniel König is currently offline Daniel König
Messages: 24
Registered: November 2012
Junior Member
Hello!

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:

org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart:
	protected void createDefaultEditPolicies() {
		super.createDefaultEditPolicies();
		installEditPolicy(EditPolicyRoles.CREATION_ROLE,
			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
		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,
			new DiagramLinkDragDropEditPolicy());
		installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
			new ContainerNodeEditPolicy());
		// Install an edit policy for snap
		installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE,
			new SnapFeedbackPolicy());
		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,
			new ShapeCompartmentDropEditPolicy());
		installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE,
			new PopupBarEditPolicy());
	}




ComponentStateCompartmentEditPart extends ShapeCompartmentEditPart:
	protected void createDefaultEditPolicies() {
		super.createDefaultEditPolicies();
		installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ComponentComponentStateCompartmentItemSemanticEditPolicy());
		installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicyWithCustomReparent(
				MachineVisualIDRegistry.TYPED_INSTANCE));
		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);
			types.add(MachineElementTypes.Machine_2001);
			return types;
		}
		if (editPart instanceof MachineEditPart) {
			ArrayList<IElementType> types = new ArrayList<IElementType>(1);
			types.add(MachineElementTypes.Component_3001);
			return types;
		}
		if (editPart instanceof ComponentStateCompartmentEditPart) {
			ArrayList<IElementType> types = new ArrayList<IElementType>(1);
			types.add(MachineElementTypes.State_3002);
			return types;
		}
		if (editPart instanceof StateComponentValueCompartmentEditPart) {
			ArrayList<IElementType> types = new ArrayList<IElementType>(1);
			types.add(MachineElementTypes.StateValue_3004);
			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! Smile
Re: ModelingAssistant Popup for ShapeCompartments [message #1173997 is a reply to message #988175] Wed, 06 November 2013 22:08 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 240
Registered: January 2013
Location: Izmir
Senior Member
Hi,

U solve This problem ?

I need to done this too Smile

Regards
Re: ModelingAssistant Popup for ShapeCompartments [message #1183014 is a reply to message #1173997] Tue, 12 November 2013 15:26 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

did you check this extension point org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders in plugin.xml?

Ralph
Re: ModelingAssistant Popup for ShapeCompartments [message #1183997 is a reply to message #1183014] Wed, 13 November 2013 06:39 Go to previous messageGo to next message
serhat gezgin is currently offline serhat gezgin
Messages: 240
Registered: January 2013
Location: Izmir
Senior Member
Hi,

yes i check the org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders extension

   <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
      <?gmfgen generated="true"?>
      <modelingAssistantProvider class="com.mdd4cca.msf.content.diagram.providers.ContentModelingAssistantProvider">
         <Priority name="Lowest"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ContentModelEditPart" id="ContentModel_1000"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.WebEditPart" id="Web_2001"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.EntityModelEditPart" id="EntityModel_2003"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.DataBaseEditPart" id="DataBase_2002"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.CustomListEditPart" id="CustomList_3001"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ContentTypeEditPart" id="ContentType_3002"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.OverrideFieldEditPart" id="OverrideField_3020"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.TextFieldEditPart" id="TextField_3003"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.NumberFieldEditPart" id="NumberField_3004"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.BooleanFieldEditPart" id="BooleanField_3005"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.UserFieldEditPart" id="UserField_3006"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.CurrencyFieldEditPart" id="CurrencyField_3007"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.URLFieldEditPart" id="URLField_3008"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.NoteFieldEditPart" id="NoteField_3009"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.DateTimeFieldEditPart" id="DateTimeField_3010"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ChoiceFieldEditPart" id="ChoiceField_3011"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ViewEditPart" id="View_3012"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ViewFieldEditPart" id="ViewField_3013"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.Web2EditPart" id="Web_3014"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.EnumTypeEditPart" id="EnumType_3024"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.LiteralEditPart" id="Literal_3025"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ComplexTypeEditPart" id="ComplexType_3026"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ScalarProperty2EditPart" id="ScalarProperty_3028"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ComplexProperty2EditPart" id="ComplexProperty_3029"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.EntityEditPart" id="Entity_3021"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ScalarPropertyEditPart" id="ScalarProperty_3030"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ComplexPropertyEditPart" id="ComplexProperty_3031"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.NavigationPropertyEditPart" id="NavigationProperty_3032"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.TableEditPart" id="Table_3015"/>
         <object class="com.mdd4cca.msf.content.diagram.edit.parts.ColumnEditPart" id="Column_3018"/>
         <context elements="ContentModel_1000,Web_2001,EntityModel_2003,DataBase_2002,CustomList_3001,ContentType_3002,OverrideField_3020,TextField_3003,NumberField_3004,BooleanField_3005,UserField_3006,CurrencyField_3007,URLField_3008,NoteField_3009,DateTimeField_3010,ChoiceField_3011,View_3012,ViewField_3013,Web_3014,EnumType_3024,Literal_3025,ComplexType_3026,ScalarProperty_3028,ComplexProperty_3029,Entity_3021,ScalarProperty_3030,ComplexProperty_3031,NavigationProperty_3032,Table_3015,Column_3018"/>
      </modelingAssistantProvider>
   </extension>
Re: ModelingAssistant Popup for ShapeCompartments [message #1184135 is a reply to message #1183997] Wed, 13 November 2013 08:42 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

maybe you should open a bud containing a minimal example to reproduce your problem.

Ralph
Previous Topic:get the connection end point..
Next Topic:GMF toolbar actions refresh/update issue
Goto Forum:
  


Current Time: Tue Oct 21 17:03:42 GMT 2014

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

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