|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2013 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2014 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 31-36
Link Here
|
| 31 |
import org.eclipse.jface.dialogs.ErrorDialog; |
31 |
import org.eclipse.jface.dialogs.ErrorDialog; |
| 32 |
import org.eclipse.jface.dialogs.IDialogSettings; |
32 |
import org.eclipse.jface.dialogs.IDialogSettings; |
| 33 |
import org.eclipse.jface.dialogs.IMessageProvider; |
33 |
import org.eclipse.jface.dialogs.IMessageProvider; |
|
|
34 |
import org.eclipse.jface.dialogs.MessageDialog; |
| 34 |
import org.eclipse.jface.preference.PreferencePage; |
35 |
import org.eclipse.jface.preference.PreferencePage; |
| 35 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
36 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
| 36 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
37 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
|
Lines 104-110
Link Here
|
| 104 |
protected Control createContents(Composite ancestor) { |
105 |
protected Control createContents(Composite ancestor) { |
| 105 |
initializeDialogUnits(ancestor); |
106 |
initializeDialogUnits(ancestor); |
| 106 |
|
107 |
|
| 107 |
noDefaultAndApplyButton(); |
108 |
createApplyButton(); |
| 108 |
|
109 |
|
| 109 |
GridLayout layout= new GridLayout(); |
110 |
GridLayout layout= new GridLayout(); |
| 110 |
layout.numColumns= 1; |
111 |
layout.numColumns= 1; |
|
Lines 134-139
Link Here
|
| 134 |
}); |
135 |
}); |
| 135 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(ancestor, IJavaDebugHelpContextIds.JRE_PREFERENCE_PAGE); |
136 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(ancestor, IJavaDebugHelpContextIds.JRE_PREFERENCE_PAGE); |
| 136 |
initDefaultVM(); |
137 |
initDefaultVM(); |
|
|
138 |
fJREBlock.initializeTimeStamp(); |
| 137 |
fJREBlock.addSelectionChangedListener(new ISelectionChangedListener() { |
139 |
fJREBlock.addSelectionChangedListener(new ISelectionChangedListener() { |
| 138 |
public void selectionChanged(SelectionChangedEvent event) { |
140 |
public void selectionChanged(SelectionChangedEvent event) { |
| 139 |
IVMInstall install = getCurrentDefaultVM(); |
141 |
IVMInstall install = getCurrentDefaultVM(); |
|
Lines 257-262
Link Here
|
| 257 |
// save column widths |
259 |
// save column widths |
| 258 |
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings(); |
260 |
IDialogSettings settings = JDIDebugUIPlugin.getDefault().getDialogSettings(); |
| 259 |
fJREBlock.saveColumnSettings(settings, IJavaDebugHelpContextIds.JRE_PREFERENCE_PAGE); |
261 |
fJREBlock.saveColumnSettings(settings, IJavaDebugHelpContextIds.JRE_PREFERENCE_PAGE); |
|
|
262 |
fJREBlock.initializeTimeStamp(); |
| 260 |
|
263 |
|
| 261 |
return super.performOk(); |
264 |
return super.performOk(); |
| 262 |
} |
265 |
} |
|
Lines 312-315
Link Here
|
| 312 |
super.dispose(); |
315 |
super.dispose(); |
| 313 |
fJREBlock.dispose(); |
316 |
fJREBlock.dispose(); |
| 314 |
} |
317 |
} |
|
|
318 |
|
| 319 |
/* |
| 320 |
* @see org.eclipse.jface.preference.PreferencePage#okToLeave() |
| 321 |
*/ |
| 322 |
@Override |
| 323 |
public boolean okToLeave() { |
| 324 |
if (fJREBlock != null && fJREBlock.hasChangesInDialog()) { |
| 325 |
String title = JREMessages.JREsPreferencePage_4; |
| 326 |
String message = JREMessages.JREsPreferencePage_5; |
| 327 |
String[] buttonLabels = new String[] { JREMessages.JREsPreferencePage_6, JREMessages.JREsPreferencePage_7, |
| 328 |
JREMessages.JREsPreferencePage_8 }; |
| 329 |
MessageDialog dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.QUESTION, buttonLabels, 0); |
| 330 |
int res = dialog.open(); |
| 331 |
if (res == 0) { // save |
| 332 |
return performOk() && super.okToLeave(); |
| 333 |
} else if (res == 1) { // discard |
| 334 |
fJREBlock.fillWithWorkspaceJREs(); |
| 335 |
fJREBlock.restoreColumnSettings(JDIDebugUIPlugin.getDefault().getDialogSettings(), IJavaDebugHelpContextIds.JRE_PREFERENCE_PAGE); |
| 336 |
initDefaultVM(); |
| 337 |
fJREBlock.initializeTimeStamp(); |
| 338 |
} else { |
| 339 |
// keep unsaved |
| 340 |
} |
| 341 |
} |
| 342 |
return super.okToLeave(); |
| 343 |
} |
| 315 |
} |
344 |
} |