Thread: [Ejtools-cvs] CVS: applications/management/src/main/net/sourceforge/ejtools/management Main.java,NON
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-22 18:00:37
|
Update of /cvsroot/ejtools/applications/management/src/main/net/sourceforge/ejtools/management In directory usw-pr-cvs1:/tmp/cvs-serv29841/management/src/main/net/sourceforge/ejtools/management Added Files: Main.java ManagementBrowser.java Log Message: Initial Import --- NEW FILE: Main.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.management; import java.io.File; import java.net.URL; import java.net.URLClassLoader; import java.security.AccessController; import java.security.Permission; import java.security.PrivilegedExceptionAction; import java.util.LinkedList; /** * Description of the Class * * @author letiembl * @created 21 mars 2002 */ public class Main { /** * The main program for the Main class * * @param args The command line arguments * @exception Exception Description of Exception */ public static void main(String[] args) throws Exception { File pluginDir = new File("../lib/ext"); LinkedList list = new LinkedList(); File[] plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { System.out.println(plugins[i].toURL()); list.add(plugins[i].toURL()); } pluginDir = new File("../lib"); plugins = pluginDir.listFiles(); for (int i = 0; i < plugins.length; i++) { System.out.println(plugins[i].toURL()); list.add(plugins[i].toURL()); } URL[] pluginURLs = (URL[]) list.toArray(new URL[list.size()]); Thread.currentThread().setContextClassLoader(new URLClassLoader(pluginURLs, Thread.currentThread().getContextClassLoader())); System.setSecurityManager( new SecurityManager() { public void checkPermission(Permission p) { } public void checkPermission(Permission perm, Object context) { } }); AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws Exception { java.beans.Beans.instantiate(Thread.currentThread().getContextClassLoader(), "net.sourceforge.ejtools.management.ManagementBrowser"); return null; } }); } } --- NEW FILE: ManagementBrowser.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.management; import java.beans.beancontext.BeanContextServicesSupport; import java.util.Vector; import javax.swing.ImageIcon; import net.sourceforge.ejtools.awt.action.Command; import net.sourceforge.ejtools.awt.action.CommandAction; import net.sourceforge.ejtools.awt.action.file.ExitAction; import net.sourceforge.ejtools.awt.action.file.NewAction; import net.sourceforge.ejtools.awt.action.file.OpenAction; import net.sourceforge.ejtools.awt.action.file.SaveAction; import net.sourceforge.ejtools.awt.action.file.SaveAsAction; import net.sourceforge.ejtools.awt.services.AboutServiceProvider; import net.sourceforge.ejtools.awt.services.FrameServiceProvider; import net.sourceforge.ejtools.awt.services.MenuBarServiceProvider; import net.sourceforge.ejtools.awt.services.StatusBarService; import net.sourceforge.ejtools.awt.services.StatusBarServiceProvider; import net.sourceforge.ejtools.awt.services.ToolBarServiceProvider; import net.sourceforge.ejtools.awt.BeanContextPanel; import net.sourceforge.ejtools.management.model.ConnectionServiceProvider; import net.sourceforge.ejtools.management.model.Server; import org.apache.log4j.Category; /** * Description of the Class * * @author letiembl * @created 21 mars 2002 */ public class ManagementBrowser extends BeanContextServicesSupport { /** Description of the Field */ protected ConnectionServiceProvider connectionProvider; AboutServiceProvider aboutService; CommandAction action = null; FrameServiceProvider frameService; MenuBarServiceProvider menuBarService; StatusBarServiceProvider statusBarService; ToolBarServiceProvider toolBarService; private static Category cat = Category.getInstance(ManagementBrowser.class.getName()); private static Vector factories; private BeanContextPanel bcPanel; /** Constructor for the EJX object */ public ManagementBrowser() { cat.debug("ManagementBrowser starting..."); connectionProvider = new ConnectionServiceProvider(); frameService = new FrameServiceProvider("SDI"); aboutService = new AboutServiceProvider(new AboutDialog()); menuBarService = new MenuBarServiceProvider(); toolBarService = new ToolBarServiceProvider(); statusBarService = new StatusBarServiceProvider(); try { add(menuBarService); // add(toolBarService); // add(statusBarService); /* * statusBarService.addZone("status"); * statusBarService.setContent("status", "Ready"); * statusBarService.addZone("hour", StatusBarService.RIGHT); * statusBarService.setContent("hour", "10:25:32", new ImageIcon(getClass().getResource("/images/container.gif"))); */ add(connectionProvider); Server server = new Server(); add(server); bcPanel = new BeanContextPanel(server); frameService.setContent(bcPanel); add(new ExitAction( new Command() { public void execute() { System.exit(0); } } )); add(frameService); add(aboutService); } catch (RuntimeException e) { cat.warn("Error occured " + e.getMessage()); e.printStackTrace(); throw e; } } } |