1 package eu
.etaxonomy
.taxeditor
;
3 import org
.eclipse
.swt
.graphics
.Point
;
4 import org
.eclipse
.swt
.widgets
.Shell
;
5 import org
.eclipse
.ui
.application
.ActionBarAdvisor
;
6 import org
.eclipse
.ui
.application
.IActionBarConfigurer
;
7 import org
.eclipse
.ui
.application
.IWorkbenchWindowConfigurer
;
8 import org
.eclipse
.ui
.application
.WorkbenchWindowAdvisor
;
10 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
11 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
12 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
13 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
14 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.LoginDialog
;
15 import eu
.etaxonomy
.taxeditor
.update
.P2Util
;
18 * <p>ApplicationWorkbenchWindowAdvisor class.</p>
23 public class ApplicationWorkbenchWindowAdvisor
extends WorkbenchWindowAdvisor
{
26 * <p>Constructor for ApplicationWorkbenchWindowAdvisor.</p>
28 * @param configurer a {@link org.eclipse.ui.application.IWorkbenchWindowConfigurer} object.
30 public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer
) {
36 public ActionBarAdvisor
createActionBarAdvisor(
37 IActionBarConfigurer configurer
) {
38 return new ApplicationActionBarAdvisor(configurer
);
42 * <p>preWindowOpen</p>
45 public void preWindowOpen() {
46 IWorkbenchWindowConfigurer configurer
= getWindowConfigurer();
47 configurer
.setInitialSize(new Point(963, 637));
48 configurer
.setShowCoolBar(true);
49 configurer
.setShowStatusLine(true);
50 configurer
.setShowPerspectiveBar(true);
51 configurer
.setTitle("EDIT Taxonomic Editor " + ApplicationUtil
.getVersion());
52 configurer
.setShowProgressIndicator(true);
56 * <p>postWindowOpen</p>
59 public void postWindowOpen() {
60 PreferencesUtil
.checkNomenclaturalCode();
62 if(PreferencesUtil
.shouldConnectAtStartUp()) {
68 if(PreferencesUtil
.getPreferenceStore().getBoolean(IPreferenceKeys
.ALLOW_AUTO_UPDATE_AT_STARTUP
)) {
69 P2Util
.checkForUpdates();
71 } catch (Exception e
) {
72 MessagingUtils
.error(this.getClass(), e
);
76 private int authenticate(){
77 Shell shell
= TaxonomicEditorPlugin
.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
79 LoginDialog loginDialog
= new LoginDialog(shell
);
80 return loginDialog
.open();