Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Extending the properties view
Extending the properties view [message #962694] Mon, 29 October 2012 08:57 Go to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
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 22:25 Go to previous messageGo to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
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 16:17 Go to previous messageGo to next message
Martin Jonsson is currently offline Martin JonssonFriend
Messages: 21
Registered: March 2013
Junior Member
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 09:47 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hello Martin,

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


Camille


Camille Letavernier
Re: Extending the properties view [message #1312478 is a reply to message #962694] Thu, 24 April 2014 10:05 Go to previous messageGo to next message
Seif B. is currently offline Seif B.Friend
Messages: 2
Registered: April 2014
Junior Member
Hello Goood Guy !!

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

Thank you !!
  • Attachment: Capture1.JPG
    (Size: 108.03KB, Downloaded 256 times)
Re: Extending the properties view [message #1323980 is a reply to message #1312478] Wed, 30 April 2014 14:46 Go to previous message
Philippe Roland is currently offline Philippe RolandFriend
Messages: 4
Registered: January 2013
Junior Member
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: Wed Apr 24 23:02:44 GMT 2024

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

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

Back to the top