Creating a custom JFace based extension [message #1777229] |
Mon, 27 November 2017 09:25 |
Gilles Iachelini Messages: 8 Registered: November 2017 |
Junior Member |
|
|
Hello everyone,
I am trying to create a custom extension to make a jface.Viewer based implementation testable through Jubula. This component basically uses all the benefits of the jface.Viewer API and combines it with a simple Canvas, on which I do some rendering (drawing lines, etc.). I'd like to make this custom component being testable with Jubula.
I have a plug-in implementing the the toolkit extension, where I define my IToolkitProvider.
It also contains the ComponentConfiguration.xml, which looks like:
<toolkitComponent type="country.company.project.MyViewer" visible="true">
<realizes>org.eclipse.jface.viewers.Viewer</realizes>
<testerClass>some.package.MyViewerTester</testerClass>
<action name="UserExtension.rcverifytest">
<method>rcverifytest</method>
<param name="UserExtension.rcverifytest.test">
<type>java.lang.String</type>
</param>
</action>
</toolkitComponent>
Is it correct to use the "realizes" tag along with the base/parent class of my custom implementation?
To establish my Adapter and Factory I created a fragment bundle, which contains both: Adapter and AdapterFactory.
The package I used is: org.eclipse.jubula.ext.rc.common.adapter
My Factory looks like:
public class GraphViewerAdapterFactory implements IAdapterFactory {
private static final Class[] ADAPTABLE_TYPES = new Class[]{
MyViewer.class
};
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adaptableType, Object adaptableObject) {
if (adaptableType.isAssignableFrom(IComponent.class)){
return new MyViewerAdapter(adaptableObject);
}
return null;
}
@Override
public Class[] getSupportedClasses() {
return ADAPTABLE_TYPES;
}
}
In the adapter itself I simply cast the parameter (adaptableObject) to MyViewer and redirect all the calls from
the base class AbstractComponentAdapter/interface IWidgetComponent.
These two bundles are referenced by a feature bundle, which is part of an updatesite, which can be used to install the extension.
But the part in the documentation "3.4 Addressing custom controls via the client" is beyond my comprehension.
Where do I put the org.eclipse.jubula.toolkit.ToolkitInfo Implementation?
Where do I put my org.eclipse.jubula.client.AUTAgent extends Remote Implementation? Is there an extension point I am missing? And what is a CAPBuilder?
Thanks for taking the time to read this post.
//g
|
|
|
|
|
|
|
Re: Creating a custom JFace based extension [message #1797039 is a reply to message #1780477] |
Wed, 24 October 2018 11:29 |
|
IMHO a correct(er) ComponentConfiguration.xml would look like this
<toolkitComponent type="country.company.project.MyViewerForITETypeSystem" visible="true">
<realizes>guidancer.abstract.Widget</realizes>
<componentClass>exact.fqn.of.instance.at.runtime.in.aut.context</componentClass > <!-- e.g. the Canvas -->
<testerClass>some.package.MyViewerTester</testerClass>
<action name="UserExtension.rcVerifyTest">
<method>rcVerifyTest</method>
<param name="UserExtension.rcVerifyTest.test">
<type>java.lang.String</type>
</param>
</action>
</toolkitComponent>
|
|
|
Powered by
FUDForum. Page generated in 0.04689 seconds