automated build configuration is on its way
[taxeditor.git] / taxeditor-application / src / main / java / eu / etaxonomy / taxeditor / ApplicationWorkbenchAdvisor.java
1 package eu.etaxonomy.taxeditor;
2
3 import org.eclipse.ui.application.IWorkbenchConfigurer;
4 import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
5 import org.eclipse.ui.application.WorkbenchAdvisor;
6 import org.eclipse.ui.application.WorkbenchWindowAdvisor;
7
8
9 /**
10 * <p>ApplicationWorkbenchAdvisor class.</p>
11 *
12 * @author n.hoffmann
13 * @version $Id: $
14 */
15 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
16
17 /*
18 * (non-Javadoc)
19 * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
20 */
21 /** {@inheritDoc} */
22 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
23 IWorkbenchWindowConfigurer configurer) {
24 return new ApplicationWorkbenchWindowAdvisor(configurer);
25 }
26
27
28 /*
29 * (non-Javadoc)
30 * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
31 */
32 /**
33 * <p>getInitialWindowPerspectiveId</p>
34 *
35 * @return a {@link java.lang.String} object.
36 */
37 public String getInitialWindowPerspectiveId() {
38 return "eu.etaxonomy.taxeditor.application.perspective.taxonomic";
39 }
40
41 /*
42 * (non-Javadoc)
43 * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
44 */
45 /** {@inheritDoc} */
46 public void initialize(IWorkbenchConfigurer configurer) {
47 super.initialize(configurer);
48
49 // Remembers the user's view layout, window size, window location etc.
50 // for the next time application is started
51 configurer.setSaveAndRestore(true);
52 }
53
54 /* (non-Javadoc)
55 * @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup()
56 */
57 /** {@inheritDoc} */
58 @Override
59 public void preStartup() {
60 // TODO Auto-generated method stub
61 super.preStartup();
62 // XXX check for updates before starting up.
63 // If an update is performed, restart.
64 // if (P2Util.checkForUpdates())
65 // PlatformUI.getWorkbench().restart();
66 }
67
68 /**
69 * see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252
70 */
71 // public void initialize(IWorkbenchConfigurer configurer) {
72 //
73 // WorkbenchAdapterBuilder.registerAdapters();
74 //
75 // final String ICONS_PATH = "icons/full/";
76 // final String PATH_OBJECT = ICONS_PATH + "obj16/";
77 // Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
78 // declareWorkbenchImage(configurer, ideBundle,
79 // IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
80 // true);
81 // declareWorkbenchImage(configurer, ideBundle,
82 // IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
83 // + "cprj_obj.gif", true);
84 //
85 // }
86 //
87 // private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
88 // Bundle ideBundle, String symbolicName, String path, boolean shared) {
89 // URL url = ideBundle.getEntry(path);
90 // ImageDescriptor desc = ImageDescriptor.createFromURL(url);
91 // configurer_p.declareImage(symbolicName, desc, shared);
92 // }
93 //
94 // public IAdaptable getDefaultPageInput() {
95 // IWorkspace workspace = ResourcesPlugin.getWorkspace();
96 // return workspace.getRoot();
97 // }
98
99
100
101 }