had to rename the packages to make them compliant with buckminster
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / test / java / eu / etaxonomy / taxeditor / navigation / ApplicationWorkbenchAdvisor.java
1 package eu.etaxonomy.taxeditor.navigation;
2
3 import java.net.URL;
4
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;
11
12 @SuppressWarnings("restriction")
13 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
14
15 private static final String PERSPECTIVE_ID = "eu.etaxonomy.taxeditor.test.perspective";
16
17 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
18 IWorkbenchWindowConfigurer configurer) {
19 return new ApplicationWorkbenchWindowAdvisor(configurer);
20 }
21
22 public String getInitialWindowPerspectiveId() {
23 return PERSPECTIVE_ID;
24 }
25
26 public void initialize(IWorkbenchConfigurer configurer) {
27
28 // WorkbenchAdapterBuilder.registerAdapters();
29 //
30 // final String ICONS_PATH = "icons/full/";
31 // final String PATH_OBJECT = ICONS_PATH + "obj16/";
32 // Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
33 // declareWorkbenchImage(configurer, ideBundle,
34 // IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
35 // true);
36 // declareWorkbenchImage(configurer, ideBundle,
37 // IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
38 // + "cprj_obj.gif", true);
39
40 }
41
42 private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
43 Bundle ideBundle, String symbolicName, String path, boolean shared) {
44 URL url = ideBundle.getEntry(path);
45 ImageDescriptor desc = ImageDescriptor.createFromURL(url);
46 configurer_p.declareImage(symbolicName, desc, shared);
47 }
48
49 // public IAdaptable getDefaultPageInput() {
50 // IWorkspace workspace = ResourcesPlugin.getWorkspace();
51 // return workspace.getRoot();
52 // }
53
54 }