|
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 |
|