|
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 49-54
Link Here
|
| 49 |
import org.eclipse.ui.internal.WorkbenchMessages; |
49 |
import org.eclipse.ui.internal.WorkbenchMessages; |
| 50 |
import org.eclipse.ui.internal.WorkbenchPage; |
50 |
import org.eclipse.ui.internal.WorkbenchPage; |
| 51 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
51 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
|
|
52 |
import org.eclipse.ui.internal.WorkbenchWindow; |
| 52 |
import org.eclipse.ui.internal.registry.PerspectiveDescriptor; |
53 |
import org.eclipse.ui.internal.registry.PerspectiveDescriptor; |
| 53 |
import org.eclipse.ui.internal.registry.PerspectiveRegistry; |
54 |
import org.eclipse.ui.internal.registry.PerspectiveRegistry; |
| 54 |
import org.eclipse.ui.internal.util.Descriptors; |
55 |
import org.eclipse.ui.internal.util.Descriptors; |
|
Lines 93-98
Link Here
|
| 93 |
private Button openEmbedButton; |
94 |
private Button openEmbedButton; |
| 94 |
|
95 |
|
| 95 |
private Button openFastButton; |
96 |
private Button openFastButton; |
|
|
97 |
|
| 98 |
private Button fvbHideButton; |
| 99 |
private boolean isFVBConfigured; |
| 96 |
|
100 |
|
| 97 |
// labels |
101 |
// labels |
| 98 |
private final String OVM_TITLE = WorkbenchMessages.OpenViewMode_title; |
102 |
private final String OVM_TITLE = WorkbenchMessages.OpenViewMode_title; |
|
Lines 100-105
Link Here
|
| 100 |
private final String OVM_EMBED = WorkbenchMessages.OpenViewMode_embed; |
104 |
private final String OVM_EMBED = WorkbenchMessages.OpenViewMode_embed; |
| 101 |
|
105 |
|
| 102 |
private final String OVM_FAST = WorkbenchMessages.OpenViewMode_fast; |
106 |
private final String OVM_FAST = WorkbenchMessages.OpenViewMode_fast; |
|
|
107 |
private final String FVB_HIDE = WorkbenchMessages.FastViewBar_hide; |
| 103 |
|
108 |
|
| 104 |
private final String OPM_TITLE = WorkbenchMessages.OpenPerspectiveMode_optionsTitle; |
109 |
private final String OPM_TITLE = WorkbenchMessages.OpenPerspectiveMode_optionsTitle; |
| 105 |
|
110 |
|
|
Lines 133-138
Link Here
|
| 133 |
|
138 |
|
| 134 |
createOpenPerspButtonGroup(composite); |
139 |
createOpenPerspButtonGroup(composite); |
| 135 |
createOpenViewButtonGroup(composite); |
140 |
createOpenViewButtonGroup(composite); |
|
|
141 |
createFVBHideButton(composite); |
| 136 |
createCustomizePerspective(composite); |
142 |
createCustomizePerspective(composite); |
| 137 |
|
143 |
|
| 138 |
return composite; |
144 |
return composite; |
|
Lines 249-254
Link Here
|
| 249 |
|
255 |
|
| 250 |
} |
256 |
} |
| 251 |
|
257 |
|
|
|
258 |
protected void createFVBHideButton(Composite composite) { |
| 259 |
if (!isFVBConfigured) |
| 260 |
return; |
| 261 |
Font font = composite.getFont(); |
| 262 |
fvbHideButton = new Button(composite, SWT.CHECK); |
| 263 |
GridData data = new GridData(); |
| 264 |
data.horizontalIndent = 10; |
| 265 |
fvbHideButton.setLayoutData(data); |
| 266 |
fvbHideButton.setText(FVB_HIDE); |
| 267 |
|
| 268 |
fvbHideButton.setSelection(this.getPreferenceStore().getBoolean( |
| 269 |
IPreferenceConstants.FVB_HIDE)); |
| 270 |
fvbHideButton.setFont(font); |
| 271 |
} |
| 272 |
|
| 252 |
/** |
273 |
/** |
| 253 |
* Create a table of 3 buttons to enable the user to manage customized |
274 |
* Create a table of 3 buttons to enable the user to manage customized |
| 254 |
* perspectives. |
275 |
* perspectives. |
|
Lines 413-418
Link Here
|
| 413 |
|
434 |
|
| 414 |
openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE); |
435 |
openViewMode = store.getInt(IPreferenceConstants.OPEN_VIEW_MODE); |
| 415 |
openPerspMode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); |
436 |
openPerspMode = store.getInt(IPreferenceConstants.OPEN_PERSP_MODE); |
|
|
437 |
isFVBConfigured = ((WorkbenchWindow) workbench |
| 438 |
.getActiveWorkbenchWindow()).getShowFastViewBars(); |
| 416 |
} |
439 |
} |
| 417 |
|
440 |
|
| 418 |
/** |
441 |
/** |
|
Lines 433-438
Link Here
|
| 433 |
openFastButton |
456 |
openFastButton |
| 434 |
.setSelection(openViewMode == IPreferenceConstants.OVM_FAST); |
457 |
.setSelection(openViewMode == IPreferenceConstants.OVM_FAST); |
| 435 |
|
458 |
|
|
|
459 |
if (isFVBConfigured) |
| 460 |
fvbHideButton.setSelection(store |
| 461 |
.getDefaultBoolean(IPreferenceConstants.FVB_HIDE)); |
| 462 |
|
| 436 |
openPerspMode = store |
463 |
openPerspMode = store |
| 437 |
.getDefaultInt(IPreferenceConstants.OPEN_PERSP_MODE); |
464 |
.getDefaultInt(IPreferenceConstants.OPEN_PERSP_MODE); |
| 438 |
openSameWindowButton |
465 |
openSameWindowButton |
|
Lines 553-558
Link Here
|
| 553 |
// store the open view mode setting |
580 |
// store the open view mode setting |
| 554 |
store.setValue(IPreferenceConstants.OPEN_VIEW_MODE, openViewMode); |
581 |
store.setValue(IPreferenceConstants.OPEN_VIEW_MODE, openViewMode); |
| 555 |
|
582 |
|
|
|
583 |
if (isFVBConfigured) { |
| 584 |
store.setValue(IPreferenceConstants.FVB_HIDE, fvbHideButton |
| 585 |
.getSelection()); |
| 586 |
((WorkbenchWindow) workbench.getActiveWorkbenchWindow()) |
| 587 |
.getFastViewBar().checkVisibility(); |
| 588 |
} |
| 589 |
|
| 556 |
// store the open perspective mode setting |
590 |
// store the open perspective mode setting |
| 557 |
store.setValue(IPreferenceConstants.OPEN_PERSP_MODE, openPerspMode); |
591 |
store.setValue(IPreferenceConstants.OPEN_PERSP_MODE, openPerspMode); |
| 558 |
|
592 |
|