Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2007 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 502-513
Link Here
|
502 |
for (int j = 0; j < pages.length; j++) { |
502 |
for (int j = 0; j < pages.length; j++) { |
503 |
WorkbenchPage page = (WorkbenchPage) pages[j]; |
503 |
WorkbenchPage page = (WorkbenchPage) pages[j]; |
504 |
if (page.findPerspective(desc) != null) { |
504 |
if (page.findPerspective(desc) != null) { |
505 |
MessageDialog |
505 |
if (!MessageDialog |
506 |
.openInformation( |
506 |
.openQuestion( |
507 |
getShell(), |
507 |
getShell(), |
508 |
WorkbenchMessages.PerspectivesPreference_cannotdelete_title, |
508 |
WorkbenchMessages.PerspectivesPreference_perspectiveopen_title, |
509 |
NLS.bind(WorkbenchMessages.PerspectivesPreference_cannotdelete_message,desc.getLabel())); |
509 |
NLS.bind(WorkbenchMessages.PerspectivesPreference_perspectiveopen_message, desc.getLabel()))) { |
510 |
return true; |
510 |
return true; |
|
|
511 |
} |
511 |
} |
512 |
} |
512 |
} |
513 |
} |
513 |
} |
514 |
} |
Lines 526-531
Link Here
|
526 |
|
527 |
|
527 |
//Delete the perspective |
528 |
//Delete the perspective |
528 |
if(perspectives.size()<perspectiveRegistry.getPerspectives().length) { |
529 |
if(perspectives.size()<perspectiveRegistry.getPerspectives().length) { |
|
|
530 |
IWorkbenchWindow windows[] = workbench.getWorkbenchWindows(); |
531 |
|
532 |
// close any perspectives that are about to be deleted |
533 |
for (int i = 0; i < windows.length; i++) { |
534 |
IWorkbenchPage pages[] = windows[i].getPages(); |
535 |
for (int j = 0; j < pages.length; j++) { |
536 |
WorkbenchPage page = (WorkbenchPage) pages[j]; |
537 |
for (int k = 0; k < perspToDelete.size(); k++) { |
538 |
IPerspectiveDescriptor desc = (IPerspectiveDescriptor) perspToDelete.get(k); |
539 |
if (page.findPerspective(desc) != null) { |
540 |
page.closePerspective(desc, true, true); |
541 |
} |
542 |
} |
543 |
} |
544 |
} |
529 |
perspectiveRegistry.deletePerspectives(perspToDelete); |
545 |
perspectiveRegistry.deletePerspectives(perspToDelete); |
530 |
} |
546 |
} |
531 |
|
547 |
|
Lines 654-661
Link Here
|
654 |
|
670 |
|
655 |
updateButtons(); |
671 |
updateButtons(); |
656 |
} |
672 |
} |
657 |
|
|
|
658 |
public void dispose() { |
659 |
super.dispose(); |
660 |
} |
661 |
} |
673 |
} |