blob: 7da89a920c59bf1632f9062432468e4c0f6a0e41 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui.internal.presentations;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.internal.FastViewPane;
import org.eclipse.ui.internal.WorkbenchMessages;
public class SystemMenuSizeFastView extends ContributionItem {
private FastViewPane fastViewPane;
public SystemMenuSizeFastView(FastViewPane fastViewPane) {
this.fastViewPane = fastViewPane;
}
public void dispose() {
fastViewPane = null;
}
public void fill(Menu menu, int index) {
MenuItem item = new MenuItem(menu, SWT.NONE, index);
item.setText(WorkbenchMessages.getString("PartPane.size")); //$NON-NLS-1$
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
fastViewPane.moveSash();
}
});
item.setEnabled(fastViewPane.getCurrentPane() != null);
}
public boolean isDynamic() {
return true;
}
}