Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
8018e39f
Commit
8018e39f
authored
Dec 11, 2017
by
ColinTree
Committed by
Evan W. Patton
Dec 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Escape & Enter for confirm dialog when delete a component
Closes #1038 Fixes #1037
parent
ad9806da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockComponent.java
...ventor/client/editor/simple/components/MockComponent.java
+17
-0
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockComponent.java
View file @
8018e39f
...
@@ -39,6 +39,8 @@ import com.google.appinventor.shared.simple.ComponentDatabaseInterface;
...
@@ -39,6 +39,8 @@ import com.google.appinventor.shared.simple.ComponentDatabaseInterface;
import
com.google.appinventor.shared.storage.StorageUtil
;
import
com.google.appinventor.shared.storage.StorageUtil
;
import
com.google.gwt.event.dom.client.ClickEvent
;
import
com.google.gwt.event.dom.client.ClickEvent
;
import
com.google.gwt.event.dom.client.ClickHandler
;
import
com.google.gwt.event.dom.client.ClickHandler
;
import
com.google.gwt.event.dom.client.FocusEvent
;
import
com.google.gwt.event.dom.client.FocusHandler
;
import
com.google.gwt.event.dom.client.KeyCodes
;
import
com.google.gwt.event.dom.client.KeyCodes
;
import
com.google.gwt.event.dom.client.KeyUpEvent
;
import
com.google.gwt.event.dom.client.KeyUpEvent
;
import
com.google.gwt.event.dom.client.KeyUpHandler
;
import
com.google.gwt.event.dom.client.KeyUpHandler
;
...
@@ -46,6 +48,7 @@ import com.google.gwt.user.client.Command;
...
@@ -46,6 +48,7 @@ import com.google.gwt.user.client.Command;
import
com.google.gwt.user.client.DOM
;
import
com.google.gwt.user.client.DOM
;
import
com.google.gwt.user.client.DeferredCommand
;
import
com.google.gwt.user.client.DeferredCommand
;
import
com.google.gwt.user.client.Event
;
import
com.google.gwt.user.client.Event
;
import
com.google.gwt.user.client.Event.NativePreviewEvent
;
import
com.google.gwt.user.client.Random
;
import
com.google.gwt.user.client.Random
;
import
com.google.gwt.user.client.Window
;
import
com.google.gwt.user.client.Window
;
import
com.google.gwt.user.client.ui.Button
;
import
com.google.gwt.user.client.ui.Button
;
...
@@ -248,6 +251,20 @@ public abstract class MockComponent extends Composite implements PropertyChangeL
...
@@ -248,6 +251,20 @@ public abstract class MockComponent extends Composite implements PropertyChangeL
add
(
contentPanel
);
add
(
contentPanel
);
}
}
@Override
protected
void
onPreviewNativeEvent
(
NativePreviewEvent
event
)
{
super
.
onPreviewNativeEvent
(
event
);
switch
(
event
.
getTypeInt
())
{
case
Event
.
ONKEYDOWN
:
if
(
event
.
getNativeEvent
().
getKeyCode
()
==
KeyCodes
.
KEY_ESCAPE
)
{
hide
();
}
else
if
(
event
.
getNativeEvent
().
getKeyCode
()
==
KeyCodes
.
KEY_ENTER
)
{
hide
();
MockComponent
.
this
.
delete
();
}
break
;
}
}
}
}
// Component database: information about components (including their properties and events)
// Component database: information about components (including their properties and events)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment