1 20 21 package org.apache.directory.ldapstudio; 22 23 24 import org.apache.log4j.Logger; 25 import org.apache.log4j.PropertyConfigurator; 26 import org.eclipse.core.runtime.IPlatformRunnable; 27 import org.eclipse.core.runtime.Platform; 28 import org.eclipse.swt.widgets.Display; 29 import org.eclipse.ui.PlatformUI; 30 31 32 38 public class Application implements IPlatformRunnable 39 { 40 41 public static final String PLUGIN_ID = "org.apache.directory.ldapstudio"; private static Logger logger = Logger.getLogger( Application.class ); 43 44 45 48 public Object run( Object args ) throws Exception  49 { 50 PropertyConfigurator.configure( Platform.getBundle( Application.PLUGIN_ID ).getResource( "log4j.conf" ) ); logger.info( "Entering LDAP Studio." ); Display display = PlatformUI.createDisplay(); 54 55 try 56 { 57 int returnCode = PlatformUI.createAndRunWorkbench( display, new ApplicationWorkbenchAdvisor() ); 58 59 if ( returnCode == PlatformUI.RETURN_RESTART ) 60 { 61 return IPlatformRunnable.EXIT_RESTART; 62 } 63 64 return IPlatformRunnable.EXIT_OK; 65 } 66 finally 67 { 68 display.dispose(); 69 logger.info( "Exiting LDAP Studio." ); } 71 } 72 } 73 | Popular Tags |