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
36139183
Unverified
Commit
36139183
authored
Mar 30, 2020
by
Evan W. Patton
Committed by
GitHub
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add event listener only if selecting a component (#2132)
Change-Id: Id459b7a5963b8a8e2d64a674e0f35090621fac6a
parent
ebab28de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaFormEditor.java
.../appinventor/client/editor/youngandroid/YaFormEditor.java
+8
-6
No files found.
appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaFormEditor.java
View file @
36139183
...
...
@@ -376,7 +376,7 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
public
void
onComponentRenamed
(
MockComponent
component
,
String
oldName
)
{
if
(
loadComplete
)
{
onFormStructureChange
();
updatePropertiesPanel
(
form
.
getSelectedComponents
());
updatePropertiesPanel
(
form
.
getSelectedComponents
()
,
true
);
}
else
{
OdeLog
.
elog
(
"onComponentRenamed called when loadComplete is false"
);
}
...
...
@@ -386,7 +386,7 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
public
void
onComponentSelectionChange
(
MockComponent
component
,
boolean
selected
)
{
if
(
loadComplete
)
{
sourceStructureExplorer
.
selectItem
(
component
.
getSourceStructureExplorerItem
());
updatePropertiesPanel
(
form
.
getSelectedComponents
());
updatePropertiesPanel
(
form
.
getSelectedComponents
()
,
selected
);
}
else
{
OdeLog
.
elog
(
"onComponentSelectionChange called when loadComplete is false"
);
}
...
...
@@ -702,14 +702,14 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
// Set the properties box's content.
PropertiesBox
propertiesBox
=
PropertiesBox
.
getPropertiesBox
();
propertiesBox
.
setContent
(
designProperties
);
updatePropertiesPanel
(
form
.
getSelectedComponents
());
updatePropertiesPanel
(
form
.
getSelectedComponents
()
,
true
);
propertiesBox
.
setVisible
(
true
);
}
/*
* Show the given component's properties in the properties panel.
*/
private
void
updatePropertiesPanel
(
List
<
MockComponent
>
components
)
{
private
void
updatePropertiesPanel
(
List
<
MockComponent
>
components
,
boolean
selected
)
{
if
(
components
==
null
||
components
.
size
()
==
0
)
{
throw
new
IllegalArgumentException
(
"components must be a list of at least 1"
);
}
...
...
@@ -767,7 +767,9 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
}
selectedProperties
=
newProperties
;
}
selectedProperties
.
addPropertyChangeListener
(
this
);
if
(
selected
)
{
selectedProperties
.
addPropertyChangeListener
(
this
);
}
designProperties
.
setProperties
(
selectedProperties
);
if
(
components
.
size
()
>
1
)
{
designProperties
.
setPropertiesCaption
(
components
.
size
()
+
" components selected"
);
...
...
@@ -918,7 +920,7 @@ public final class YaFormEditor extends SimpleEditor implements FormChangeListen
//Update Mock Components
updateMockComponents
(
componentTypes
);
//Update the Properties Panel
updatePropertiesPanel
(
form
.
getSelectedComponents
());
updatePropertiesPanel
(
form
.
getSelectedComponents
()
,
true
);
}
@Override
...
...
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