|
Lines 1-5
Link Here
|
| 1 |
/********************************************************************** |
1 |
/********************************************************************** |
| 2 |
* Copyright (c) 2005, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2008 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 18-23
Link Here
|
| 18 |
import java.util.Vector; |
18 |
import java.util.Vector; |
| 19 |
|
19 |
|
| 20 |
import org.eclipse.core.resources.IContainer; |
20 |
import org.eclipse.core.resources.IContainer; |
|
|
21 |
import org.eclipse.core.resources.IFile; |
| 21 |
import org.eclipse.core.resources.IResource; |
22 |
import org.eclipse.core.resources.IResource; |
| 22 |
import org.eclipse.core.resources.IResourceStatus; |
23 |
import org.eclipse.core.resources.IResourceStatus; |
| 23 |
import org.eclipse.core.resources.ResourcesPlugin; |
24 |
import org.eclipse.core.resources.ResourcesPlugin; |
|
Lines 71-76
Link Here
|
| 71 |
|
72 |
|
| 72 |
private ArrayList deletedPaths = new ArrayList(); |
73 |
private ArrayList deletedPaths = new ArrayList(); |
| 73 |
|
74 |
|
|
|
75 |
public final static String SD_FILE_EXTENSION = "trcdbxmi"; |
| 76 |
public final static String SYMPTOM_FILE_EXTENSION = "symptom"; |
| 77 |
|
| 74 |
/** |
78 |
/** |
| 75 |
* This dialog box asks the user whether they also want to delete the files saved on the |
79 |
* This dialog box asks the user whether they also want to delete the files saved on the |
| 76 |
* file system. This dialog box is only presented when the user saves their data and tries |
80 |
* file system. This dialog box is only presented when the user saves their data and tries |
|
Lines 206-211
Link Here
|
| 206 |
/* true if only log files are being deleted, false otherwise */ |
210 |
/* true if only log files are being deleted, false otherwise */ |
| 207 |
boolean LogDeleteDialog = true; |
211 |
boolean LogDeleteDialog = true; |
| 208 |
|
212 |
|
|
|
213 |
boolean isSymptomCatalogResourceIncluded = false; |
| 214 |
boolean isOnlyDeletingSymptomCatalogResource = true; |
| 215 |
|
| 209 |
/* Navid Mehregani - bugzilla 158564: A different dialog box should be displayed if we're only deleting |
216 |
/* Navid Mehregani - bugzilla 158564: A different dialog box should be displayed if we're only deleting |
| 210 |
* log files. This was brought up as a usability issue in the RCP log analyzer. */ |
217 |
* log files. This was brought up as a usability issue in the RCP log analyzer. */ |
| 211 |
for (int i = 0; i < fSelections.length; i++) |
218 |
for (int i = 0; i < fSelections.length; i++) |
|
Lines 214-219
Link Here
|
| 214 |
|
221 |
|
| 215 |
if ((sel != null) && (sel instanceof EObject)) |
222 |
if ((sel != null) && (sel instanceof EObject)) |
| 216 |
{ |
223 |
{ |
|
|
224 |
isOnlyDeletingSymptomCatalogResource = false; |
| 225 |
|
| 217 |
Vector agentTypeList = new Vector(); |
226 |
Vector agentTypeList = new Vector(); |
| 218 |
|
227 |
|
| 219 |
if (sel instanceof TRCMonitor) |
228 |
if (sel instanceof TRCMonitor) |
|
Lines 239-244
Link Here
|
| 239 |
break; /* Break out of the first loop */ |
248 |
break; /* Break out of the first loop */ |
| 240 |
} |
249 |
} |
| 241 |
} |
250 |
} |
|
|
251 |
} else if ((sel != null) && (sel instanceof IFile)) { |
| 252 |
IFile file = (IFile) sel; |
| 253 |
String ext = file.getFileExtension(); |
| 254 |
if (ext != null) { |
| 255 |
if (ext.equals(SD_FILE_EXTENSION) || ext.equals(SYMPTOM_FILE_EXTENSION)) { |
| 256 |
isSymptomCatalogResourceIncluded = true; |
| 257 |
} else { |
| 258 |
isOnlyDeletingSymptomCatalogResource = false; |
| 259 |
} |
| 260 |
} else { |
| 261 |
isOnlyDeletingSymptomCatalogResource = false; |
| 262 |
} |
| 263 |
} else { |
| 264 |
isOnlyDeletingSymptomCatalogResource = false; |
| 242 |
} |
265 |
} |
| 243 |
} |
266 |
} |
| 244 |
/* End of bugzilla 158564 */ |
267 |
/* End of bugzilla 158564 */ |
|
Lines 307-313
Link Here
|
| 307 |
if (LogDeleteDialog) |
330 |
if (LogDeleteDialog) |
| 308 |
{ |
331 |
{ |
| 309 |
/* N.M - bugzilla 158564 */ |
332 |
/* N.M - bugzilla 158564 */ |
| 310 |
ConfirmDeletionDialog confirmDeletionDialog = new ConfirmDeletionDialog(fViewer.getViewSite().getShell(), CommonUITraceMessages.DEL_TITLE, CommonUITraceMessages.CONFIRM_LOG_DEL); |
333 |
String message = null; |
|
|
334 |
if (isSymptomCatalogResourceIncluded) { |
| 335 |
if (isOnlyDeletingSymptomCatalogResource) { |
| 336 |
message = CommonUITraceMessages.CONFIRM_SYMPTOMCATALOG_DEL; |
| 337 |
} else { |
| 338 |
message = CommonUITraceMessages.CONFIRM_DELM; |
| 339 |
} |
| 340 |
} else { |
| 341 |
message = CommonUITraceMessages.CONFIRM_LOG_DEL; |
| 342 |
} |
| 343 |
ConfirmDeletionDialog confirmDeletionDialog = new ConfirmDeletionDialog(fViewer.getViewSite().getShell(), CommonUITraceMessages.DEL_TITLE, message); |
| 311 |
if (confirmDeletionDialog.open() != 0) |
344 |
if (confirmDeletionDialog.open() != 0) |
| 312 |
return; |
345 |
return; |
| 313 |
|
346 |
|