View | Details | Raw Unified | Return to bug 23146
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/messages.properties (-2 / +2 lines)
Lines 434-441 Link Here
434
PerspectivesPreference_DeleteTip = Delete a User Defined Perspective
434
PerspectivesPreference_DeleteTip = Delete a User Defined Perspective
435
PerspectivesPreference_available = Available &perspectives:
435
PerspectivesPreference_available = Available &perspectives:
436
PerspectivesPreference_defaultLabel = {0} (default)
436
PerspectivesPreference_defaultLabel = {0} (default)
437
PerspectivesPreference_cannotdelete_title=Unable to delete perspective
437
PerspectivesPreference_perspectiveopen_title=Delete Perspective
438
PerspectivesPreference_cannotdelete_message=Unable to delete perspective ''{0}''. It has open instances.
438
PerspectivesPreference_perspectiveopen_message=Are you sure you want to delete the ''{0}'' perspective? It has open instances.
439
439
440
PerspectiveLabelProvider_unknown = Unknown Element Type
440
PerspectiveLabelProvider_unknown = Unknown Element Type
441
441
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java (-2 / +2 lines)
Lines 469-476 Link Here
469
	public static String PerspectivesPreference_DeleteTip;
469
	public static String PerspectivesPreference_DeleteTip;
470
	public static String PerspectivesPreference_available;
470
	public static String PerspectivesPreference_available;
471
	public static String PerspectivesPreference_defaultLabel;
471
	public static String PerspectivesPreference_defaultLabel;
472
	public static String PerspectivesPreference_cannotdelete_title;
472
	public static String PerspectivesPreference_perspectiveopen_title;
473
	public static String PerspectivesPreference_cannotdelete_message;
473
	public static String PerspectivesPreference_perspectiveopen_message;
474
474
475
	public static String PerspectiveLabelProvider_unknown;
475
	public static String PerspectiveLabelProvider_unknown;
476
476
(-)Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java (-10 / +22 lines)
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
}

Return to bug 23146