12b1369b41c712bf1f043ab685a867d76ef06035
[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 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
9
10 private static final String PERSPECTIVE_ID = Perspective.ID;
11
12 /*
13 * (non-Javadoc)
14 * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
15 */
16 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
17 IWorkbenchWindowConfigurer configurer) {
18 return new ApplicationWorkbenchWindowAdvisor(configurer);
19 }
20
21
22 /*
23 * (non-Javadoc)
24 * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
25 */
26 public String getInitialWindowPerspectiveId() {
27 return PERSPECTIVE_ID;
28 }
29
30 /*
31 * (non-Javadoc)
32 * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
33 */
34 public void initialize(IWorkbenchConfigurer configurer) {
35 super.initialize(configurer);
36
37 // Remembers the user's view layout, window size, window location etc.
38 // for the next time application is started
39 configurer.setSaveAndRestore(true);
40 }
41
42 /**
43 * see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252
44 */
45 // public void initialize(IWorkbenchConfigurer configurer) {
46 //
47 // WorkbenchAdapterBuilder.registerAdapters();
48 //
49 // final String ICONS_PATH = "icons/full/";
50 // final String PATH_OBJECT = ICONS_PATH + "obj16/";
51 // Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
52 // declareWorkbenchImage(configurer, ideBundle,
53 // IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
54 // true);
55 // declareWorkbenchImage(configurer, ideBundle,
56 // IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
57 // + "cprj_obj.gif", true);
58 //
59 // }
60 //
61 // private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
62 // Bundle ideBundle, String symbolicName, String path, boolean shared) {
63 // URL url = ideBundle.getEntry(path);
64 // ImageDescriptor desc = ImageDescriptor.createFromURL(url);
65 // configurer_p.declareImage(symbolicName, desc, shared);
66 // }
67 //
68 // public IAdaptable getDefaultPageInput() {
69 // IWorkspace workspace = ResourcesPlugin.getWorkspace();
70 // return workspace.getRoot();
71 // }
72
73
74
75 }