1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +02:00

Bug 478544 - Add disposed check for table.

Change-Id: I54791dcd902b9013ba3e8495934f1cd0e5161086
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2015-09-28 09:54:01 -04:00
parent 1c6ec90b9d
commit e1651ff166

View file

@ -236,8 +236,8 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
private void addConnection() { private void addConnection() {
if (fIsDirty) { if (fIsDirty) {
MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null, MessageDialog dialog = new MessageDialog(getShell(), Messages.ConnectionsPreferencePage_Confirm_Actions, null,
Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION, new String[] { Messages.ConnectionsPreferencePage_There_are_unsaved_changes, MessageDialog.QUESTION,
IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0); new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0);
if (dialog.open() == 1) { if (dialog.open() == 1) {
return; return;
} }
@ -250,7 +250,9 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
IRemoteConnectionWorkingCopy conn = wizard.open(); IRemoteConnectionWorkingCopy conn = wizard.open();
if (conn != null) { if (conn != null) {
fWorkingCopies.put(conn.getName(), conn); fWorkingCopies.put(conn.getName(), conn);
fConnectionViewer.refresh(); if (!fConnectionViewer.getTable().isDisposed()) {
fConnectionViewer.refresh();
}
fIsDirty = true; fIsDirty = true;
} }
} }
@ -595,17 +597,14 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
IRemoteConnection conn = getOriginalIfClean(fSelectedConnection); IRemoteConnection conn = getOriginalIfClean(fSelectedConnection);
if (conn.hasService(IRemoteConnectionControlService.class)) { if (conn.hasService(IRemoteConnectionControlService.class)) {
if (!conn.isOpen()) { if (!conn.isOpen()) {
fEditButton fEditButton.setEnabled(conn.getConnectionType().canEdit());
.setEnabled(conn.getConnectionType().canEdit()); fRemoveButton.setEnabled(conn.getConnectionType().canRemove());
fRemoveButton
.setEnabled(conn.getConnectionType().canRemove());
fOpenButton.setEnabled(true); fOpenButton.setEnabled(true);
} else { } else {
fCloseButton.setEnabled(true); fCloseButton.setEnabled(true);
} }
} else { } else {
fEditButton fEditButton.setEnabled(conn.getConnectionType().canEdit());
.setEnabled(conn.getConnectionType().canEdit());
} }
} }
} }