|
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() && !items[i].isSeparator() && !items[i].isGroupMarker()) { |
| 104 |
// only show the menu if we have visible items that aren't separators or group markers |
| 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 401-419
Link Here
|
| 401 |
return !page.isFixedLayout(); |
411 |
return !page.isFixedLayout(); |
| 402 |
} |
412 |
} |
| 403 |
|
413 |
|
| 404 |
/** |
414 |
/** |
| 405 |
* Return if there should be a view menu at all. |
415 |
* Returns whether there should be a view menu or not. There should not be a |
| 406 |
* There is no view menu if there is no menu manager, |
416 |
* view menu if there is no menu manager or the manager itself has no |
| 407 |
* no pull down button or if the receiver is an |
417 |
* visible items that are not separators or group markers. |
| 408 |
* inactive fast view. |
418 |
*/ |
| 409 |
*/ |
|
|
| 410 |
public boolean hasViewMenu() { |
419 |
public boolean hasViewMenu() { |
| 411 |
|
420 |
return isvMenuMgr != null && hadViewMenu; |
| 412 |
if (isvMenuMgr != null) { |
|
|
| 413 |
return !isvMenuMgr.isEmpty(); |
| 414 |
} |
| 415 |
|
| 416 |
return false; |
| 417 |
} |
421 |
} |
| 418 |
|
422 |
|
| 419 |
public void showViewMenu(Point location) { |
423 |
public void showViewMenu(Point location) { |