01: /*******************************************************************************
02: * Copyright (c) 2004, 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.internal.presentations;
11:
12: import org.eclipse.jface.action.ContributionItem;
13: import org.eclipse.swt.SWT;
14: import org.eclipse.swt.events.SelectionAdapter;
15: import org.eclipse.swt.events.SelectionEvent;
16: import org.eclipse.swt.widgets.Menu;
17: import org.eclipse.swt.widgets.MenuItem;
18: import org.eclipse.ui.internal.FastViewPane;
19: import org.eclipse.ui.internal.WorkbenchMessages;
20:
21: public class SystemMenuSizeFastView extends ContributionItem {
22:
23: private FastViewPane fastViewPane;
24:
25: public SystemMenuSizeFastView(FastViewPane fastViewPane) {
26: this .fastViewPane = fastViewPane;
27: }
28:
29: public void dispose() {
30: fastViewPane = null;
31: }
32:
33: public void fill(Menu menu, int index) {
34: MenuItem item = new MenuItem(menu, SWT.NONE, index);
35: item.setText(WorkbenchMessages.PartPane_size);
36: item.addSelectionListener(new SelectionAdapter() {
37:
38: public void widgetSelected(SelectionEvent e) {
39: fastViewPane.moveSash();
40: }
41: });
42: item.setEnabled(fastViewPane.getCurrentPane() != null);
43: }
44:
45: public boolean isDynamic() {
46: return true;
47: }
48: }
|