1
|
package eu.etaxonomy.taxeditor;
|
2
|
|
3
|
import org.eclipse.swt.widgets.Display;
|
4
|
import org.eclipse.ui.application.IWorkbenchConfigurer;
|
5
|
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
|
6
|
import org.eclipse.ui.application.WorkbenchAdvisor;
|
7
|
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
|
8
|
|
9
|
import eu.etaxonomy.taxeditor.store.singlesource.widget.DisplayProxy;
|
10
|
|
11
|
|
12
|
/**
|
13
|
* <p>ApplicationWorkbenchAdvisor class.</p>
|
14
|
*
|
15
|
* @author n.hoffmann
|
16
|
* @version $Id: $
|
17
|
*/
|
18
|
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
|
19
|
|
20
|
/*
|
21
|
* (non-Javadoc)
|
22
|
* @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
|
23
|
*/
|
24
|
/** {@inheritDoc} */
|
25
|
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
|
26
|
IWorkbenchWindowConfigurer configurer) {
|
27
|
return new ApplicationWorkbenchWindowAdvisor(configurer);
|
28
|
}
|
29
|
|
30
|
|
31
|
/*
|
32
|
* (non-Javadoc)
|
33
|
* @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
|
34
|
*/
|
35
|
/**
|
36
|
* <p>getInitialWindowPerspectiveId</p>
|
37
|
*
|
38
|
* @return a {@link java.lang.String} object.
|
39
|
*/
|
40
|
public String getInitialWindowPerspectiveId() {
|
41
|
return "eu.etaxonomy.taxeditor.application.perspective.taxonomic";
|
42
|
}
|
43
|
|
44
|
/*
|
45
|
* (non-Javadoc)
|
46
|
* @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
|
47
|
*/
|
48
|
/** {@inheritDoc} */
|
49
|
public void initialize(IWorkbenchConfigurer configurer) {
|
50
|
super.initialize(configurer);
|
51
|
|
52
|
// Remembers the user's view layout, window size, window location etc.
|
53
|
// for the next time application is started
|
54
|
configurer.setSaveAndRestore(true);
|
55
|
|
56
|
DisplayProxy.setDefault(Display.getDefault());
|
57
|
}
|
58
|
|
59
|
/* (non-Javadoc)
|
60
|
* @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup()
|
61
|
*/
|
62
|
/** {@inheritDoc} */
|
63
|
@Override
|
64
|
public void preStartup() {
|
65
|
// TODO Auto-generated method stub
|
66
|
super.preStartup();
|
67
|
// XXX check for updates before starting up.
|
68
|
// If an update is performed, restart.
|
69
|
// if (P2Util.checkForUpdates())
|
70
|
// PlatformUI.getWorkbench().restart();
|
71
|
}
|
72
|
|
73
|
/**
|
74
|
* see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252
|
75
|
*/
|
76
|
// public void initialize(IWorkbenchConfigurer configurer) {
|
77
|
//
|
78
|
// WorkbenchAdapterBuilder.registerAdapters();
|
79
|
//
|
80
|
// final String ICONS_PATH = "icons/full/";
|
81
|
// final String PATH_OBJECT = ICONS_PATH + "obj16/";
|
82
|
// Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
|
83
|
// declareWorkbenchImage(configurer, ideBundle,
|
84
|
// IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
|
85
|
// true);
|
86
|
// declareWorkbenchImage(configurer, ideBundle,
|
87
|
// IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
|
88
|
// + "cprj_obj.gif", true);
|
89
|
//
|
90
|
// }
|
91
|
//
|
92
|
// private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
|
93
|
// Bundle ideBundle, String symbolicName, String path, boolean shared) {
|
94
|
// URL url = ideBundle.getEntry(path);
|
95
|
// ImageDescriptor desc = ImageDescriptor.createFromURL(url);
|
96
|
// configurer_p.declareImage(symbolicName, desc, shared);
|
97
|
// }
|
98
|
//
|
99
|
// public IAdaptable getDefaultPageInput() {
|
100
|
// IWorkspace workspace = ResourcesPlugin.getWorkspace();
|
101
|
// return workspace.getRoot();
|
102
|
// }
|
103
|
|
104
|
|
105
|
|
106
|
}
|