1 package eu
.etaxonomy
.taxeditor
.editor
;
5 import org
.eclipse
.core
.resources
.IWorkspace
;
6 import org
.eclipse
.core
.resources
.ResourcesPlugin
;
7 import org
.eclipse
.core
.runtime
.IAdaptable
;
8 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
9 import org
.eclipse
.ui
.application
.IWorkbenchConfigurer
;
10 import org
.eclipse
.ui
.application
.IWorkbenchWindowConfigurer
;
11 import org
.eclipse
.ui
.application
.WorkbenchAdvisor
;
12 import org
.eclipse
.ui
.application
.WorkbenchWindowAdvisor
;
13 import org
.osgi
.framework
.Bundle
;
15 @SuppressWarnings("restriction")
16 public class ApplicationWorkbenchAdvisor
extends WorkbenchAdvisor
{
18 private static final String PERSPECTIVE_ID
= "eu.etaxonomy.taxeditor.editor.perspective";
20 public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(
21 IWorkbenchWindowConfigurer configurer
) {
22 return new ApplicationWorkbenchWindowAdvisor(configurer
);
25 public String
getInitialWindowPerspectiveId() {
26 return PERSPECTIVE_ID
;
29 public void initialize(IWorkbenchConfigurer configurer
) {
31 // WorkbenchAdapterBuilder.registerAdapters();
33 // final String ICONS_PATH = "icons/full/";
34 // final String PATH_OBJECT = ICONS_PATH + "obj16/";
35 // Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
36 // declareWorkbenchImage(configurer, ideBundle,
37 // IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
39 // declareWorkbenchImage(configurer, ideBundle,
40 // IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
41 // + "cprj_obj.gif", true);
45 private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p
,
46 Bundle ideBundle
, String symbolicName
, String path
, boolean shared
) {
47 URL url
= ideBundle
.getEntry(path
);
48 ImageDescriptor desc
= ImageDescriptor
.createFromURL(url
);
49 configurer_p
.declareImage(symbolicName
, desc
, shared
);
52 public IAdaptable
getDefaultPageInput() {
53 IWorkspace workspace
= ResourcesPlugin
.getWorkspace();
54 return workspace
.getRoot();