This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

--Programatically Application setup

Information about development with ProjX.

--Programatically Application setup

Postby Development@SIB » Wed Apr 10, 2013 6:08 pm



This article is outdated - please use our new system at

https://doc.sibvisions.com




If you want to change the default configuration of your client application, e.g. a different Menu, no ToolBar, a fancy background image, ... you could use application.xml and set specific parameters or you could implement your own application behaviour. It's enough to set the application parameter:

Code: Select all
Application.setup.classname

to e.g. com.sibvisions.apps.myerp.ERPApplicationSetup

The implementation could be:

Code: Select all
public class ERPApplicationSetup implements IApplicationSetup
{
   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   // Interface implementation
   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   @Override
   public void apply(IApplication pApplication)
   {
      ILauncher pLauncher = pApplication.getLauncher();
      
      pLauncher.setParameter(ProjX.PARAM_LOGIN_CLASS, ERPLogin.class.getName());
      pLauncher.setParameter(ProjX.PARAM_MENU_CLASS, ERPMenu.class.getName());
      
      //never
      pLauncher.setParameter(ProjX.PARAM_LOGIN_USERNAME, null);
      pLauncher.setParameter(ProjX.PARAM_LOGIN_PASSWORD, null);

      pLauncher.setParameter(ProjX.PARAM_AUTHENTICATOR,
                             ERPAuthenticator.class.getName());
      
      //always direct!
      pLauncher.setParameter(ProjX.PARAM_CONNECTIONCLASS,
                             DirectServerConnection.class.getName());
      
      //login immediate!
      ((ProjX)pApplication).setUseLoginThread(false);
   }
}

The advantage of an implementation of IApplicationSetup is that you have access to the application instance before it was fully initialized. You can add listeners and directly call methods of the application, if needed.
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Return to Documentation