View | Details | Raw Unified | Return to bug 84603
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java (-1 / +13 lines)
Lines 161-167 Link Here
161
	 * 
161
	 * 
162
	 * @since 3.0
162
	 * @since 3.0
163
	 */
163
	 */
164
	public static String DOCK_PERSPECTIVE_BAR = "DOCK_PERSPECTIVE_BAR"; //$NON-NLS-1$	
164
	public static String DOCK_PERSPECTIVE_BAR = "DOCK_PERSPECTIVE_BAR"; //$NON-NLS-1$
165
	
166
	/**
167
	 * A preference indication the initial size of the perspective bar. The default value is 160.
168
	 * This preference only works when <code>configurer.setShowPerspectiveBar(true)</code> is set in
169
	 * WorkbenchWindowAdvisor#preWindowOpen()
170
	 * 
171
	 * This preference only uses integer values
172
	 * bug 84603: [RCP] [PerspectiveBar] New API or pref to set default perspective bar size
173
	 * 
174
	 *  @since 3.4
175
	 */
176
	public static String PERSPECTIVE_BAR_SIZE = "PERSPECTIVE_BAR_SIZE"; //$NON-NLS-1$ 
165
177
166
	/**
178
	/**
167
	 * A named preference indicating where the fast view bar should be docked in
179
	 * A named preference indicating where the fast view bar should be docked in
(-)Eclipse UI/org/eclipse/ui/internal/PerspectiveSwitcher.java (-1 / +13 lines)
Lines 379-385 Link Here
379
        StringTokenizer tok = new StringTokenizer(extras, ", "); //$NON-NLS-1$
379
        StringTokenizer tok = new StringTokenizer(extras, ", "); //$NON-NLS-1$
380
        int numExtras = tok.countTokens();
380
        int numExtras = tok.countTokens();
381
        int numPersps = Math.max(numExtras, 1); // assume initial perspective is also listed in extras
381
        int numPersps = Math.max(numExtras, 1); // assume initial perspective is also listed in extras
382
		return Math.max(MIN_DEFAULT_WIDTH, MIN_WIDTH + (numPersps*ITEM_WIDTH));
382
        
383
        // Fixed bug 84603: [RCP] [PerspectiveBar] New API or pref to set default perspective bar size
384
        String sizeString = PrefUtil.getAPIPreferenceStore().getString(
385
				IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_SIZE);
386
        int size = MIN_DEFAULT_WIDTH;
387
        try {
388
        	 size = Integer.parseInt(sizeString);
389
        }
390
        catch (NumberFormatException e) {
391
        	// leave size value at MIN_DEFAULT_WIDTH
392
        }
393
        int defaultWidth = Math.max(MIN_DEFAULT_WIDTH, size);
394
		return Math.max(defaultWidth, MIN_WIDTH + (numPersps*ITEM_WIDTH));
383
	}
395
	}
384
396
385
	/**
397
	/**

Return to bug 84603