KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dolphin > rcp > DolphinApplication


1 /*
2 * Copyright (C) 2005 Bourgeon Jérôme, Macherel Bruno
3 *
4 * This file is part of Dolphin
5 *
6 * Dolphin : An open source J2EE Deployment Tool JSR-88 compliant
7 * Contact: ishmael-dev@objectweb.org
8 *
9 * Dolphin is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or any later version.
13 *
14 * Dolphin is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with Dolphin; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */

24 package org.objectweb.dolphin.rcp;
25
26 import org.eclipse.core.runtime.IPlatformRunnable;
27 import org.eclipse.swt.widgets.Display;
28 import org.eclipse.ui.PlatformUI;
29 import org.eclipse.ui.application.WorkbenchAdvisor;
30 import org.objectweb.dolphin.resources.DolphinResourcesManagment;
31
32 /**
33  * Main class of Dolphin
34  * @author Bourgeon Jérôme, Macherel Bruno
35  */

36 public class DolphinApplication implements IPlatformRunnable {
37
38     /**
39      * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
40      */

41     public Object JavaDoc run(Object JavaDoc args) {
42
43         // create the workspace & file useful
44
DolphinResourcesManagment.createConfiguration();
45
46         WorkbenchAdvisor workbenchAdvisor = new DolphinWorkbenchAdvisor();
47         Display display = PlatformUI.createDisplay();
48         try {
49             int returnCode = PlatformUI.createAndRunWorkbench(display,
50                     workbenchAdvisor);
51             if (returnCode == PlatformUI.RETURN_RESTART) {
52                 return IPlatformRunnable.EXIT_RESTART;
53             }
54             return IPlatformRunnable.EXIT_OK;
55         } finally {
56             display.dispose();
57         }
58     }
59 }
Popular Tags