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 149908 Details for
Bug 94153
[Dialogs] [KeyBindings] Command+W should close dialogs on OS X
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]
Patch v01
Command+W 01.txt (text/plain), 3.85 KB, created by
Prakash Rangaraj
on 2009-10-19 14:48:09 EDT
(
hide
)
Description:
Patch v01
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2009-10-19 14:48:09 EDT
Size:
3.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.cocoa >Index: fragment-cocoa.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.cocoa/fragment-cocoa.properties,v >retrieving revision 1.1 >diff -u -r1.1 fragment-cocoa.properties >--- fragment-cocoa.properties 7 Nov 2008 14:46:13 -0000 1.1 >+++ fragment-cocoa.properties 19 Oct 2009 18:36:53 -0000 >@@ -12,3 +12,6 @@ > > providerName=Eclipse.org > fragmentName=Eclipse UI MacOS X Enhancements >+ >+command.closeDialog.name=Close Dialog >+command.closeDialog.desc=Closes the active Dialog >\ No newline at end of file >Index: fragment.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.cocoa/fragment.xml,v >retrieving revision 1.1 >diff -u -r1.1 fragment.xml >--- fragment.xml 7 Nov 2008 14:46:13 -0000 1.1 >+++ fragment.xml 19 Oct 2009 18:36:53 -0000 >@@ -8,5 +8,30 @@ > class="org.eclipse.ui.internal.cocoa.CocoaUIEnhancer"> > </startup> > </extension> >+ <extension >+ point="org.eclipse.ui.commands"> >+ <command >+ categoryId="org.eclipse.ui.category.dialogs" >+ description="%command.closeDialog.desc" >+ id="org.eclipse.ui.cocoa.closeDialog" >+ name="%command.closeDialog.name"> >+ </command> >+ </extension> >+ <extension >+ point="org.eclipse.ui.handlers"> >+ <handler >+ class="org.eclipse.ui.internal.cocoa.CloseDialogHandler" >+ commandId="org.eclipse.ui.cocoa.closeDialog"> >+ </handler> >+ </extension> >+ <extension >+ point="org.eclipse.ui.bindings"> >+ <key >+ commandId="org.eclipse.ui.cocoa.closeDialog" >+ contextId="org.eclipse.ui.contexts.dialog" >+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" >+ sequence="M1+W"> >+ </key> >+ </extension> > > </fragment> >Index: src/org/eclipse/ui/internal/cocoa/CloseDialogHandler.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/cocoa/CloseDialogHandler.java >diff -N src/org/eclipse/ui/internal/cocoa/CloseDialogHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/internal/cocoa/CloseDialogHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,49 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 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.cocoa; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.commands.IHandler; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.window.Window; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.swt.widgets.Shell; >+ >+/** >+ * >+ * @author Prakash G.R. (grprakash@gmail.com) >+ * @since 3.6 >+ * >+ */ >+public class CloseDialogHandler extends AbstractHandler implements IHandler { >+ >+ public Object execute(ExecutionEvent event) throws ExecutionException { >+ >+ Shell activeShell = Display.getDefault().getActiveShell(); >+ if((activeShell.getStyle() & SWT.CLOSE) == 0) { >+ // if close not enabled, do nothing >+ return null; >+ } >+ >+ Object data = activeShell.getData(); >+ if(data instanceof Dialog) { >+ Dialog dialog = (Dialog) data; >+ dialog.setReturnCode(Window.CANCEL); >+ dialog.close(); >+ } >+ >+ return null; >+ } >+ >+}
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 94153
:
149908
|
151671
|
153417
|
153493