Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Need help about palette Contribution for custom Element
Need help about palette Contribution for custom Element [message #1773918] Fri, 06 October 2017 14:02 Go to next message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 250
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Hello everybody,
I'm working on the integration of Papyrus Properties View framework with WindowBuilder. These views are described with XWT, but with custom widget.

I succeed to render your exising property view with WindowBuilder (hacking it to bypass a ClassLoader problem and continue to work, I just add to windowbuilder a dependency on Papyrus ).
I succeed to add our widgets in the palette using the wb extension point, but I don't understand how to make work it :
- creation is not allowed
- widget can't be selected in the UI. WindowBuilder only understand the composite object.

Our widgets are not instance of Composite, they wrap it and provide a method to create it.

Please do you have some ideas about the process to follow to :
- get my widget selectable in the wb UI
- allow to creation

Here an example of your xwt file:
<?xml version="1.0" encoding="UTF-8"?>
<Composite xmlns="http://www.eclipse.org/xwt/presentation"
	xmlns:creation="clr-namespace:org.eclipse.papyrus.infra.properties.ui.creation"
	xmlns:j="clr-namespace:java.lang" xmlns:ppe="clr-namespace:org.eclipse.papyrus.infra.properties.ui.widgets"
	xmlns:ppel="clr-namespace:org.eclipse.papyrus.infra.properties.ui.widgets.layout"
	xmlns:umlXtext="clr-namespace:org.eclipse.papyrus.uml.properties.xtext"
	xmlns:x="http://www.eclipse.org/xwt"
	xmlns:xtext="clr-namespace:org.eclipse.papyrus.infra.widgets.xtext.creation">
	<Composite.layout>
		<ppel:PropertiesLayout></ppel:PropertiesLayout>
	</Composite.layout>
	<Composite>
		<Composite.layout>
			<ppel:PropertiesLayout></ppel:PropertiesLayout>
		</Composite.layout>
		<ppe:StringEditor input="{Binding}" property="UML:NamedElement:name"></ppe:StringEditor>
		<ppe:StringEditor input="{Binding}" property="UML:NamedElement:label"></ppe:StringEditor>
		<ppe:StringEditor input="{Binding}" property="UML:NamedElement:qualifiedName"></ppe:StringEditor>
	</Composite>
	<Composite>
		<Composite.layout>
			<ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout>
		</Composite.layout>
		<ppe:BooleanRadio input="{Binding}" property="UML:Classifier:isAbstract"></ppe:BooleanRadio>
		<ppe:BooleanRadio input="{Binding}" property="UML:Class:isActive"></ppe:BooleanRadio>
	</Composite>
	<Composite>
		<Composite.layout>
			<ppel:PropertiesLayout></ppel:PropertiesLayout>
		</Composite.layout>
		<ppe:EnumCombo input="{Binding}" property="UML:NamedElement:visibility"></ppe:EnumCombo>
		<ppe:MultiReference input="{Binding}" property="UML:StructuredClassifier:ownedAttribute"></ppe:MultiReference>
	</Composite>
	<Composite>
		<Composite.layout>
			<ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout>
		</Composite.layout>
		<ppe:MultiReference input="{Binding}" property="UML:Class:ownedOperation"></ppe:MultiReference>
		<ppe:MultiReference input="{Binding}" property="UML:Class:ownedReception"></ppe:MultiReference>
	</Composite>
</Composite>

Re: Need help about palette Contribution for custom Element [message #1774093 is a reply to message #1773918] Tue, 10 October 2017 13:36 Go to previous message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 250
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Since 2 days I continued on my problem. I created :

  • java class "*ComponentInfo" extending org.eclipse.wb.internal.xwt.model.widgets.ControlInfo
  • *.wbp-component.xml file, in which I register my java class as <x-model> and I added <parameter name="XWT.hasModel">true</parameter>
    Now I get ClassCastException because my editors can't be cast as Control.
    Of course I could duplicate and adapt the ControlInfo class to fix by problem, but I would like to know if there is another way for that ? I already tried to add this king od thing in my component.xml file, but without success


    		<parameter name="viewer.control.method" value="getControl" />
    		<parameter name="Wrapper.method">getControl</parameter>
    



Previous Topic:Fresh Eclipse Install and Window Builder Design tab crash
Next Topic:creating a palette for Editors which doesn't extends Composite in a XWT context
Goto Forum:
  


Current Time: Sun May 05 14:33:11 GMT 2024

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

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

Back to the top