Creating a custom JFace based extension [message #1777076] |
Fri, 24 November 2017 05:28  |
Eclipse User |
|
|
|
Hello everyone,
I have some questions regarding "Creating toolkit extensions for custom UI widgets"
Introduction
I have a custom component based on org.eclipse.jface.viewers.Viewer. This component (or Viewer for that matter) basically contains a org.eclipse.swt.widgets.Canvas somewhere deep inside, which will be used to render "stuff". It basically draws "things" on this canvas.
I'd like to make the Viewer itself testable by providing a custom Adapter similar to what you got with "JComponentAdapter" which implements all sorts of interaction on a JComponent.
My Attempt - The Plug-In
Is it correct to create the extension plug-in and define a toolkitsupport with a IToolkitProvider based on "level=toolkit"?
Also put a "WidgetTester" based Tester Implementation in that bundle, which is later being referenced through the "ComponentConfiguration.xml":
<toolkitComponent type="country.company.project.MyCustomJFaceViewer" visible="true">
<realizes>org.eclipse.jface.viewers.Viewer</realizes>
<testerClass>myCustomViewerTester</testerClass>
<action name="UserExtension.rcverifytest">
<method>rcverifytest</method>
<param name="UserExtension.rcverifytest.test">
<type>java.lang.String</type>
</param>
</action>
</toolkitComponent>
My Attempt - The Fragment
Furthermore is it correct to create the required fragment with "org.eclipse.jubula.rc.rcp.swt" as host? I have a package named "org.eclipse.jubula.ext.rc.common.adapter" which contains my Adapter and the Factory.
The factory checks whether the adaptableType isAssignableFrom IComponent.class and passes the objectToAdapt to the CustomAdapter based on AbstractComponentAdapter implementing IWidgetComponent. Within the constructor of the CustomAdapter I can cast the parameter to my MyCustomJFaceViewer and forward all calls accordingly.
Am I on the right track here? Or should I rather follow the "JavaFX" way?
The help documentation continues with the ToolkitInfo and ToolkitInformation implementation. But here I totally get lost: Where to put these implementations? Or is there an extension point I overlooked?
Thanks for taking the time to read this lengthy gibberish :)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03990 seconds