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
cc80c3f8
Commit
cc80c3f8
authored
Nov 29, 2016
by
Michael J Gallagher
Committed by
Evan W. Patton
Aug 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reimplement delete component confirm dialog in GWT
Close #852 Change-Id: I99e8fea50b5d0632bb935183fe90c9a1b2c7bdd4
parent
61aa36dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockComponent.java
...ventor/client/editor/simple/components/MockComponent.java
+39
-3
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockComponent.java
View file @
cc80c3f8
...
...
@@ -212,6 +212,44 @@ public abstract class MockComponent extends Composite implements PropertyChangeL
}
}
/**
* This class defines the dialog box for deleting a component.
*/
private
class
DeleteDialog
extends
DialogBox
{
DeleteDialog
()
{
super
(
false
,
true
);
setStylePrimaryName
(
"ode-DialogBox"
);
setText
(
MESSAGES
.
deleteComponentButton
());
VerticalPanel
contentPanel
=
new
VerticalPanel
();
contentPanel
.
add
(
new
HTML
(
MESSAGES
.
reallyDeleteComponent
()));
Button
cancelButton
=
new
Button
(
MESSAGES
.
cancelButton
());
cancelButton
.
addClickHandler
(
new
ClickHandler
()
{
@Override
public
void
onClick
(
ClickEvent
event
)
{
hide
();
}
});
Button
okButton
=
new
Button
(
MESSAGES
.
okButton
());
okButton
.
addClickHandler
(
new
ClickHandler
()
{
@Override
public
void
onClick
(
ClickEvent
event
)
{
hide
();
MockComponent
.
this
.
delete
();
}
});
HorizontalPanel
buttonPanel
=
new
HorizontalPanel
();
buttonPanel
.
add
(
cancelButton
);
buttonPanel
.
add
(
okButton
);
buttonPanel
.
setSize
(
"100%"
,
"24px"
);
contentPanel
.
add
(
buttonPanel
);
contentPanel
.
setSize
(
"320px"
,
"100%"
);
add
(
contentPanel
);
}
}
// Component database: information about components (including their properties and events)
private
final
SimpleComponentDatabase
COMPONENT_DATABASE
;
...
...
@@ -302,9 +340,7 @@ public abstract class MockComponent extends Composite implements PropertyChangeL
@Override
public
void
delete
()
{
if
(!
isForm
())
{
if
(
Window
.
confirm
(
MESSAGES
.
reallyDeleteComponent
()))
{
MockComponent
.
this
.
delete
();
}
new
DeleteDialog
().
center
();
}
}
};
...
...
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