1 11 12 package org.eclipse.ui.internal.presentations.r33; 13 14 import org.eclipse.jface.preference.IPreferenceStore; 15 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.ui.IWorkbenchPreferenceConstants; 18 import org.eclipse.ui.PlatformUI; 19 import org.eclipse.ui.internal.IPreferenceConstants; 20 import org.eclipse.ui.internal.WorkbenchPlugin; 21 import org.eclipse.ui.internal.presentations.util.PresentablePartFolder; 22 import org.eclipse.ui.internal.presentations.util.StandardViewSystemMenu; 23 import org.eclipse.ui.internal.presentations.util.TabbedStackPresentation; 24 import org.eclipse.ui.presentations.IStackPresentationSite; 25 import org.eclipse.ui.presentations.StackPresentation; 26 import org.eclipse.ui.presentations.WorkbenchPresentationFactory; 27 28 36 public class WorkbenchPresentationFactory_33 extends 37 WorkbenchPresentationFactory { 38 39 private static int viewTabPosition = WorkbenchPlugin.getDefault() 40 .getPreferenceStore() 41 .getInt(IPreferenceConstants.VIEW_TAB_POSITION); 42 43 46 public WorkbenchPresentationFactory_33() { 47 super(); 48 } 49 50 56 public StackPresentation createViewPresentation(Composite parent, 57 IStackPresentationSite site) { 58 59 DefaultTabFolder folder = new DefaultTabFolder(parent, viewTabPosition 60 | SWT.BORDER, site 61 .supportsState(IStackPresentationSite.STATE_MINIMIZED), site 62 .supportsState(IStackPresentationSite.STATE_MAXIMIZED)); 63 64 final IPreferenceStore store = PlatformUI.getPreferenceStore(); 65 final int minimumCharacters = store 66 .getInt(IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS); 67 if (minimumCharacters >= 0) { 68 folder.setMinimumCharacters(minimumCharacters); 69 } 70 71 PresentablePartFolder partFolder = new PresentablePartFolder(folder); 72 73 folder.setUnselectedCloseVisible(false); 74 folder.setUnselectedImageVisible(true); 75 76 TabbedStackPresentation result = new TabbedStackPresentation(site, 77 partFolder, new StandardViewSystemMenu(site)); 78 79 DefaultThemeListener themeListener = new DefaultThemeListener(folder, 80 result.getTheme()); 81 result.getTheme().addListener(themeListener); 82 83 new DefaultSimpleTabListener(result.getApiPreferences(), 84 IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, 85 folder); 86 87 return result; 88 } 89 90 } 91 | Popular Tags |