Lines 148-153
Link Here
|
148 |
public String getCustomDirectory() { |
148 |
public String getCustomDirectory() { |
149 |
return customLocationField.getText(); |
149 |
return customLocationField.getText(); |
150 |
} |
150 |
} |
|
|
151 |
|
152 |
public void setCustomDirectpry(String directory) { |
153 |
customLocationField.setText(directory); |
154 |
} |
151 |
|
155 |
|
152 |
public int getDestinationType() { |
156 |
public int getDestinationType() { |
153 |
if (defaultLocationRadio.isSelected()) { |
157 |
if (defaultLocationRadio.isSelected()) { |
Lines 156-161
Link Here
|
156 |
return DESTINATION_CUSTOM; |
160 |
return DESTINATION_CUSTOM; |
157 |
} |
161 |
} |
158 |
} |
162 |
} |
|
|
163 |
|
164 |
public void setDestinationType(int type) { |
165 |
defaultLocationRadio.setSelected(type == DESTINATION_DEFAULT); |
166 |
} |
159 |
|
167 |
|
160 |
public JButton getOKButton() { |
168 |
public JButton getOKButton() { |
161 |
return okButton; |
169 |
return okButton; |
Lines 420-431
Link Here
|
420 |
? Bundle.HeapDumpAction_LocationProjectString() : |
428 |
? Bundle.HeapDumpAction_LocationProjectString() : |
421 |
Bundle.HeapDumpAction_LocationGlobalString()); |
429 |
Bundle.HeapDumpAction_LocationGlobalString()); |
422 |
|
430 |
|
|
|
431 |
int previousType = targetSelector.getDestinationType(); |
432 |
String previousDirectory = targetSelector.getCustomDirectory(); |
433 |
|
423 |
DialogDescriptor desc = new DialogDescriptor(targetSelector, Bundle.HeapDumpAction_DestinationDialogCaption(), true, |
434 |
DialogDescriptor desc = new DialogDescriptor(targetSelector, Bundle.HeapDumpAction_DestinationDialogCaption(), true, |
424 |
new Object[] { targetSelector.getOKButton(), DialogDescriptor.CANCEL_OPTION }, |
435 |
new Object[] { targetSelector.getOKButton(), DialogDescriptor.CANCEL_OPTION }, |
425 |
DialogDescriptor.OK_OPTION, 0, null, null); |
436 |
DialogDescriptor.OK_OPTION, 0, null, null); |
426 |
Object res = DialogDisplayer.getDefault().notify(desc); |
437 |
Object res = DialogDisplayer.getDefault().notify(desc); |
427 |
|
438 |
|
428 |
if (!res.equals(targetSelector.getOKButton())) { |
439 |
if (!res.equals(targetSelector.getOKButton())) { |
|
|
440 |
targetSelector.setDestinationType(previousType); |
441 |
targetSelector.setCustomDirectpry(previousDirectory); |
429 |
return SELECTING_TARGET_CANCELLED; |
442 |
return SELECTING_TARGET_CANCELLED; |
430 |
} |
443 |
} |
431 |
|
444 |
|
Lines 433-438
Link Here
|
433 |
int destinationType = targetSelector.getDestinationType(); |
446 |
int destinationType = targetSelector.getDestinationType(); |
434 |
|
447 |
|
435 |
if (destinationType == ChooseHeapdumpTargetPanel.DESTINATION_DEFAULT) { |
448 |
if (destinationType == ChooseHeapdumpTargetPanel.DESTINATION_DEFAULT) { |
|
|
449 |
targetSelector.setCustomDirectpry(previousDirectory); |
436 |
return getCurrentHeapDumpFilename(null); |
450 |
return getCurrentHeapDumpFilename(null); |
437 |
} else if (destinationType == ChooseHeapdumpTargetPanel.DESTINATION_CUSTOM) { |
451 |
} else if (destinationType == ChooseHeapdumpTargetPanel.DESTINATION_CUSTOM) { |
438 |
return getCurrentHeapDumpFilename(targetSelector.getCustomDirectory()); |
452 |
return getCurrentHeapDumpFilename(targetSelector.getCustomDirectory()); |