Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 55295 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/ViewPane.java (-13 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 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 13-18 Link Here
13
package org.eclipse.ui.internal;
13
package org.eclipse.ui.internal;
14
14
15
15
16
import org.eclipse.jface.action.IContributionItem;
16
import org.eclipse.jface.action.MenuManager;
17
import org.eclipse.jface.action.MenuManager;
17
import org.eclipse.jface.internal.provisional.action.IToolBarManager2;
18
import org.eclipse.jface.internal.provisional.action.IToolBarManager2;
18
import org.eclipse.jface.util.IPropertyChangeListener;
19
import org.eclipse.jface.util.IPropertyChangeListener;
Lines 96-102 Link Here
96
        protected void update(boolean force, boolean recursive) {
97
        protected void update(boolean force, boolean recursive) {
97
            super.update(force, recursive);
98
            super.update(force, recursive);
98
99
99
            boolean hasMenu = !isEmpty();
100
			boolean hasMenu = false;
101
			IContributionItem[] items = getItems();
102
			for (int i = 0; i < items.length; i++) {
103
				if (items[i].isVisible()) {
104
		            // only show the menu if we have visible items
105
					hasMenu = true;
106
					break;
107
				}
108
			}
109
100
            if (hasMenu != hadViewMenu) {
110
            if (hasMenu != hadViewMenu) {
101
                hadViewMenu = hasMenu;
111
                hadViewMenu = hasMenu;
102
                firePropertyChange(IPresentablePart.PROP_PANE_MENU);
112
                firePropertyChange(IPresentablePart.PROP_PANE_MENU);
Lines 402-419 Link Here
402
    }
412
    }
403
413
404
    /**
414
    /**
405
     * Return if there should be a view menu at all.
415
	 * Return if there should be a view menu at all. There is no view menu if
406
     * There is no view menu if there is no menu manager,
416
	 * there is no menu manager or the manager itself has no visible items.
407
     * no pull down button or if the receiver is an
417
	 */
408
     * inactive fast view.
409
     */
410
    public boolean hasViewMenu() {
418
    public boolean hasViewMenu() {
411
419
		return isvMenuMgr != null && hadViewMenu;
412
        if (isvMenuMgr != null) {
413
            return !isvMenuMgr.isEmpty();
414
        }
415
416
        return false;
417
    }
420
    }
418
421
419
    public void showViewMenu(Point location) {
422
    public void showViewMenu(Point location) {

Return to bug 55295