Project

General

Profile

Download (3.31 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.singlesource.editor.name.container.NameViewerFacade;
10
import eu.etaxonomy.taxeditor.singlesource.org.eclipse.swt.widgets.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
		/** RAPSS:Include Must be called here to initialise SessionBased Display Singleton
58
		 */
59
		DisplayProxy.setDefault(Display.getDefault());
60
	}	
61
	
62
	/* (non-Javadoc)
63
	 * @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup()
64
	 */
65
	/** {@inheritDoc} */
66
	@Override
67
	public void preStartup() {
68
		// TODO Auto-generated method stub
69
		super.preStartup();
70
		// XXX check for updates before starting up.
71
    	// If an update is performed, restart.
72
//    	if (P2Util.checkForUpdates())
73
//    		PlatformUI.getWorkbench().restart();
74
	}
75
	
76
/**
77
 * see:	https://bugs.eclipse.org/bugs/show_bug.cgi?id=234252
78
 */
79
//	public void initialize(IWorkbenchConfigurer configurer) {
80
//
81
//		WorkbenchAdapterBuilder.registerAdapters();
82
//
83
//		final String ICONS_PATH = "icons/full/";
84
//		final String PATH_OBJECT = ICONS_PATH + "obj16/";
85
//		Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
86
//		declareWorkbenchImage(configurer, ideBundle,
87
//				IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif",
88
//				true);
89
//		declareWorkbenchImage(configurer, ideBundle,
90
//				IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT
91
//						+ "cprj_obj.gif", true);
92
//
93
//	}
94
//
95
//	private void declareWorkbenchImage(IWorkbenchConfigurer configurer_p,
96
//			Bundle ideBundle, String symbolicName, String path, boolean shared) {
97
//		URL url = ideBundle.getEntry(path);
98
//		ImageDescriptor desc = ImageDescriptor.createFromURL(url);
99
//		configurer_p.declareImage(symbolicName, desc, shared);
100
//	}
101
//
102
//	public IAdaptable getDefaultPageInput() {
103
//		IWorkspace workspace = ResourcesPlugin.getWorkspace();
104
//		return workspace.getRoot();
105
//	}
106

    
107
	
108

    
109
}
(4-4/11)