Creating a custom JFace based extension [message #1777229] |
Mon, 27 November 2017 09:25  |
Eclipse User |
|
|
|
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 #1778023 is a reply to message #1777295] |
Fri, 08 December 2017 09:40   |
Eclipse User |
|
|
|
@Marvin Mueller
hi,Marvin Mueller,I post a topic in Nov.7th,but I still haven't seen my post in forum.After submiting successfully,system prompts it need to be verified by the administrator.How long does it to be seen and replied?
I'm looking forward to your reply,thanks.
|
|
|
Re: Creating a custom JFace based extension [message #1779979 is a reply to message #1778023] |
Tue, 16 January 2018 09:55   |
Eclipse User |
|
|
|
Hello Gilles,
I am looking to do a very similar thing to what you have described in this post. I was wondering if you managed to get any further with this or not. Happy to share any help/thoughts on this to try to find a resolution. Thanks
Regards,
Stuart.
|
|
|
|
Re: Creating a custom JFace based extension [message #1797039 is a reply to message #1780477] |
Wed, 24 October 2018 11:29  |
Eclipse User |
|
|
|
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.03618 seconds