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