1
|
package eu.etaxonomy.taxeditor.editor;
|
2
|
|
3
|
import java.net.URL;
|
4
|
|
5
|
import org.eclipse.core.runtime.IAdaptable;
|
6
|
import org.eclipse.jface.resource.ImageDescriptor;
|
7
|
import org.eclipse.ui.application.IWorkbenchConfigurer;
|
8
|
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
|
9
|
import org.eclipse.ui.application.WorkbenchAdvisor;
|
10
|
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
|
11
|
import org.osgi.framework.Bundle;
|
12
|
|
13
|
@SuppressWarnings("restriction")
|
14
|
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
|
15
|
|
16
|
private static final String PERSPECTIVE_ID = "eu.etaxonomy.taxeditor.editor.perspective";
|
17
|
|
18
|
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
|
19
|
IWorkbenchWindowConfigurer configurer) {
|
20
|
return new ApplicationWorkbenchWindowAdvisor(configurer);
|
21
|
}
|
22
|
|
23
|
public String getInitialWindowPerspectiveId() {
|
24
|
return PERSPECTIVE_ID;
|
25
|
}
|
26
|
|
27
|
public void initialize(IWorkbenchConfigurer configurer) {
|
28
|
|
29
|
// WorkbenchAdapterBuilder.registerAdapters();
|
30
|
//
|
31
|
// final String ICONS_PATH = "icons/full/";
|
32
|
// final String PATH_OBJECT = ICONS_PATH + "obj16/";
|
33
|
// Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
|
34
|
// declareWorkbenchImage(configurer, ideBundle,
|
35
|
// IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
|
36
|
// true);
|
37
|
// declareWorkbenchImage(configurer, ideBundle,
|
38
|
// IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
|
39
|
// + "cprj_obj.gif", true);
|
40
|
|
41
|
}
|
42
|
|
43
|
private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
|
44
|
Bundle ideBundle, String symbolicName, String path, boolean shared) {
|
45
|
URL url = ideBundle.getEntry(path);
|
46
|
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
|
47
|
configurer_p.declareImage(symbolicName, desc, shared);
|
48
|
}
|
49
|
|
50
|
public IAdaptable getDefaultPageInput() {
|
51
|
/** RAPSS:Removed Not using Tests
|
52
|
IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
53
|
return workspace.getRoot();
|
54
|
*/
|
55
|
return null;
|
56
|
|
57
|
}
|
58
|
}
|