|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2009, 2011 IBM Corporation and others. |
2 |
* Copyright (c) 2009, 2012 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 28-33
Link Here
|
| 28 |
import org.eclipse.wst.server.core.ServerCore; |
28 |
import org.eclipse.wst.server.core.ServerCore; |
| 29 |
import org.eclipse.wst.server.ui.internal.DeleteServerDialog; |
29 |
import org.eclipse.wst.server.ui.internal.DeleteServerDialog; |
| 30 |
import org.eclipse.wst.server.ui.internal.Messages; |
30 |
import org.eclipse.wst.server.ui.internal.Messages; |
|
|
31 |
import org.eclipse.wst.server.ui.internal.Trace; |
| 31 |
/** |
32 |
/** |
| 32 |
* This global delete action handles both the server and module deletion. |
33 |
* This global delete action handles both the server and module deletion. |
| 33 |
*/ |
34 |
*/ |
|
Lines 174-179
Link Here
|
| 174 |
} |
175 |
} |
| 175 |
|
176 |
|
| 176 |
protected void deleteServer(IServer server){ |
177 |
protected void deleteServer(IServer server){ |
|
|
178 |
// It is possible that the server is created and added to the server view on workbench |
| 179 |
// startup. As a result, when the user switches to the server view, the server is |
| 180 |
// selected, but the selectionChanged event is not called, which results in servers |
| 181 |
// being null. When servers is null the server will not be deleted and the error log |
| 182 |
// will have an IllegalArgumentException. |
| 183 |
// |
| 184 |
// To handle the case where servers is null, the selectionChanged method is called |
| 185 |
// to ensure servers will be populated. |
| 186 |
if (servers == null){ |
| 187 |
if (Trace.FINEST) { |
| 188 |
Trace.trace(Trace.STRING_FINEST, "Delete server called when servers is null"); |
| 189 |
} |
| 190 |
|
| 191 |
IStructuredSelection sel = getStructuredSelection(); |
| 192 |
if (sel != null){ |
| 193 |
selectionChanged(sel); |
| 194 |
} |
| 195 |
} |
| 196 |
|
| 197 |
if (Trace.FINEST) { |
| 198 |
Trace.trace(Trace.STRING_FINEST, "Opening delete server dialog with parameters shell=" |
| 199 |
+ shell + " servers=" + servers + " configs=" + configs); |
| 200 |
} |
| 201 |
|
| 202 |
// No check is made for valid parameters at this point, since if there is a failure, it |
| 203 |
// should be output to the error log instead of failing silently. |
| 204 |
|
| 177 |
DeleteServerDialog dsd = new DeleteServerDialog(shell, servers, configs); |
205 |
DeleteServerDialog dsd = new DeleteServerDialog(shell, servers, configs); |
| 178 |
dsd.open(); |
206 |
dsd.open(); |
| 179 |
} |
207 |
} |