From commits-return-18512-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Fri Jun 06 09:45:32 2008 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 96342 invoked from network); 6 Jun 2008 09:45:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jun 2008 09:45:32 -0000 Received: (qmail 65664 invoked by uid 500); 6 Jun 2008 09:45:35 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 65603 invoked by uid 500); 6 Jun 2008 09:45:35 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 65594 invoked by uid 99); 6 Jun 2008 09:45:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2008 02:45:35 -0700 X-ASF-Spam-Status: No, hits=-1998.0 required=10.0 tests=ALL_TRUSTED,URIBL_BLACK X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2008 09:44:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DDC3F23889C2; Fri, 6 Jun 2008 02:45:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r663873 - in /directory/studio/trunk/rcp: pom.xml src/main/java/org/apache/directory/studio/Application.java Date: Fri, 06 Jun 2008 09:45:03 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080606094503.DDC3F23889C2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pamarcelot Date: Fri Jun 6 02:45:03 2008 New Revision: 663873 URL: http://svn.apache.org/viewvc?rev=663873&view=rev Log: The Application class now implements the IApplication interface since the IPlatformRunnable interface is deprecated. Modified: directory/studio/trunk/rcp/pom.xml directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Application.java Modified: directory/studio/trunk/rcp/pom.xml URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/pom.xml?rev=663873&r1=663872&r2=663873&view=diff ============================================================================== --- directory/studio/trunk/rcp/pom.xml (original) +++ directory/studio/trunk/rcp/pom.xml Fri Jun 6 02:45:03 2008 @@ -180,6 +180,11 @@ filesystem provided + + org.eclipse.equinox + app + provided + Modified: directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Application.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Application.java?rev=663873&r1=663872&r2=663873&view=diff ============================================================================== --- directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Application.java (original) +++ directory/studio/trunk/rcp/src/main/java/org/apache/directory/studio/Application.java Fri Jun 6 02:45:03 2008 @@ -23,9 +23,11 @@ import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; -import org.eclipse.core.runtime.IPlatformRunnable; import org.eclipse.core.runtime.Platform; +import org.eclipse.equinox.app.IApplication; +import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; @@ -35,33 +37,36 @@ * @author Apache Directory Project * @version $Rev$, $Date$ */ -public class Application implements IPlatformRunnable +public class Application implements IApplication { - + /** The plugin ID */ public static final String PLUGIN_ID = "org.apache.directory.studio.rcp"; //$NON-NLS-1$ + + /** The logger*/ private static Logger logger = Logger.getLogger( Application.class ); /* (non-Javadoc) - * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object) + * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext) */ - public Object run( Object args ) throws Exception + public Object start( IApplicationContext context ) throws Exception { - //Set up a simple configuration that logs on the console. + // Set up a simple configuration that logs on the console. PropertyConfigurator.configure( Platform.getBundle( Application.PLUGIN_ID ).getResource( "log4j.conf" ) ); //$NON-NLS-1$ logger.info( "Entering Apache Directory Studio." ); //$NON-NLS-1$ Display display = PlatformUI.createDisplay(); - + try { int returnCode = PlatformUI.createAndRunWorkbench( display, new ApplicationWorkbenchAdvisor() ); - if ( returnCode == PlatformUI.RETURN_RESTART ) { - return IPlatformRunnable.EXIT_RESTART; + return IApplication.EXIT_RESTART; + } + else + { + return IApplication.EXIT_OK; } - - return IPlatformRunnable.EXIT_OK; } finally { @@ -69,4 +74,28 @@ logger.info( "Exiting Apache Directory Studio." ); //$NON-NLS-1$ } } + + + /* (non-Javadoc) + * @see org.eclipse.equinox.app.IApplication#stop() + */ + public void stop() + { + final IWorkbench workbench = PlatformUI.getWorkbench(); + if ( workbench == null ) + { + return; + } + final Display display = workbench.getDisplay(); + display.syncExec( new Runnable() + { + public void run() + { + if ( !display.isDisposed() ) + { + workbench.close(); + } + } + } ); + } }