Project

General

Profile

Download (3.02 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.taxeditor;
2

    
3
import org.eclipse.ui.PlatformUI;
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
/**
10
 * <p>ApplicationWorkbenchAdvisor class.</p>
11
 *
12
 * @author n.hoffmann
13
 * @version $Id: $
14
 */
15
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
16

    
17
	private static final String PERSPECTIVE_ID = Perspective.ID;
18

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

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

    
101
	
102

    
103
}
(4-4/13)