Difference between revisions of "Developing Plug-Ins - IUserPanelMenuFactory"

From iDempiere en
Line 16: Line 16:
  
 
=The workflow=
 
=The workflow=
 +
The first thing you want to do is to create a Plug-In. If you already have a Plug-In and just want to add the MenuFactory there, thats also ok. To create a new Plug-In you select the Eclipse-Menu File>New>Other... Here you go to the "Plug-in Development" section and chose Plug-in Project. Chose a name and a location, make sure the OSGi framework is Equinox and click on next. Chose your name and the execution environment and click on finish.
  
−
[[File:.png|320px]]
+
The second step is to create a class which implements the IUserPanelMenuFactory interface. To do this, create a package of your choice and create a new class in there:
 +
 
 +
[[File:Menu1.png|320px]]
 +
 
 +
<pre>
 +
package org.evenos.menutest;
 +
 
 +
import org.adempiere.webui.panel.IUserPanelMenuFactory;
 +
import org.zkoss.zk.ui.Component;
 +
import org.zkoss.zk.ui.event.Event;
 +
 
 +
public class MenuFactory implements IUserPanelMenuFactory {
 +
 
 +
@Override
 +
public void onEvent(Event event) throws Exception {
 +
// TODO Auto-generated method stub
 +
 +
}
 +
 
 +
@Override
 +
public String[] getMenus() {
 +
// TODO Auto-generated method stub
 +
return null;
 +
}
 +
 
 +
@Override
 +
public void setComponent(Component component) {
 +
// TODO Auto-generated method stub
 +
 +
}
 +
 
 +
}
 +
</pre>

Revision as of 10:03, 16 June 2014

This tutorial is brought to you by Jan Thielemann from evenos GmbH (www.evenos-consulting.de). If you have questions, criticism or improvement suggestions, feel free to visit me (Jan.thielemann) or write me an email

Goal of this tutorial

The goal of this tutorial is to show you how you can use the IUserPanelMenuFactory service in you plug-in project. The reason why you might want to use this service is to provide additional menu entries in the WebUI (besides Feedback, Preference, Change Role and Log Out).


Prerequisites

Before you start this tutorial, you should take a look at the follwing tutorials:

Also if not already integreated into the trunk, you need to install the provided patch from https://idempiere.atlassian.net/browse/IDEMPIERE-2000

The workflow

The first thing you want to do is to create a Plug-In. If you already have a Plug-In and just want to add the MenuFactory there, thats also ok. To create a new Plug-In you select the Eclipse-Menu File>New>Other... Here you go to the "Plug-in Development" section and chose Plug-in Project. Chose a name and a location, make sure the OSGi framework is Equinox and click on next. Chose your name and the execution environment and click on finish.

The second step is to create a class which implements the IUserPanelMenuFactory interface. To do this, create a package of your choice and create a new class in there:

Menu1.png

package org.evenos.menutest;

import org.adempiere.webui.panel.IUserPanelMenuFactory;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;

public class MenuFactory implements IUserPanelMenuFactory {

	@Override
	public void onEvent(Event event) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public String[] getMenus() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setComponent(Component component) {
		// TODO Auto-generated method stub
		
	}

}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.