Skip to main content



      Home
Home » Modeling » Papyrus » Extending the properties view
Extending the properties view [message #962694] Mon, 29 October 2012 04:57 Go to next message
Eclipse UserFriend
Hi,

I would like to create an own tab in the properties view for my application.
In particular, this tab gets activated, when the user selects a Transition from a ProtocolStateMachine or a Message in a Sequence Diagram. The tab has a widget that shows a list of available operations from a certain interface. When the user selects an operation, all elements that are necessary are created at once (trigger, event, etc.)

After some time I finally found out, that the properties view is managed by org.eclipse.papyrus.uml.properties resp. org.eclipse.papyrus.views.properties.model (very cool thing btw). Is there some documentation about how to use it?

I tried to create such a property model via the "Property view configuration" in the Papyrus New Wizard. What do I have to select for the source? The UML.ecore? Where do I find the right one? What do I have to select for the target? A new .ctx file?

I guess this generation process is to generate the Data Contexts so that Attributes and References from the Ecore model can be referenced.

I assume that the .ctx model is partitioned into the .xwt files. This means, when you create a widget model element, it isn't stored in the .ctx but in the .xwt. Is that correct?

I guess for my intention, there exists no predefined adequate widget. How can I create and include my self-made widget?


Regards,
Simon



Re: Extending the properties view [message #986556 is a reply to message #962694] Tue, 20 November 2012 17:25 Go to previous messageGo to next message
Eclipse UserFriend
for those who are interested, this is how it works:



  • in the properties view, click on "view menu" > "customize property view"
  • select "UML (Read-only)" and hit "copy". Name the customization as you like e.g. "Custom"
  • go to workspace\.metadata\.plugins\org.eclipse.papyrus.views.properties\CUSTOM and copy its content to the plugin you want to deploy.
  • open the CUSTOM.ctx and rename the UML tab and provide a new ID for it.
  • delete the profile tab and all views you do not want to contribute to. Keep all data contexts intact and fix the broken reference from the view to the section you want to contribute to manually. validate the context model.
  • in your plugin.xml add an extension for org.eclipse.papyrus.views.properties.context
  • create a new custom widget, i.e. a java class that inherits from org.eclipse.papyrus.views.properties.widgets.AbstractPropertyEditor. In its constructor, call super.setEditor(editor) where editor is an instance of a class that inherits e.g. from org.eclipse.papyrus.infra.widgets.editors.AbstractListEditor
  • go to the ui-folder and open the xwt-file for the view you want to contribute to. Add a new namespace to the file, that is the package that contains your widget java class.


plugin.xml
   
<extension point="org.eclipse.papyrus.views.properties.context">
      <context contextModel="properties/CUSTOM.ctx">
      </context>
   </extension>


MySingleTransition.xwt
<?xml version="1.0" encoding="UTF-8"?>
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
	xmlns:ppel="clr-namespace:org.eclipse.papyrus.views.properties.widgets.layout"
	xmlns:x="http://www.eclipse.org/xwt" xmlns:ppe="clr-namespace:org.eclipse.papyrus.views.properties.widgets"
	xmlns:custom="clr-namespace:my.package.custom.widgets">
	<Composite.layout>
		<ppel:PropertiesLayout></ppel:PropertiesLayout>
	</Composite.layout>
	<custom:OperationForTransitionSelector input="{Binding}"
		property="UML:Transition:trigger"></custom:OperationForTransitionSelector>
</Composite>

Re: Extending the properties view [message #1016030 is a reply to message #986556] Mon, 04 March 2013 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Hello Simon.

I might be completely stupid but I don't seem to find the "view menu" setting in the property view. I guess I'm looking in the wrong place.

Could you please elaborate a bit on that step?

Thanks a ton!
Martin
Re: Extending the properties view [message #1016660 is a reply to message #1016030] Thu, 07 March 2013 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Hello Martin,

The "View menu" is the white arrow on the top-right corner of the properties view


Camille
Re: Extending the properties view [message #1312478 is a reply to message #962694] Thu, 24 April 2014 06:05 Go to previous messageGo to next message
Eclipse UserFriend
Hello Goood Guy !!

I dont see option "select "UML (Read-only)" and hit "copy" ".

Thank you !!
  • Attachment: Capture1.JPG
    (Size: 108.03KB, Downloaded 288 times)
Re: Extending the properties view [message #1323980 is a reply to message #1312478] Wed, 30 April 2014 10:46 Go to previous message
Eclipse UserFriend
Hi Seif,

The reason you don't get the same window as Simon is because you're running what seems to be an earlier version of Papyrus (0.8, probably). I'm not sure how the window shown in your screenshot works - I usually get those files off the code. You can find them by checking out org.eclipse.papyrus.properties.uml;

Alternatively, and unless you have a specific reason for sticking to 0.8, I'd advise you to switch to a more recent version and follow Simon's instructions, which still work on 1.0

Philippe
Previous Topic:Class equivalent to ModelElementItem
Next Topic:Association in Deployment Diagram
Goto Forum:
  


Current Time: Fri Jul 04 03:55:52 EDT 2025

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

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

Back to the top