Project

General

Profile

Download (3.21 KB) Statistics
| Branch: | Tag: | Revision:
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.editor.singlesource.name.container.NameViewerFacade;
10
import eu.etaxonomy.taxeditor.store.singlesource.widget.DisplayProxy;
11

    
12

    
13
/**
14
 * <p>ApplicationWorkbenchAdvisor class.</p>
15
 *
16
 * @author n.hoffmann
17
 * @version $Id: $
18
 */
19
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
20

    
21
	/*
22
	 * (non-Javadoc)
23
	 * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
24
	 */
25
	/** {@inheritDoc} */
26
	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
27
			IWorkbenchWindowConfigurer configurer) {
28
		return new ApplicationWorkbenchWindowAdvisor(configurer);
29
	}
30

    
31
	
32
	/*
33
	 * (non-Javadoc)
34
	 * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
35
	 */
36
	/**
37
	 * <p>getInitialWindowPerspectiveId</p>
38
	 *
39
	 * @return a {@link java.lang.String} object.
40
	 */
41
	public String getInitialWindowPerspectiveId() {
42
		return "eu.etaxonomy.taxeditor.application.perspective.taxonomic";
43
	}
44
	
45
	/*
46
	 * (non-Javadoc)
47
	 * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
48
	 */
49
	/** {@inheritDoc} */
50
	public void initialize(IWorkbenchConfigurer configurer) {
51
		super.initialize(configurer);
52
				
53
		// Remembers the user's view layout, window size, window location etc.
54
		//  for the next time application is started
55
		configurer.setSaveAndRestore(true);
56
		
57
		DisplayProxy.setDefault(Display.getDefault());
58
	}	
59
	
60
	/* (non-Javadoc)
61
	 * @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup()
62
	 */
63
	/** {@inheritDoc} */
64
	@Override
65
	public void preStartup() {
66
		// TODO Auto-generated method stub
67
		super.preStartup();
68
		// XXX check for updates before starting up.
69
    	// If an update is performed, restart.
70
//    	if (P2Util.checkForUpdates())
71
//    		PlatformUI.getWorkbench().restart();
72
	}
73
	
74
/**
75
 * see:	https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252
76
 */
77
//	public void initialize(IWorkbenchConfigurer configurer) {
78
//
79
//		WorkbenchAdapterBuilder.registerAdapters();
80
//
81
//		final String ICONS_PATH = "icons/full/";
82
//		final String PATH_OBJECT = ICONS_PATH + "obj16/";
83
//		Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
84
//		declareWorkbenchImage(configurer, ideBundle,
85
//				IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
86
//				true);
87
//		declareWorkbenchImage(configurer, ideBundle,
88
//				IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
89
//						+ "cprj_obj.gif", true);
90
//
91
//	}
92
//
93
//	private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
94
//			Bundle ideBundle, String symbolicName, String path, boolean shared) {
95
//		URL url = ideBundle.getEntry(path);
96
//		ImageDescriptor desc = ImageDescriptor.createFromURL(url);
97
//		configurer_p.declareImage(symbolicName, desc, shared);
98
//	}
99
//
100
//	public IAdaptable getDefaultPageInput() {
101
//		IWorkspace workspace = ResourcesPlugin.getWorkspace();
102
//		return workspace.getRoot();
103
//	}
104

    
105
	
106

    
107
}
(4-4/12)