Implementing IClientPlugin and IDeveloperPlugin in a single

Questions and answers on developing, deploying and using plugins and JavaBeans

Implementing IClientPlugin and IDeveloperPlugin in a single

Postby sdevlin » Fri May 06, 2005 10:02 pm

Version R2 2.2rc7-build 325
Java version 1.4.2_07-b05 (Windows XP)

I'm curious how a plugin implementing both IClientPlugin and IDeveloperPlugin gets initialized. It appears that a class that is both a client plugin and a developer plugin is only passed an IClientPluginAccess object and not the IDeveloperPluginAccess object.

I would like to have a single plugin that knows if it is running in developer or regular client mode. I expected to be able test if the access object was an instance of IDeveloperPluginAccess. But the plugin was initialized only with an IClientPluginAccess even though it implements IDeveloperPlugin and was running in developer.

public class TestPlugin implements IClientPlugin, IScriptObject, IDeveloperPlugin {

private IClientPluginAccess app;

public void initialize(IClientPluginAccess app) throws PluginException {
this.app = app;
}
public void initialize(IDeveloperPluginAccess app) throws PluginException {
this.app = app;
}


public boolean js_isRunningInDeveloper(){
return app instanceof IDeveloperPluginAccess;
}
}
sdevlin
 
Posts: 125
Joined: Tue Apr 13, 2004 3:33 am

Postby jcompagner » Mon May 09, 2005 10:22 am

The plugin is just initialized as both. and that 2 instances are made.
And which one then will be used in the scripting should be the developer one. I will fix this for the next release >RC7
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 39 guests

cron