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 53478 Details for
Bug 77014
[Commands] request: Provide close view command and binding
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
close part patch v02
closePart-patch.txt (text/plain), 4.30 KB, created by
Paul Webster
on 2006-11-08 13:38:46 EST
(
hide
)
Description:
close part patch v02
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2006-11-08 13:38:46 EST
Size:
4.30 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java >diff -N Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/handlers/ClosePartHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ui.internal.handlers; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.expressions.IEvaluationContext; >+import org.eclipse.ui.IEditorPart; >+import org.eclipse.ui.ISources; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.IWorkbenchPart; >+import org.eclipse.ui.IWorkbenchWindow; >+ >+/** >+ * Provide a Handler for the Close Part command. This can then be bound to >+ * whatever keybinding the user prefers. >+ * >+ * @since 3.3 >+ */ >+public class ClosePartHandler extends AbstractHandler { >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) >+ */ >+ public Object execute(ExecutionEvent event) throws ExecutionException { >+ IWorkbenchPart part = null; >+ IWorkbenchWindow window = null; >+ if (event.getApplicationContext() instanceof IEvaluationContext) { >+ IEvaluationContext appContext = (IEvaluationContext) event >+ .getApplicationContext(); >+ window = (IWorkbenchWindow) appContext >+ .getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME); >+ if (window == null) { >+ throw new ExecutionException("No active workbench window"); //$NON-NLS-1$ >+ } >+ part = (IWorkbenchPart) appContext >+ .getVariable(ISources.ACTIVE_PART_NAME); >+ if (part == null) { >+ throw new ExecutionException("No active part"); //$NON-NLS-1$ >+ } >+ } >+ >+ if (part instanceof IEditorPart) { >+ window.getActivePage().closeEditor((IEditorPart) part, true); >+ } else if (part instanceof IViewPart) { >+ window.getActivePage().hideView((IViewPart) part); >+ } >+ >+ return null; >+ } >+} >#P org.eclipse.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/plugin.xml,v >retrieving revision 1.355 >diff -u -r1.355 plugin.xml >--- plugin.xml 7 Nov 2006 15:04:13 -0000 1.355 >+++ plugin.xml 8 Nov 2006 18:41:41 -0000 >@@ -537,6 +537,12 @@ > categoryId="org.eclipse.ui.category.file" > id="org.eclipse.ui.file.close" /> > <command >+ categoryId="org.eclipse.ui.category.file" >+ defaultHandler="org.eclipse.ui.internal.handlers.ClosePartHandler" >+ description="%command.closePart.description" >+ id="org.eclipse.ui.file.closePart" >+ name="%command.closePart.name"/> >+ <command > name="%command.closeAll.name" > description="%command.closeAll.description" > categoryId="org.eclipse.ui.category.file" >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/plugin.properties,v >retrieving revision 1.176 >diff -u -r1.176 plugin.properties >--- plugin.properties 7 Nov 2006 15:04:13 -0000 1.176 >+++ plugin.properties 8 Nov 2006 18:41:41 -0000 >@@ -103,6 +103,8 @@ > command.backwardHistory.name = Backward History > command.close.description = Close the active editor > command.close.name = Close >+command.closePart.description = Close the active workbench part >+command.closePart.name = Close Part > command.closeAll.description = Close all editors > command.closeAll.name = Close All > command.closeOthers.description = Close all editors except the one that is active
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 77014
:
51093
| 53478