01: /*******************************************************************************
02: * Copyright (c) 2003, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.examples.rcp.browser;
11:
12: import org.eclipse.ui.application.IWorkbenchConfigurer;
13: import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
14: import org.eclipse.ui.application.WorkbenchAdvisor;
15: import org.eclipse.ui.application.WorkbenchWindowAdvisor;
16:
17: /**
18: * The workbench advisor for the browser example.
19: * Configures the workbench as needed for the browser example, including
20: * specifying the default perspective id.
21: * Creates the workbench window advisor for configuring each new window
22: * as it is being opened.
23: *
24: * @since 3.0
25: */
26: public class BrowserAdvisor extends WorkbenchAdvisor {
27:
28: /**
29: * Constructs a new <code>BrowserAdvisor</code>.
30: */
31: public BrowserAdvisor() {
32: // do nothing
33: }
34:
35: /* (non-Javadoc)
36: * @see org.eclipse.ui.application.WorkbenchAdvisor
37: */
38: public void initialize(IWorkbenchConfigurer configurer) {
39: super .initialize(configurer);
40: // configurer.setSaveAndRestore(true);
41: }
42:
43: /* (non-Javadoc)
44: * @see org.eclipse.ui.application.WorkbenchAdvisor
45: */
46: public String getInitialWindowPerspectiveId() {
47: return IBrowserConstants.BROWSER_PERSPECTIVE_ID;
48: }
49:
50: /* (non-Javadoc)
51: * @see org.eclipse.ui.application.WorkbenchAdvisor
52: */
53: public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
54: IWorkbenchWindowConfigurer configurer) {
55: return new BrowserWindowAdvisor(configurer);
56: }
57: }
|