View | Details | Raw Unified | Return to bug 74073 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.properties (+2 lines)
Lines 284-289 Link Here
284
context.window.description = A window is open
284
context.window.description = A window is open
285
context.actionSet.name = Action Set
285
context.actionSet.name = Action Set
286
context.actionSet.description = Parent context for action sets
286
context.actionSet.description = Parent context for action sets
287
context.workbench.name = Workbench
288
context.workbench.description = In Workbench
287
289
288
keyConfiguration.default.description = Default Key Configuration
290
keyConfiguration.default.description = Default Key Configuration
289
keyConfiguration.default.name = Default
291
keyConfiguration.default.name = Default
(-)plugin.xml (+5 lines)
Lines 94-99 Link Here
94
            id="org.eclipse.ui.contexts.actionSet"
94
            id="org.eclipse.ui.contexts.actionSet"
95
            name="%context.actionSet.name">
95
            name="%context.actionSet.name">
96
      </context>
96
      </context>
97
      <context
98
            description="%context.workbench.description"
99
            id="org.eclipse.ui.contexts.workbench"
100
            name="%context.workbench.name">
101
      </context>
97
   </extension>
102
   </extension>
98
   
103
   
99
   <extension point="org.eclipse.ui.bindings">
104
   <extension point="org.eclipse.ui.bindings">
(-)Eclipse JFace Tests/org/eclipse/ui/tests/RCPSessionApplication.java (-2 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2008, 2009 IBM Corporation and others.
2
 * Copyright (c) 2008, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 19-28 Link Here
19
19
20
public class RCPSessionApplication implements IApplication {
20
public class RCPSessionApplication implements IApplication {
21
	
21
	
22
	private boolean windowlessApp = false;
23
	
22
	public Object start(IApplicationContext context) throws Exception {
24
	public Object start(IApplicationContext context) throws Exception {
23
		Display display = PlatformUI.createDisplay();
25
		Display display = PlatformUI.createDisplay();
24
		try {
26
		try {
25
			PlatformUI.createAndRunWorkbench(display, new RCPTestWorkbenchAdvisor());
27
			PlatformUI.createAndRunWorkbench(display, new RCPTestWorkbenchAdvisor(windowlessApp));
26
		} finally {
28
		} finally {
27
			if (display != null)
29
			if (display != null)
28
				display.dispose();
30
				display.dispose();
Lines 42-45 Link Here
42
			}
44
			}
43
		});
45
		});
44
	}
46
	}
47
	
48
	/**
49
	 * @param windowlessApp The windowlessApp to set.
50
	 */
51
	public void setWindowlessApp(boolean windowlessApp) {
52
		this.windowlessApp = windowlessApp;
53
	}
54
	
45
}
55
}
(-)Eclipse (+20 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ui.tests;
12
13
14
public class WindowlessRCPApplication extends RCPSessionApplication {
15
	
16
	public WindowlessRCPApplication() {
17
		setWindowlessApp(true);
18
	}
19
20
}
(-)Eclipse UI Tests/org/eclipse/ui/tests/session/SessionTests.java (+15 lines)
Lines 17-22 Link Here
17
import junit.framework.Test;
17
import junit.framework.Test;
18
import junit.framework.TestSuite;
18
import junit.framework.TestSuite;
19
19
20
import org.eclipse.jface.util.Util;
20
import org.eclipse.ui.tests.harness.util.TweakletCheckTest;
21
import org.eclipse.ui.tests.harness.util.TweakletCheckTest;
21
import org.eclipse.ui.tests.markers.MarkersViewColumnSizeTest;
22
import org.eclipse.ui.tests.markers.MarkersViewColumnSizeTest;
22
import org.eclipse.ui.tests.statushandlers.StatusHandlerConfigurationSuite;
23
import org.eclipse.ui.tests.statushandlers.StatusHandlerConfigurationSuite;
Lines 46-51 Link Here
46
		addThemeTests();
47
		addThemeTests();
47
		addStatusHandlingTests();
48
		addStatusHandlingTests();
48
		addRestoredSessionTest();
49
		addRestoredSessionTest();
50
		addWindowlessSessionTest();
51
	}
52
53
	/**
54
	 * 
55
	 */
56
	private void addWindowlessSessionTest() {
57
		// Windowless apps are available only on Cocoa 
58
		if(Util.isCocoa()) {
59
			Map arguments = new HashMap(2);
60
			arguments.put("product", null);
61
			arguments.put("testApplication", "org.eclipse.ui.tests.windowLessRcpApplication");
62
			addTest(new WorkbenchSessionTest("windowlessSessionTests",WindowlessSessionTest.class, arguments));
63
		}
49
	}
64
	}
50
65
51
	/**
66
	/**
(-)Eclipse (+43 lines)
Added Link Here
1
/*******************************************************************************
2
3
 * Copyright (c) 2010 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *     IBM Corporation - initial API and implementation
11
 ******************************************************************************/
12
package org.eclipse.ui.tests.session;
13
14
import org.eclipse.ui.IWorkbenchWindow;
15
import org.eclipse.ui.tests.harness.util.UITestCase;
16
17
18
/**
19
 * @since 3.7
20
 */
21
public class WindowlessSessionTest extends UITestCase {
22
	
23
	public WindowlessSessionTest(String name) {
24
		super(name);
25
	}
26
27
	public void testWindowlessWorkbench() throws Exception {
28
		
29
		// There should not be any windows in this app
30
		assertTrue(fWorkbench.getWorkbenchWindowCount() == 0);
31
32
		// Now open a window
33
		IWorkbenchWindow window = fWorkbench.openWorkbenchWindow(null);
34
35
		// window count should be 1
36
		assertTrue(fWorkbench.getWorkbenchWindowCount() == 1);
37
38
		window.close();
39
40
		// now the workbench should stay without a window
41
		assertTrue(fWorkbench.getWorkbenchWindowCount() == 0);
42
	}
43
}
(-)plugin.xml (+12 lines)
Lines 4314-4317 Link Here
4314
	      <run class="org.eclipse.ui.tests.RCPSessionApplication"> </run>
4314
	      <run class="org.eclipse.ui.tests.RCPSessionApplication"> </run>
4315
	   </application>
4315
	   </application>
4316
   </extension>
4316
   </extension>
4317
   <extension
4318
         id="windowLessRcpApplication"
4319
         point="org.eclipse.core.runtime.applications">
4320
      <application
4321
            cardinality="singleton-global"
4322
            thread="main"
4323
            visible="true">
4324
         <run
4325
               class="org.eclipse.ui.tests.WindowlessRCPApplication">
4326
         </run>
4327
      </application>
4328
   </extension>
4317
</plugin>
4329
</plugin>
(-)src/org/eclipse/ui/tests/harness/util/RCPTestWorkbenchAdvisor.java (-2 / +17 lines)
Lines 50-55 Link Here
50
	/** Default value of -1 causes the option to be ignored. */
50
	/** Default value of -1 causes the option to be ignored. */
51
	private int idleBeforeExit = -1;
51
	private int idleBeforeExit = -1;
52
52
53
	private boolean windowlessApp = false;
54
53
	/**
55
	/**
54
	 * Traps whether or not calls to displayAccess in the UI thread resulted in
56
	 * Traps whether or not calls to displayAccess in the UI thread resulted in
55
	 * an exception. Should be false.
57
	 * an exception. Should be false.
Lines 62-69 Link Here
62
		this.idleBeforeExit = -1;
64
		this.idleBeforeExit = -1;
63
	}
65
	}
64
66
65
	public RCPTestWorkbenchAdvisor(int idleBeforeExit) {
67
	/**
66
		this.idleBeforeExit = idleBeforeExit;
68
	 * 
69
	 * Enables the RCP application to runwithout a workbench window
70
	 * 
71
	 * @param runWithoutWindow
72
	 * 
73
	 */
74
	public RCPTestWorkbenchAdvisor(boolean windowlessApp) {
75
		this.windowlessApp = windowlessApp;
67
	}
76
	}
68
77
69
	/*
78
	/*
Lines 87-92 Link Here
87
		prefs.setValue(IWorkbenchPreferenceConstants.SHOW_PROGRESS_ON_STARTUP,
96
		prefs.setValue(IWorkbenchPreferenceConstants.SHOW_PROGRESS_ON_STARTUP,
88
				false);
97
				false);
89
		prefs.setValue(IWorkbenchPreferenceConstants.SHOW_INTRO, false);
98
		prefs.setValue(IWorkbenchPreferenceConstants.SHOW_INTRO, false);
99
		
100
		if(windowlessApp) {
101
			configurer.setSaveAndRestore(true);
102
			configurer.setExitOnLastWindowClose(false);
103
		}
104
		
90
	}
105
	}
91
106
92
	/*
107
	/*
(-)Eclipse UI/org/eclipse/ui/contexts/IContextService.java (-1 / +8 lines)
Lines 11-17 Link Here
11
package org.eclipse.ui.contexts;
11
package org.eclipse.ui.contexts;
12
12
13
import java.util.Collection;
13
import java.util.Collection;
14
15
import org.eclipse.core.commands.contexts.Context;
14
import org.eclipse.core.commands.contexts.Context;
16
import org.eclipse.core.commands.contexts.IContextManagerListener;
15
import org.eclipse.core.commands.contexts.IContextManagerListener;
17
import org.eclipse.core.expressions.Expression;
16
import org.eclipse.core.expressions.Expression;
Lines 40-45 Link Here
40
public interface IContextService extends IServiceWithSources {
39
public interface IContextService extends IServiceWithSources {
41
40
42
	/**
41
	/**
42
	 * The identifier for the context that is active when a workbench is active.
43
	 * 
44
	 * @since 3.7
45
	 * 
46
	 */
47
	public static final String CONTEXT_ID_WORKBENCH = "org.eclipse.ui.contexts.workbench"; //$NON-NLS-1$
48
49
	/**
43
	 * The identifier for the context that is active when a shell registered as
50
	 * The identifier for the context that is active when a shell registered as
44
	 * a dialog.
51
	 * a dialog.
45
	 */
52
	 */
(-)Eclipse (+83 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
12
package org.eclipse.ui.internal;
13
14
import org.eclipse.jface.action.IContributionItem;
15
import org.eclipse.jface.action.MenuManager;
16
import org.eclipse.swt.widgets.Decorations;
17
import org.eclipse.swt.widgets.Item;
18
import org.eclipse.swt.widgets.Menu;
19
20
/**
21
 * @since 3.7
22
 * 
23
 */
24
class ApplicationMenuManager extends MenuManager{
25
	
26
	private final Menu appMenu;
27
	private boolean disposing;
28
	
29
	public ApplicationMenuManager(Menu appMenu) {
30
		this.appMenu = appMenu;
31
	}
32
33
34
	/* (non-Javadoc)
35
	 * @see org.eclipse.jface.action.MenuManager#createMenuBar(org.eclipse.swt.widgets.Decorations)
36
	 */
37
	public Menu createMenuBar(Decorations parent) {
38
		return appMenu;
39
	}
40
	
41
	protected boolean menuExist() {
42
		// our menu always exist, 
43
		// except disposing - if not dispose will be called on this menu
44
		return !disposing; 
45
	}
46
	
47
	/* (non-Javadoc)
48
	 * @see org.eclipse.jface.action.MenuManager#getMenuItemCount()
49
	 */
50
	protected int getMenuItemCount() {
51
		return appMenu.getItemCount();
52
	}
53
	
54
	/* (non-Javadoc)
55
	 * @see org.eclipse.jface.action.MenuManager#getMenuItem(int)
56
	 */
57
	protected Item getMenuItem(int index) {
58
		return appMenu.getItem(index);
59
	}
60
	/* (non-Javadoc)
61
	 * @see org.eclipse.jface.action.MenuManager#getMenuItems()
62
	 */
63
	protected Item[] getMenuItems() {
64
		return appMenu.getItems();
65
	}
66
	
67
	/* (non-Javadoc)
68
	 * @see org.eclipse.jface.action.MenuManager#doItemFill(org.eclipse.jface.action.IContributionItem, int)
69
	 */
70
	protected void doItemFill(IContributionItem ci, int index) {
71
        ci.fill(appMenu, index);
72
	}
73
74
	/* (non-Javadoc)
75
	 * @see org.eclipse.jface.action.MenuManager#dispose()
76
	 */
77
	public void dispose() {
78
		disposing = true;
79
		super.dispose();
80
		disposing = false;
81
	}
82
}
83
(-)Eclipse UI/org/eclipse/ui/internal/Workbench.java (-2 / +96 lines)
Lines 95-100 Link Here
95
import org.eclipse.swt.widgets.Display;
95
import org.eclipse.swt.widgets.Display;
96
import org.eclipse.swt.widgets.Event;
96
import org.eclipse.swt.widgets.Event;
97
import org.eclipse.swt.widgets.Listener;
97
import org.eclipse.swt.widgets.Listener;
98
import org.eclipse.swt.widgets.Menu;
98
import org.eclipse.swt.widgets.Shell;
99
import org.eclipse.swt.widgets.Shell;
99
import org.eclipse.swt.widgets.TaskBar;
100
import org.eclipse.swt.widgets.TaskBar;
100
import org.eclipse.swt.widgets.TaskItem;
101
import org.eclipse.swt.widgets.TaskItem;
Lines 131-136 Link Here
131
import org.eclipse.ui.commands.ICommandImageService;
132
import org.eclipse.ui.commands.ICommandImageService;
132
import org.eclipse.ui.commands.ICommandService;
133
import org.eclipse.ui.commands.ICommandService;
133
import org.eclipse.ui.commands.IWorkbenchCommandSupport;
134
import org.eclipse.ui.commands.IWorkbenchCommandSupport;
135
import org.eclipse.ui.contexts.IContextActivation;
134
import org.eclipse.ui.contexts.IContextService;
136
import org.eclipse.ui.contexts.IContextService;
135
import org.eclipse.ui.contexts.IWorkbenchContextSupport;
137
import org.eclipse.ui.contexts.IWorkbenchContextSupport;
136
import org.eclipse.ui.handlers.IHandlerService;
138
import org.eclipse.ui.handlers.IHandlerService;
Lines 189-194 Link Here
189
import org.eclipse.ui.intro.IIntroManager;
191
import org.eclipse.ui.intro.IIntroManager;
190
import org.eclipse.ui.keys.IBindingService;
192
import org.eclipse.ui.keys.IBindingService;
191
import org.eclipse.ui.menus.IMenuService;
193
import org.eclipse.ui.menus.IMenuService;
194
import org.eclipse.ui.menus.MenuUtil;
192
import org.eclipse.ui.model.IContributionService;
195
import org.eclipse.ui.model.IContributionService;
193
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
196
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
194
import org.eclipse.ui.progress.IProgressService;
197
import org.eclipse.ui.progress.IProgressService;
Lines 1554-1559 Link Here
1554
			}
1557
			}
1555
		});
1558
		});
1556
1559
1560
		StartupThreading.runWithoutExceptions(new StartupRunnable() {
1561
1562
			public void runWithException() {
1563
1564
				activateWorkbenchContext();
1565
1566
			}
1567
		});
1568
1569
		StartupThreading.runWithoutExceptions(new StartupRunnable() {
1570
1571
			public void runWithException() {
1572
1573
				Menu appMenu = getAppMenu();
1574
				if (appMenu == null)
1575
					return;
1576
1577
				createApplicationMenu(appMenu);
1578
			}
1579
		});
1580
1581
1582
1557
		// attempt to restore a previous workbench state
1583
		// attempt to restore a previous workbench state
1558
		try {
1584
		try {
1559
			UIStats.start(UIStats.RESTORE_WORKBENCH, "Workbench"); //$NON-NLS-1$
1585
			UIStats.start(UIStats.RESTORE_WORKBENCH, "Workbench"); //$NON-NLS-1$
Lines 1751-1756 Link Here
1751
						new SaveablesList());
1777
						new SaveablesList());
1752
			}});
1778
			}});
1753
		
1779
		
1780
		StartupThreading.runWithoutExceptions(new StartupRunnable() {
1781
1782
			public void runWithException() {
1783
				// side effect of getter is initializing
1784
				getProgressService();
1785
			}
1786
		});
1787
1754
		/*
1788
		/*
1755
		 * Phase 1 of the initialization of commands. When this phase completes,
1789
		 * Phase 1 of the initialization of commands. When this phase completes,
1756
		 * all the services and managers will exist, and be accessible via the
1790
		 * all the services and managers will exist, and be accessible via the
Lines 2128-2135 Link Here
2128
				super.handleException(e);
2162
				super.handleException(e);
2129
			}
2163
			}
2130
		});
2164
		});
2131
		// ensure at least one window was opened
2165
		// ensure at least one window was opened, only when appMenu isn't there
2132
		if (result[0].isOK() && windowManager.getWindows().length == 0) {
2166
		if (shouldReturnNoWindowError(result[0])) {
2133
			String msg = WorkbenchMessages.Workbench_noWindowsRestored;
2167
			String msg = WorkbenchMessages.Workbench_noWindowsRestored;
2134
			result[0] = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH,
2168
			result[0] = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH,
2135
					IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null);
2169
					IWorkbenchConfigurer.RESTORE_CODE_RESET, msg, null);
Lines 2137-2142 Link Here
2137
		return result[0];
2171
		return result[0];
2138
	}
2172
	}
2139
2173
2174
	private boolean shouldReturnNoWindowError(final IStatus result) {
2175
		
2176
		final boolean[] shouldReturn = new boolean[1];
2177
		// first check for the result & no of windows
2178
		shouldReturn[0] = result.isOK() && windowManager.getWindows().length == 0;
2179
		if (shouldReturn[0]) {
2180
			// if result is ok and there is no window, check for appMenu
2181
			display.syncExec(new Runnable() {
2182
				public void run() {
2183
					// return error if there is no appMenu
2184
					shouldReturn[0] = display.getAppMenuBar() == null;
2185
				}
2186
			});
2187
		}
2188
		return shouldReturn[0];
2189
	}
2190
2140
	/*
2191
	/*
2141
	 * (non-Javadoc) Method declared on IWorkbench.
2192
	 * (non-Javadoc) Method declared on IWorkbench.
2142
	 */
2193
	 */
Lines 2988-2993 Link Here
2988
3039
2989
		((GrabFocus) Tweaklets.get(GrabFocus.KEY)).dispose();
3040
		((GrabFocus) Tweaklets.get(GrabFocus.KEY)).dispose();
2990
		
3041
		
3042
		deactivateWorkbenchContext();
3043
3044
		disposeApplicationMenu();
3045
2991
		// Bring down all of the services.
3046
		// Bring down all of the services.
2992
		serviceLocator.dispose();
3047
		serviceLocator.dispose();
2993
3048
Lines 3009-3014 Link Here
3009
		}
3064
		}
3010
	}
3065
	}
3011
3066
3067
3012
	/**
3068
	/**
3013
	 * Cancels the early startup job, if it's still running.
3069
	 * Cancels the early startup job, if it's still running.
3014
	 */
3070
	 */
Lines 3709-3714 Link Here
3709
	 */
3765
	 */
3710
	private MenuSourceProvider menuSourceProvider;
3766
	private MenuSourceProvider menuSourceProvider;
3711
3767
3768
	private IContextActivation workbenchContext;
3769
3770
	private ApplicationMenuManager applicationMenuMgr;
3712
3771
3713
3772
3714
	/**
3773
	/**
Lines 3816-3819 Link Here
3816
		};
3875
		};
3817
	}
3876
	}
3818
3877
3878
	private void createApplicationMenu(Menu appMenu) {
3879
3880
		applicationMenuMgr = new ApplicationMenuManager(appMenu);
3881
		IMenuService menuService = (IMenuService) serviceLocator.getService(IMenuService.class);
3882
		menuService.populateContributionManager(applicationMenuMgr, MenuUtil.APPLICATION_MENU);
3883
		applicationMenuMgr.update(true);
3884
	}
3885
3886
	private void disposeApplicationMenu() {
3887
3888
		if (applicationMenuMgr == null)
3889
			return;
3890
		IMenuService menuService = (IMenuService) serviceLocator.getService(IMenuService.class);
3891
		menuService.releaseContributions(applicationMenuMgr);
3892
		applicationMenuMgr.dispose();
3893
	}
3894
3895
	private void activateWorkbenchContext() {
3896
		IContextService contextService = (IContextService) serviceLocator
3897
				.getService(IContextService.class);
3898
		workbenchContext = contextService.activateContext(IContextService.CONTEXT_ID_WORKBENCH);
3899
	}
3900
3901
	private void deactivateWorkbenchContext() {
3902
		if(workbenchContext == null)
3903
			return;
3904
		workbenchContext.getContextService().deactivateContext(workbenchContext);
3905
	}
3906
3907
3908
	private Menu getAppMenu() {
3909
		IWorkbench workbench = getWorkbenchConfigurer().getWorkbench();
3910
		return workbench.getDisplay().getAppMenuBar();
3911
	}
3912
3819
}
3913
}
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java (-10 / +33 lines)
Lines 722-738 Link Here
722
		updateDisabled = true;
722
		updateDisabled = true;
723
723
724
		try {
724
		try {
725
			// Only do the check if it is OK to close if we are not closing
726
			// via the workbench as the workbench will check this itself.
727
			Workbench workbench = getWorkbenchImpl();
725
			Workbench workbench = getWorkbenchImpl();
728
			int count = workbench.getWorkbenchWindowCount();
726
			if (shouldCloseWorkbench(workbench)) {
729
			// also check for starting - if the first window dies on startup
730
			// then we'll need to open a default window.
731
			if (!workbench.isStarting()
732
					&& !workbench.isClosing()
733
					&& count <= 1
734
					&& workbench.getWorkbenchConfigurer()
735
							.getExitOnLastWindowClose()) {
736
				windowClosed = workbench.close();
727
				windowClosed = workbench.close();
737
			} else {
728
			} else {
738
				if (okToClose()) {
729
				if (okToClose()) {
Lines 755-760 Link Here
755
	}
746
	}
756
747
757
	/**
748
	/**
749
	 * 
750
	 * Checks and returns whether we should close the workbench when closing
751
	 * this window
752
	 * 
753
	 * @param workbench
754
	 * @return <code>true</code>, if the workbench needs to be closed,
755
	 *         <code>false</code> otherwise
756
	 */
757
	private boolean shouldCloseWorkbench(Workbench workbench) {
758
759
		// also check for starting - if the first window dies on startup
760
		// then we'll need to open a default window.
761
762
		if (workbench.isStarting())
763
			return false;
764
765
		// Only do the check if it is OK to close if we are not closing
766
		// via the workbench as the workbench will check this itself.
767
		if (workbench.isClosing())
768
			return false;
769
		
770
		int count = workbench.getWorkbenchWindowCount();
771
772
		// we have more windows apart from this. Dont' close workbench
773
		if(count >1 ) 
774
			return false;
775
776
		// now do whatever the workbenchconfigurer says ...
777
		return workbench.getWorkbenchConfigurer().getExitOnLastWindowClose();
778
	}
779
780
	/**
758
	 * Opens a new page. Assumes that busy cursor is active.
781
	 * Opens a new page. Assumes that busy cursor is active.
759
	 * <p>
782
	 * <p>
760
	 * <b>Note:</b> Since release 2.0, a window is limited to contain at most
783
	 * <b>Note:</b> Since release 2.0, a window is limited to contain at most
(-)Eclipse UI/org/eclipse/ui/menus/MenuUtil.java (+8 lines)
Lines 19-24 Link Here
19
 * @noinstantiate This class is not intended to be instantiated by clients.
19
 * @noinstantiate This class is not intended to be instantiated by clients.
20
 */
20
 */
21
public class MenuUtil {
21
public class MenuUtil {
22
	/**
23
	 * 
24
	 * Application Menu
25
	 * 
26
	 * @since 3.7
27
	 * 
28
	 * */
29
	public final static String APPLICATION_MENU = "menu:org.eclipse.ui.application.menu"; //$NON-NLS-1$
22
	/** Main Menu */
30
	/** Main Menu */
23
	public final static String MAIN_MENU = "menu:org.eclipse.ui.main.menu"; //$NON-NLS-1$
31
	public final static String MAIN_MENU = "menu:org.eclipse.ui.main.menu"; //$NON-NLS-1$
24
	/** Main ToolBar (CoolBar) */
32
	/** Main ToolBar (CoolBar) */

Return to bug 74073