1 11 package org.eclipse.ui.internal.presentations; 12 13 import org.eclipse.jface.preference.IPreferenceStore; 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.widgets.Composite; 16 import org.eclipse.ui.internal.IPreferenceConstants; 17 import org.eclipse.ui.internal.WorkbenchPlugin; 18 import org.eclipse.ui.internal.presentations.r21.R21PresentationMessages; 19 import org.eclipse.ui.internal.presentations.r21.widgets.CTabFolderEvent; 20 import org.eclipse.ui.internal.presentations.r21.widgets.R21PaneFolder; 21 import org.eclipse.ui.internal.presentations.r21.widgets.R21PaneFolderButtonListener; 22 import org.eclipse.ui.presentations.IStackPresentationSite; 23 24 29 public class R21ViewStackPresentation extends R21BasicStackPresentation { 30 31 private static IPreferenceStore preferenceStore = WorkbenchPlugin.getDefault() 32 .getPreferenceStore(); 33 34 private static int tabPos = preferenceStore.getInt(IPreferenceConstants.VIEW_TAB_POSITION); 38 39 private R21PaneFolderButtonListener showListListener = new R21PaneFolderButtonListener() { 40 41 public void showList(CTabFolderEvent event) { 42 event.doit = false; 43 showListDefaultLocation(); 44 } 45 }; 46 47 53 public R21ViewStackPresentation(Composite parent, 54 IStackPresentationSite newSite) { 55 56 super(new R21PaneFolder(parent, SWT.BORDER), newSite); 57 R21PaneFolder tabFolder = getPaneFolder(); 58 59 tabFolder.addButtonListener(showListListener); 60 61 tabFolder.setTabPosition(tabPos); 62 updateGradient(); 63 } 64 65 68 public void setActive(boolean isActive) { 69 super.setActive(isActive); 70 71 updateGradient(); 72 } 73 74 77 protected String getPaneName() { 78 return R21PresentationMessages.getString("ViewPane.moveView"); } 80 } 81 | Popular Tags |