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 197658 Details for
Bug 348792
[client] can't esc key assist panel when the editor has focus
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]
diff
bug348792.patch (text/plain), 4.94 KB, created by
Susan McCourt
on 2011-06-08 20:11:37 EDT
(
hide
)
Description:
diff
Filename:
MIME Type:
Creator:
Susan McCourt
Created:
2011-06-08 20:11:37 EDT
Size:
4.94 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.core/web/edit/setup.js b/bundles/org.eclipse.orion.client.core/web/edit/setup.js >index 3669f71..ea4183a 100644 >--- a/bundles/org.eclipse.orion.client.core/web/edit/setup.js >+++ b/bundles/org.eclipse.orion.client.core/web/edit/setup.js >@@ -271,6 +271,43 @@ exports.setUpEditor = function(isReadOnly){ > } > }; > >+ var escHandler = { >+ handlers: [], >+ >+ addHandler: function(handler) { >+ this.handlers.push(handler); >+ }, >+ >+ cancel: function() { >+ var handled = false; >+ // To be safe, we give all our handlers a chance, not just the first one. >+ // In case the user has left multiple modal popups open (such as key assist and search) >+ for (var i=0; i<this.handlers.length; i++) { >+ handled = this.handlers[i].cancel() || handled; >+ } >+ return handled; >+ }, >+ >+ isActive: function() { >+ for (var i=0; i<this.handlers.length; i++) { >+ if (this.handlers[i].isActive()) { >+ return true; >+ } >+ } >+ return false; >+ }, >+ >+ lineUp: function() { >+ return false; >+ }, >+ lineDown: function() { >+ return false; >+ }, >+ enter: function() { >+ return false; >+ } >+ }; >+ > var keyBindingFactory = function(editor, keyModeStack, undoStack, contentAssist) { > // Register commands that depend on external services, the registry, etc. > var commandGenerator = new mEditorCommands.EditorCommandFactory(serviceRegistry, commandService, fileClient, inputManager, "pageActions", isReadOnly); >@@ -285,6 +322,9 @@ exports.setUpEditor = function(isReadOnly){ > var codeBindings = new mEditorFeatures.SourceCodeActions(editor, undoStack, contentAssist); > keyModeStack.push(codeBindings); > >+ // give our external escape handler a shot at handling escape >+ keyModeStack.push(escHandler); >+ > // global search > editor.getTextView().setKeyBinding(new mKeyBinding.KeyBinding("h", true), "Search Files"); > editor.getTextView().setAction("Search Files", function() { >@@ -299,9 +339,27 @@ exports.setUpEditor = function(isReadOnly){ > } if (!searchPattern) { > return; > } >- searchFloat.onclick = function() { >- searchFloat.style.display = "none"; >+ dojo.connect(document, "onkeypress", dojo.hitch(this, function (e){ >+ if (e.charOrCode === dojo.keys.ESCAPE) { >+ searchFloat.style.display = "none"; >+ } >+ })); >+ >+ var searchFloatEscHandler = { >+ isActive: function() { >+ return searchFloat.style.display === "block"; >+ }, >+ >+ cancel: function() { >+ if (this.isActive()) { >+ searchFloat.style.display = "none"; >+ return true; >+ } >+ return false; // not handled >+ } > }; >+ escHandler.addHandler(searchFloatEscHandler); >+ > // TEMPORARY until we can better scope the search > var extensionFilter = ""; > var fileName = inputManager.getTitle(); >@@ -382,7 +440,7 @@ exports.setUpEditor = function(isReadOnly){ > inputManager.setInput(dojo.hash(), editor); > > // TODO search location needs to be gotten from somewhere >- mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, prefsService, searcher, editor, editor); >+ mGlobalCommands.generateBanner("toolbar", serviceRegistry, commandService, prefsService, searcher, editor, editor, escHandler); > mGlobalCommands.generateDomCommandsInBanner(commandService, editor); > > var syntaxChecker = new mSyntaxchecker.SyntaxChecker(serviceRegistry, editor); >diff --git a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js >index e950c0c..2aa67b0 100644 >--- a/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js >+++ b/bundles/org.eclipse.orion.client.core/web/orion/globalCommands.js >@@ -151,7 +151,7 @@ define(['dojo', 'dijit', 'orion/commands', 'orion/util', 'orion/textview/keyBind > * @name orion.globalCommands#generateBanner > * @function > */ >- function generateBanner(parentId, serviceRegistry, commandService, prefsService, searcher, handler, editor) { >+ function generateBanner(parentId, serviceRegistry, commandService, prefsService, searcher, handler, /* optional */ editor, /* optional */ escapeProvider) { > // this needs to come from somewhere but I'm not going to do a separate get for it > var searchLocation = "/filesearch?q="; > var text; >@@ -262,6 +262,23 @@ define(['dojo', 'dijit', 'orion/commands', 'orion/util', 'orion/textview/keyBind > } > })); > >+ if (escapeProvider) { >+ var keyAssistEscHandler = { >+ isActive: function() { >+ return keyAssistNode.style.display === "block"; >+ }, >+ >+ cancel: function() { >+ if (this.isActive()) { >+ keyAssistNode.style.display = "none"; >+ return true; >+ } >+ return false; // not handled >+ } >+ }; >+ escapeProvider.addHandler(keyAssistEscHandler); >+ } >+ > var keyAssistCommand = new mCommands.Command({ > name: "Show Keys", > id: "eclipse.keyAssist",
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 348792
: 197658