Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 79030 Details for
Bug 23146
[Perspectives] Prompt when deleting an open Perspective
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to implement the suggested behaviour.
delete-perspective-patch.txt (text/plain), 4.79 KB, created by
Remy Suen
on 2007-09-22 17:25:56 EDT
(
hide
)
Description:
Patch to implement the suggested behaviour.
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2007-09-22 17:25:56 EDT
Size:
4.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/messages.properties,v >retrieving revision 1.361 >diff -u -r1.361 messages.properties >--- Eclipse UI/org/eclipse/ui/internal/messages.properties 10 Sep 2007 14:54:21 -0000 1.361 >+++ Eclipse UI/org/eclipse/ui/internal/messages.properties 22 Sep 2007 21:24:41 -0000 >@@ -434,8 +434,8 @@ > PerspectivesPreference_DeleteTip = Delete a User Defined Perspective > PerspectivesPreference_available = Available &perspectives: > PerspectivesPreference_defaultLabel = {0} (default) >-PerspectivesPreference_cannotdelete_title=Unable to delete perspective >-PerspectivesPreference_cannotdelete_message=Unable to delete perspective ''{0}''. It has open instances. >+PerspectivesPreference_perspectiveopen_title=Delete Perspective >+PerspectivesPreference_perspectiveopen_message=Are you sure you want to delete the ''{0}'' perspective? It has open instances. > > PerspectiveLabelProvider_unknown = Unknown Element Type > >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java,v >retrieving revision 1.91 >diff -u -r1.91 WorkbenchMessages.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java 29 Aug 2007 14:53:05 -0000 1.91 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java 22 Sep 2007 21:24:39 -0000 >@@ -469,8 +469,8 @@ > public static String PerspectivesPreference_DeleteTip; > public static String PerspectivesPreference_available; > public static String PerspectivesPreference_defaultLabel; >- public static String PerspectivesPreference_cannotdelete_title; >- public static String PerspectivesPreference_cannotdelete_message; >+ public static String PerspectivesPreference_perspectiveopen_title; >+ public static String PerspectivesPreference_perspectiveopen_message; > > public static String PerspectiveLabelProvider_unknown; > >Index: Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java,v >retrieving revision 1.34 >diff -u -r1.34 PerspectivesPreferencePage.java >--- Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java 8 May 2006 20:55:45 -0000 1.34 >+++ Eclipse UI/org/eclipse/ui/internal/dialogs/PerspectivesPreferencePage.java 22 Sep 2007 21:24:42 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -502,12 +502,13 @@ > for (int j = 0; j < pages.length; j++) { > WorkbenchPage page = (WorkbenchPage) pages[j]; > if (page.findPerspective(desc) != null) { >- MessageDialog >- .openInformation( >+ if (!MessageDialog >+ .openQuestion( > getShell(), >- WorkbenchMessages.PerspectivesPreference_cannotdelete_title, >- NLS.bind(WorkbenchMessages.PerspectivesPreference_cannotdelete_message,desc.getLabel())); >- return true; >+ WorkbenchMessages.PerspectivesPreference_perspectiveopen_title, >+ NLS.bind(WorkbenchMessages.PerspectivesPreference_perspectiveopen_message, desc.getLabel()))) { >+ return true; >+ } > } > } > } >@@ -526,6 +527,21 @@ > > //Delete the perspective > if(perspectives.size()<perspectiveRegistry.getPerspectives().length) { >+ IWorkbenchWindow windows[] = workbench.getWorkbenchWindows(); >+ >+ // close any perspectives that are about to be deleted >+ for (int i = 0; i < windows.length; i++) { >+ IWorkbenchPage pages[] = windows[i].getPages(); >+ for (int j = 0; j < pages.length; j++) { >+ WorkbenchPage page = (WorkbenchPage) pages[j]; >+ for (int k = 0; k < perspToDelete.size(); k++) { >+ IPerspectiveDescriptor desc = (IPerspectiveDescriptor) perspToDelete.get(k); >+ if (page.findPerspective(desc) != null) { >+ page.closePerspective(desc, true, true); >+ } >+ } >+ } >+ } > perspectiveRegistry.deletePerspectives(perspToDelete); > } > >@@ -654,8 +670,4 @@ > > updateButtons(); > } >- >- public void dispose() { >- super.dispose(); >- } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 23146
: 79030