Starting up Compiere forms and windows from java main method

For those who got the Open Source fever, sharing only makes you hot!

Moderator: neilg

Starting up Compiere forms and windows from java main method

Postby neilg » Fri Jul 15, 2005 6:25 pm

This can be a timesaver in terms of development.

Open up a form:

Code: Select all
public static void main(String[] args)
{
      Compiere.startupClient();
      Env.setContext(Env.getCtx(), "#AD_Client_ID", 1000000);
      Env.setContext(Env.getCtx(), "#AD_Org_ID", 0);

      FormFrame frame1 = new FormFrame();
      frame1.openForm(1000001);
      //frame1.setSize(800, 600);
      frame1.show();
   }
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm

Postby red1 » Sat Jul 16, 2005 1:07 am

Pls explain :roll:
red1
Site Admin
 
Posts: 2762
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby neilg » Sun Jul 17, 2005 6:21 pm

The idea is that instead of opening Compiere eveyrtime (Run Compiere from eclipse, then open your form, etc) which takes some time. Instead you put the main method mentioned above into the class which you are developing (or even another class depending how you want to structure it) and it starts up Compiere without you having to login, select the org, and open the form. (You create a new Run profile in Eclipse for that specific class).

There is also code for windows and processes but I still have to dig them out of the source code.

Is there maybe a better way of doing this?
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm


Return to Contributor's Corner

Who is online

Users browsing this forum: No registered users and 0 guests

cron