1 package eu
.etaxonomy
.taxeditor
.navigation
;
5 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
6 import org
.eclipse
.ui
.application
.IWorkbenchConfigurer
;
7 import org
.eclipse
.ui
.application
.IWorkbenchWindowConfigurer
;
8 import org
.eclipse
.ui
.application
.WorkbenchAdvisor
;
9 import org
.eclipse
.ui
.application
.WorkbenchWindowAdvisor
;
10 import org
.osgi
.framework
.Bundle
;
12 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
14 @SuppressWarnings("restriction")
15 public class ApplicationWorkbenchAdvisor
extends WorkbenchAdvisor
{
17 private static final String PERSPECTIVE_ID
= "eu.etaxonomy.taxeditor.test.perspective";
19 public WorkbenchWindowAdvisor
createWorkbenchWindowAdvisor(
20 IWorkbenchWindowConfigurer configurer
) {
21 return new ApplicationWorkbenchWindowAdvisor(configurer
);
24 public String
getInitialWindowPerspectiveId() {
25 return PERSPECTIVE_ID
;
28 public void initialize(IWorkbenchConfigurer configurer
) {
30 // WorkbenchAdapterBuilder.registerAdapters();
32 // final String ICONS_PATH = "icons/full/";
33 // final String PATH_OBJECT = ICONS_PATH + "obj16/";
34 // Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
35 // declareWorkbenchImage(configurer, ideBundle,
36 // IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
38 // declareWorkbenchImage(configurer, ideBundle,
39 // IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
40 // + "cprj_obj.gif", true);
44 private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p
,
45 Bundle ideBundle
, String symbolicName
, String path
, boolean shared
) {
46 URL url
= ideBundle
.getEntry(path
);
47 ImageDescriptor desc
= ImageDescriptor
.createFromURL(url
);
48 configurer_p
.declareImage(symbolicName
, desc
, shared
);
51 // public IAdaptable getDefaultPageInput() {
52 // IWorkspace workspace = ResourcesPlugin.getWorkspace();
53 // return workspace.getRoot();
57 // public void eventLoopException(Throwable exception) {
58 // super.eventLoopException(exception);
59 // MessagingUtils.messageDialog("Unexpected Errorr", "Please contact EDIT Support and provide contents of the trace log", null , exception);