Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 278064 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java (+4 lines)
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 * IBM - Initial API and implementation
9
 * IBM - Initial API and implementation
10
 * Sebastian Davids - bug 128529
10
 * Sebastian Davids - bug 128529
11
 * Semion Chichelnitsky (semion@il.ibm.com) - bug 278064
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.ui.internal;
13
package org.eclipse.ui.internal;
13
14
Lines 499-508 Link Here
499
	public static String OpenPerspectiveMode_sameWindow;
500
	public static String OpenPerspectiveMode_sameWindow;
500
	public static String OpenPerspectiveMode_newWindow;
501
	public static String OpenPerspectiveMode_newWindow;
501
502
503
	public static String FastViewsGroup_title;
502
	public static String OpenViewMode_title;
504
	public static String OpenViewMode_title;
503
	public static String OpenViewMode_embed;
505
	public static String OpenViewMode_embed;
504
	public static String OpenViewMode_fast;
506
	public static String OpenViewMode_fast;
505
507
508
	public static String FastViewBar_hide;
509
506
	public static String PerspectivesPreference_MakeDefault;
510
	public static String PerspectivesPreference_MakeDefault;
507
	public static String PerspectivesPreference_MakeDefaultTip;
511
	public static String PerspectivesPreference_MakeDefaultTip;
508
	public static String PerspectivesPreference_Reset;
512
	public static String PerspectivesPreference_Reset;
(-)Eclipse UI/org/eclipse/ui/internal/IPreferenceConstants.java (-1 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Semion Chichelnitsky (semion@il.ibm.com) - bug 278064
10
 *******************************************************************************/
11
 *******************************************************************************/
11
12
12
package org.eclipse.ui.internal;
13
package org.eclipse.ui.internal;
Lines 61-66 Link Here
61
62
62
    public static final int OVM_FLOAT = 2;
63
    public static final int OVM_FLOAT = 2;
63
64
65
	// Boolean: true = hide fast view bar, when it is empty
66
	public static final String FVB_HIDE = "FVB_HIDE"; //$NON-NLS-1$
67
64
    // (int) Mode for opening a new perspective
68
    // (int) Mode for opening a new perspective
65
    public static final String OPEN_PERSP_MODE = "OPEN_PERSPECTIVE_MODE"; //$NON-NLS-1$
69
    public static final String OPEN_PERSP_MODE = "OPEN_PERSPECTIVE_MODE"; //$NON-NLS-1$
66
70
(-)Eclipse UI/org/eclipse/ui/internal/messages.properties (-1 / +5 lines)
Lines 11-16 Link Here
11
#        - Fix for Bug 57087
11
#        - Fix for Bug 57087
12
#        - Fix for Bug 138034 [Preferences] Label decorations page - extra space
12
#        - Fix for Bug 138034 [Preferences] Label decorations page - extra space
13
#        - Fix for Bug 128529
13
#        - Fix for Bug 128529
14
#     Semion Chichelnitsky (semion@il.ibm.com) - bug 278064
14
###############################################################################
15
###############################################################################
15
16
16
# package: org.eclipse.ui
17
# package: org.eclipse.ui
Lines 455-464 Link Here
455
OpenPerspectiveMode_sameWindow = In the &same window
456
OpenPerspectiveMode_sameWindow = In the &same window
456
OpenPerspectiveMode_newWindow = In a &new window
457
OpenPerspectiveMode_newWindow = In a &new window
457
458
458
OpenViewMode_title = Open a new view
459
FastViewsGroup_title = Fast Views
460
OpenViewMode_title = Open a new view:
459
OpenViewMode_embed = &Within the perspective
461
OpenViewMode_embed = &Within the perspective
460
OpenViewMode_fast = As &fast view
462
OpenViewMode_fast = As &fast view
461
463
464
FastViewBar_hide = &Hide empty fast view bar 
465
462
PerspectivesPreference_MakeDefault = Ma&ke Default
466
PerspectivesPreference_MakeDefault = Ma&ke Default
463
PerspectivesPreference_MakeDefaultTip = Make the Current Selection the Default Perspective
467
PerspectivesPreference_MakeDefaultTip = Make the Current Selection the Default Perspective
464
PerspectivesPreference_Reset = &Reset
468
PerspectivesPreference_Reset = &Reset
(-)Eclipse UI/org/eclipse/ui/internal/FastViewManager.java (-4 / +6 lines)
Lines 9-14 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Carlos Devoto carlos.devoto@compuware.com Bug 213645
10
 *     Carlos Devoto carlos.devoto@compuware.com Bug 213645
11
 *     Markus Alexander Kuppe, Versant Corporation - bug #215797
11
 *     Markus Alexander Kuppe, Versant Corporation - bug #215797
12
 *     Semion Chichelnitsky (semion@il.ibm.com) - bug 278064
12
 *******************************************************************************/
13
 *******************************************************************************/
13
14
14
package org.eclipse.ui.internal;
15
package org.eclipse.ui.internal;
Lines 18-24 Link Here
18
import java.util.Iterator;
19
import java.util.Iterator;
19
import java.util.List;
20
import java.util.List;
20
import java.util.Map;
21
import java.util.Map;
21
22
import org.eclipse.core.runtime.MultiStatus;
22
import org.eclipse.core.runtime.MultiStatus;
23
import org.eclipse.jface.util.Geometry;
23
import org.eclipse.jface.util.Geometry;
24
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.SWT;
Lines 303-309 Link Here
303
	 * @param id
303
	 * @param id
304
	 *            The id of the {@link IWindowTrim} to update
304
	 *            The id of the {@link IWindowTrim} to update
305
	 */
305
	 */
306
	private void updateTrim(String id) {
306
	public void updateTrim(String id) {
307
		// Get the trim part from the trim manager
307
		// Get the trim part from the trim manager
308
		IWindowTrim trim = tbm.getTrim(id);
308
		IWindowTrim trim = tbm.getTrim(id);
309
309
Lines 313-320 Link Here
313
313
314
		// If there are no fast views for the bar then hide it
314
		// If there are no fast views for the bar then hide it
315
		List fvs = (List) idToFastViewsMap.get(id);
315
		List fvs = (List) idToFastViewsMap.get(id);
316
		if (fvs != null && fvs.size() == 0
316
		boolean hideEmptyFVB = WorkbenchPlugin.getDefault()
317
				&& !FastViewBar.FASTVIEWBAR_ID.equals(id)) {
317
				.getPreferenceStore().getBoolean(IPreferenceConstants.FVB_HIDE);
318
		if ((fvs == null || fvs.size() == 0)
319
				&& (!FastViewBar.FASTVIEWBAR_ID.equals(id) || hideEmptyFVB)) {
318
			if (trim.getControl().getVisible()) {
320
			if (trim.getControl().getVisible()) {
319
				tbm.setTrimVisible(trim, false);
321
				tbm.setTrimVisible(trim, false);
320
				tbm.forceLayout();
322
				tbm.forceLayout();
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchPreferenceInitializer.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Semion Chichelnitsky (semion@il.ibm.com) - bug 278064
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ui.internal;
12
package org.eclipse.ui.internal;
12
13
Lines 65-70 Link Here
65
		node.putInt(IPreferenceConstants.EDITOR_TAB_WIDTH, 3); // high
66
		node.putInt(IPreferenceConstants.EDITOR_TAB_WIDTH, 3); // high
66
		node.putInt(IPreferenceConstants.OPEN_VIEW_MODE,
67
		node.putInt(IPreferenceConstants.OPEN_VIEW_MODE,
67
				IPreferenceConstants.OVM_EMBED);
68
				IPreferenceConstants.OVM_EMBED);
69
		node.putBoolean(IPreferenceConstants.FVB_HIDE, false);
68
		node.putInt(IPreferenceConstants.OPEN_PERSP_MODE,
70
		node.putInt(IPreferenceConstants.OPEN_PERSP_MODE,
69
				IPreferenceConstants.OPM_ACTIVE_PAGE);
71
				IPreferenceConstants.OPM_ACTIVE_PAGE);
70
		node.put(IPreferenceConstants.ENABLED_DECORATORS, ""); //$NON-NLS-1$
72
		node.put(IPreferenceConstants.ENABLED_DECORATORS, ""); //$NON-NLS-1$
(-)Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java (-3 / +57 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Semion Chichelnitsky (semion@il.ibm.com) - bug 278064
10
 *******************************************************************************/
11
 *******************************************************************************/
11
12
12
package org.eclipse.ui.internal.dialogs;
13
package org.eclipse.ui.internal.dialogs;
Lines 15-21 Link Here
15
import java.util.ArrayList;
16
import java.util.ArrayList;
16
import java.util.Collections;
17
import java.util.Collections;
17
import java.util.Comparator;
18
import java.util.Comparator;
18
19
import org.eclipse.jface.dialogs.IDialogConstants;
19
import org.eclipse.jface.dialogs.IDialogConstants;
20
import org.eclipse.jface.dialogs.MessageDialog;
20
import org.eclipse.jface.dialogs.MessageDialog;
21
import org.eclipse.jface.preference.IPreferenceStore;
21
import org.eclipse.jface.preference.IPreferenceStore;
Lines 44-54 Link Here
44
import org.eclipse.ui.IWorkbenchPreferencePage;
44
import org.eclipse.ui.IWorkbenchPreferencePage;
45
import org.eclipse.ui.IWorkbenchWindow;
45
import org.eclipse.ui.IWorkbenchWindow;
46
import org.eclipse.ui.PlatformUI;
46
import org.eclipse.ui.PlatformUI;
47
import org.eclipse.ui.internal.FastViewBar;
48
import org.eclipse.ui.internal.FastViewManager;
47
import org.eclipse.ui.internal.IPreferenceConstants;
49
import org.eclipse.ui.internal.IPreferenceConstants;
48
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
50
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
49
import org.eclipse.ui.internal.WorkbenchMessages;
51
import org.eclipse.ui.internal.WorkbenchMessages;
50
import org.eclipse.ui.internal.WorkbenchPage;
52
import org.eclipse.ui.internal.WorkbenchPage;
51
import org.eclipse.ui.internal.WorkbenchPlugin;
53
import org.eclipse.ui.internal.WorkbenchPlugin;
54
import org.eclipse.ui.internal.WorkbenchWindow;
52
import org.eclipse.ui.internal.registry.PerspectiveDescriptor;
55
import org.eclipse.ui.internal.registry.PerspectiveDescriptor;
53
import org.eclipse.ui.internal.registry.PerspectiveRegistry;
56
import org.eclipse.ui.internal.registry.PerspectiveRegistry;
54
import org.eclipse.ui.internal.util.Descriptors;
57
import org.eclipse.ui.internal.util.Descriptors;
Lines 81-86 Link Here
81
	private Button setDefaultButton;
84
	private Button setDefaultButton;
82
85
83
	// widgets for open perspective mode;
86
	// widgets for open perspective mode;
87
	private Label openViewModeLabel;
88
84
	private Button openSameWindowButton;
89
	private Button openSameWindowButton;
85
90
86
	private Button openNewWindowButton;
91
	private Button openNewWindowButton;
Lines 93-106 Link Here
93
	private Button openEmbedButton;
98
	private Button openEmbedButton;
94
99
95
	private Button openFastButton;
100
	private Button openFastButton;
101
102
	private Button fvbHideButton;
103
	
104
	private boolean isFVBConfigured;
96
    
105
    
97
	// labels
106
	// labels
107
	private final String FVG_TITLE = WorkbenchMessages.FastViewsGroup_title;
108
98
	private final String OVM_TITLE = WorkbenchMessages.OpenViewMode_title;
109
	private final String OVM_TITLE = WorkbenchMessages.OpenViewMode_title;
99
110
100
	private final String OVM_EMBED = WorkbenchMessages.OpenViewMode_embed;
111
	private final String OVM_EMBED = WorkbenchMessages.OpenViewMode_embed;
101
112
102
	private final String OVM_FAST = WorkbenchMessages.OpenViewMode_fast; 
113
	private final String OVM_FAST = WorkbenchMessages.OpenViewMode_fast; 
103
114
115
	private final String FVB_HIDE = WorkbenchMessages.FastViewBar_hide;
116
104
	private final String OPM_TITLE = WorkbenchMessages.OpenPerspectiveMode_optionsTitle; 
117
	private final String OPM_TITLE = WorkbenchMessages.OpenPerspectiveMode_optionsTitle; 
105
118
106
	private final String OPM_SAME_WINDOW = WorkbenchMessages.OpenPerspectiveMode_sameWindow; 
119
	private final String OPM_SAME_WINDOW = WorkbenchMessages.OpenPerspectiveMode_sameWindow; 
Lines 213-225 Link Here
213
		Font font = composite.getFont();
226
		Font font = composite.getFont();
214
227
215
		Group buttonComposite = new Group(composite, SWT.LEFT);
228
		Group buttonComposite = new Group(composite, SWT.LEFT);
216
		buttonComposite.setText(OVM_TITLE);
229
		buttonComposite.setText(FVG_TITLE);
217
		buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
230
		buttonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
218
		buttonComposite.setFont(composite.getFont());
231
		buttonComposite.setFont(composite.getFont());
219
		GridLayout layout = new GridLayout();
232
		GridLayout layout = new GridLayout();
220
		layout.numColumns = 2;
233
		layout.numColumns = 2;
221
		buttonComposite.setLayout(layout);
234
		buttonComposite.setLayout(layout);
222
235
236
		openViewModeLabel = new Label(buttonComposite, SWT.NONE);
237
		openViewModeLabel.setText(OVM_TITLE);
238
		GridData data = new GridData();
239
		data.horizontalSpan = 2;
240
		openViewModeLabel.setLayoutData(data);
241
223
		openEmbedButton = new Button(buttonComposite, SWT.RADIO);
242
		openEmbedButton = new Button(buttonComposite, SWT.RADIO);
224
		openEmbedButton.setText(OVM_EMBED);
243
		openEmbedButton.setText(OVM_EMBED);
225
		openEmbedButton
244
		openEmbedButton
Lines 247-252 Link Here
247
		});
266
		});
248
		openFastButton.setFont(font);
267
		openFastButton.setFont(font);
249
268
269
		createFVBHideButton(buttonComposite);
270
	}
271
272
	protected void createFVBHideButton(Composite composite) {
273
		if (!isFVBConfigured)
274
			return;
275
		Font font = composite.getFont();
276
		fvbHideButton = new Button(composite, SWT.CHECK);
277
		GridData data = new GridData();
278
		// data.horizontalIndent = 10;
279
		data.horizontalSpan = 2;
280
		fvbHideButton.setLayoutData(data);
281
		fvbHideButton.setText(FVB_HIDE);
282
283
		fvbHideButton.setSelection(this.getPreferenceStore().getBoolean(
284
				IPreferenceConstants.FVB_HIDE));
285
		fvbHideButton.setFont(font);
250
	}
286
	}
251
287
252
	/**
288
	/**
Lines 413-418 Link Here
413
449
414
		openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE);
450
		openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE);
415
		openPerspMode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE);
451
		openPerspMode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE);
452
		isFVBConfigured = ((WorkbenchWindow) workbench
453
				.getActiveWorkbenchWindow()).getShowFastViewBars();
454
416
	}
455
	}
417
456
418
	/**
457
	/**
Lines 433-438 Link Here
433
		openFastButton
472
		openFastButton
434
				.setSelection(openViewMode == IPreferenceConstants.OVM_FAST);
473
				.setSelection(openViewMode == IPreferenceConstants.OVM_FAST);
435
474
475
		if (isFVBConfigured)
476
			fvbHideButton.setSelection(store
477
					.getDefaultBoolean(IPreferenceConstants.FVB_HIDE));
478
436
		openPerspMode = store
479
		openPerspMode = store
437
				.getDefaultInt(IPreferenceConstants.OPEN_PERSP_MODE);
480
				.getDefaultInt(IPreferenceConstants.OPEN_PERSP_MODE);
438
		openSameWindowButton
481
		openSameWindowButton
Lines 553-558 Link Here
553
		// store the open view mode setting
596
		// store the open view mode setting
554
		store.setValue(IPreferenceConstants.OPEN_VIEW_MODE, openViewMode);
597
		store.setValue(IPreferenceConstants.OPEN_VIEW_MODE, openViewMode);
555
598
599
		if (isFVBConfigured) {
600
			store.setValue(IPreferenceConstants.FVB_HIDE, fvbHideButton
601
					.getSelection());
602
			WorkbenchPage page = (WorkbenchPage) workbench
603
					.getActiveWorkbenchWindow().getActivePage();
604
			FastViewManager fvm = page.getActivePerspective()
605
					.getFastViewManager();
606
			if (fvm != null)
607
				fvm.updateTrim(FastViewBar.FASTVIEWBAR_ID);
608
		}
609
556
		// store the open perspective mode setting
610
		// store the open perspective mode setting
557
		store.setValue(IPreferenceConstants.OPEN_PERSP_MODE, openPerspMode);
611
		store.setValue(IPreferenceConstants.OPEN_PERSP_MODE, openPerspMode);
558
612

Return to bug 278064