Community
Participate
Working Groups
*
* @since 3.0
*/
public static String DOCK_PERSPECTIVE_BAR = "DOCK_PERSPECTIVE_BAR"; //$NON-NLS-1$
/**
* A preference indication the initial size of the perspective bar. The default value is 160.
* This preference only works when <code>configurer.setShowPerspectiveBar(true)</code> is set in
* WorkbenchWindowAdvisor#preWindowOpen()
* This preference only uses integer values
* bug 84603: [RCP] [PerspectiveBar] New API or pref to set default perspective bar size
* @since 3.4
public static String PERSPECTIVE_BAR_SIZE = "PERSPECTIVE_BAR_SIZE"; //$NON-NLS-1$
* A named preference indicating where the fast view bar should be docked in
StringTokenizer tok = new StringTokenizer(extras, ", "); //$NON-NLS-1$
int numExtras = tok.countTokens();
int numPersps = Math.max(numExtras, 1); // assume initial perspective is also listed in extras
return Math.max(MIN_DEFAULT_WIDTH, MIN_WIDTH + (numPersps*ITEM_WIDTH));
// Fixed bug 84603: [RCP] [PerspectiveBar] New API or pref to set default perspective bar size
String sizeString = PrefUtil.getAPIPreferenceStore().getString(
IWorkbenchPreferenceConstants.PERSPECTIVE_BAR_SIZE);
int size = MIN_DEFAULT_WIDTH;
try {
size = Integer.parseInt(sizeString);
}
catch (NumberFormatException e) {
// leave size value at MIN_DEFAULT_WIDTH
int defaultWidth = Math.max(MIN_DEFAULT_WIDTH, size);
return Math.max(defaultWidth, MIN_WIDTH + (numPersps*ITEM_WIDTH));