01: /*******************************************************************************
02: * Copyright (c) 2004, 2006 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.internal.presentations;
11:
12: import org.eclipse.jface.action.ContributionItem;
13: import org.eclipse.swt.widgets.Menu;
14: import org.eclipse.ui.internal.PartPane;
15:
16: public class SystemMenuSize extends ContributionItem {
17:
18: private PartPane partPane;
19:
20: public SystemMenuSize(PartPane pane) {
21: setPane(pane);
22: }
23:
24: public void setPane(PartPane pane) {
25: partPane = pane;
26: }
27:
28: public void dispose() {
29: partPane = null;
30: }
31:
32: public void fill(Menu menu, int index) {
33: if (partPane != null) {
34: partPane.addSizeMenuItem(menu, index);
35: }
36: }
37:
38: public boolean isDynamic() {
39: return true;
40: }
41: }
|