Plugin does not appear in Servoy Editor

Hello All

I was trying to do the plugin example in the "How to " document … but it does not appear in the plugins list in Servoy Editor … could anyone tell me what i might be missing (i’m using Eclipse SDK 3.0 win32 & Servoy 3.0b3)

Regards

Hi,

No, not possible. You clearly forgot something otherwise it would work. What it is you missed is impossible to tell without additional information or sharing your project.

This is like asking somebody why you are somewhere else instead of where you wanted to be, only informing him or her that you are travelling with a Ford.

Well i’m attaching herein both classes and a snap of the Eclipse screen to illustrate classes hierarchy.

Regards[/code]

Mypluginprovider.txt (1.61 KB)

Myplugin.txt (2.81 KB)

Sorry Marcel i thought attaching both text files will display them

/*
 * Created on 19/05/2006
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.mycompany.plugin.name;

import java.beans.PropertyChangeEvent;
import java.util.Properties;

import javax.swing.Icon;

import com.servoy.j2db.plugins.IClientPlugin;
import com.servoy.j2db.plugins.IClientPluginAccess;
import com.servoy.j2db.plugins.PluginException;
import com.servoy.j2db.preference.PreferencePanel;
import com.servoy.j2db.scripting.IScriptObject;

/**
 * @author saher
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Myplugin implements IClientPlugin {

	private IClientPluginAccess application;
	private Mypluginprovider scriptObject;

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IClientPlugin#initialize(com.servoy.j2db.plugins.IClientPluginAccess)
	 */
	public void initialize(IClientPluginAccess arg0) throws PluginException {
		// TODO Auto-generated method stub
application=arg0;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IClientPlugin#getPreferencePanels()
	 */
	public PreferencePanel[] getPreferencePanels() {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IClientPlugin#getName()
	 */
	public String getName() {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IClientPlugin#getImage()
	 */
	public Icon getImage() {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IClientPlugin#getScriptObject()
	 */
	public IScriptObject getScriptObject() {
		if(scriptObject==null)
		{scriptObject=new Mypluginprovider();}		
		
		
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IPlugin#load()
	 */
	public void load() throws PluginException {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IPlugin#unload()
	 */
	public void unload() throws PluginException {
		
		
		application=null;
		scriptObject=null;
		
		
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.plugins.IPlugin#getProperties()
	 */
	public Properties getProperties() {
		Properties props=new Properties();
		props.put(DISPLAY_NAME,"MY PLUGIN");
		
		
		// TODO Auto-generated method stub
		return props;
	}

	/* (non-Javadoc)
	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
	 */
	public void propertyChange(PropertyChangeEvent arg0) {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
	}
}

second class …

/*
 * Created on 19/05/2006
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.mycompany.plugin.name;

import com.servoy.j2db.scripting.IScriptObject;

/**
 * @author saher
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Mypluginprovider implements IScriptObject {

public String js_getHelloString (String name)	{
	
	return "hello"+name;
}




/* (non-Javadoc)
	 * @see com.servoy.j2db.scripting.IScriptObject#getSample(java.lang.String)
	 */
	public String getSample(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.scripting.IScriptObject#getToolTip(java.lang.String)
	 */
	public String getToolTip(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.scripting.IScriptObject#getParameterNames(java.lang.String)
	 */
	public String[] getParameterNames(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.scripting.IScriptObject#isDeprecated(java.lang.String)
	 */
	public boolean isDeprecated(String arg0) {
		// TODO Auto-generated method stub
		return false;
	}

	/* (non-Javadoc)
	 * @see com.servoy.j2db.scripting.IScriptObject#getAllReturnedTypes()
	 */
	public Class[] getAllReturnedTypes() {
		// TODO Auto-generated method stub
		return null;
	}

	public static void main(String[] args) {
	}
}

Regards

I took a very quick peek but you even return a null value at the getName() method. So… As a result the plugin does not appear in the plugin tree.

2 tips:

  1. have a look at the mail plugin. valuable info!!!
  2. have a look at the api. might help :)

Hope you will get this going now. Johan wrote the document when I wanted to get started developing a plugin and it helped me, along with the changes I added to it, to really get started. When you follow it to the letter it should really get you going.

HI Maecel …

After few attempts i was able successfuly to make work … because i choose a package name same as Servoy plugin package name (com.servoy.r2.plugins) … using the package name same as the example couldnt make it appearing in the editor.

Thankx for your help

OK, but that was not visible in your code that you attached