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
|
import eu.etaxonomy.taxeditor.model.MessagingUtils;
|
13
|
|
14
|
@SuppressWarnings("restriction")
|
15
|
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
|
16
|
|
17
|
private static final String PERSPECTIVE_ID = "eu.etaxonomy.taxeditor.test.perspective";
|
18
|
|
19
|
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
|
20
|
IWorkbenchWindowConfigurer configurer) {
|
21
|
return new ApplicationWorkbenchWindowAdvisor(configurer);
|
22
|
}
|
23
|
|
24
|
public String getInitialWindowPerspectiveId() {
|
25
|
return PERSPECTIVE_ID;
|
26
|
}
|
27
|
|
28
|
public void initialize(IWorkbenchConfigurer configurer) {
|
29
|
|
30
|
// WorkbenchAdapterBuilder.registerAdapters();
|
31
|
//
|
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",
|
37
|
// true);
|
38
|
// declareWorkbenchImage(configurer, ideBundle,
|
39
|
// IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
|
40
|
// + "cprj_obj.gif", true);
|
41
|
|
42
|
}
|
43
|
|
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);
|
49
|
}
|
50
|
|
51
|
// public IAdaptable getDefaultPageInput() {
|
52
|
// IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
53
|
// return workspace.getRoot();
|
54
|
// }
|
55
|
|
56
|
// @Override
|
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);
|
60
|
// }
|
61
|
|
62
|
}
|