Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scene-builder-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Ask
scene-builder-plugin
Commits
eb96870a
There was a problem fetching the pipeline summary.
Commit
eb96870a
authored
7 years ago
by
Tobias Ask
Browse files
Options
Downloads
Patches
Plain Diff
Use helper methods where applicable.
parent
7fd9f5a9
No related branches found
No related tags found
1 merge request
!5
Resolve "Weak connection to controller class"
Pipeline
#
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sb4e.examples/src/no/tobask/sb4e/examples/GreatFxmlController.java
+4
-0
4 additions, 0 deletions
...ples/src/no/tobask/sb4e/examples/GreatFxmlController.java
sb4e/src/no/tobask/sb4e/JavaProjectGlossary.java
+2
-8
2 additions, 8 deletions
sb4e/src/no/tobask/sb4e/JavaProjectGlossary.java
with
6 additions
and
8 deletions
sb4e.examples/src/no/tobask/sb4e/examples/GreatFxmlController.java
+
4
−
0
View file @
eb96870a
...
@@ -2,9 +2,13 @@ package no.tobask.sb4e.examples;
...
@@ -2,9 +2,13 @@ package no.tobask.sb4e.examples;
import
javafx.event.ActionEvent
;
import
javafx.event.ActionEvent
;
import
javafx.fxml.FXML
;
import
javafx.fxml.FXML
;
import
javafx.scene.control.Button
;
public
class
GreatFxmlController
{
public
class
GreatFxmlController
{
@FXML
Button
button
;
@FXML
@FXML
private
void
onSomething
(
ActionEvent
event
)
{
private
void
onSomething
(
ActionEvent
event
)
{
...
...
This diff is collapsed.
Click to expand it.
sb4e/src/no/tobask/sb4e/JavaProjectGlossary.java
+
2
−
8
View file @
eb96870a
...
@@ -70,7 +70,7 @@ public class JavaProjectGlossary extends Glossary implements IElementChangedList
...
@@ -70,7 +70,7 @@ public class JavaProjectGlossary extends Glossary implements IElementChangedList
ICompilationUnit
controller
=
discoverController
(
fxmlLocation
,
controllerClass
);
ICompilationUnit
controller
=
discoverController
(
fxmlLocation
,
controllerClass
);
fxIds
=
controller
==
null
?
new
HashMap
<>()
:
getFxIds
(
controller
);
fxIds
=
controller
==
null
?
new
HashMap
<>()
:
getFxIds
(
controller
);
}
}
return
fxIds
.
getOrDefault
(
getClass
Name
(
targetType
),
new
ArrayList
<>());
return
fxIds
.
getOrDefault
(
Signature
.
getSimple
Name
(
targetType
.
getName
()
),
new
ArrayList
<>());
}
}
@Override
@Override
...
@@ -196,11 +196,6 @@ public class JavaProjectGlossary extends Glossary implements IElementChangedList
...
@@ -196,11 +196,6 @@ public class JavaProjectGlossary extends Glossary implements IElementChangedList
return
null
;
return
null
;
}
}
private
String
getClassName
(
Class
<?>
clas
)
{
int
classNameStartIdx
=
clas
.
getName
().
lastIndexOf
(
"."
)
+
1
;
return
clas
.
getName
().
substring
(
classNameStartIdx
);
}
private
List
<
String
>
getEventHandlers
(
ICompilationUnit
controller
)
{
private
List
<
String
>
getEventHandlers
(
ICompilationUnit
controller
)
{
List
<
String
>
eventHandlers
=
new
ArrayList
<>();
List
<
String
>
eventHandlers
=
new
ArrayList
<>();
IType
type
=
controller
.
findPrimaryType
();
IType
type
=
controller
.
findPrimaryType
();
...
@@ -265,8 +260,7 @@ public class JavaProjectGlossary extends Glossary implements IElementChangedList
...
@@ -265,8 +260,7 @@ public class JavaProjectGlossary extends Glossary implements IElementChangedList
private
void
addToIds
(
Map
<
String
,
List
<
String
>>
ids
,
IField
field
)
{
private
void
addToIds
(
Map
<
String
,
List
<
String
>>
ids
,
IField
field
)
{
try
{
try
{
String
typeName
=
field
.
getTypeSignature
();
String
typeName
=
Signature
.
getSignatureSimpleName
(
field
.
getTypeSignature
());
typeName
=
typeName
.
substring
(
1
,
typeName
.
length
()-
1
);
String
fieldName
=
field
.
getElementName
();
String
fieldName
=
field
.
getElementName
();
List
<
String
>
existingIds
=
ids
.
putIfAbsent
(
typeName
,
List
<
String
>
existingIds
=
ids
.
putIfAbsent
(
typeName
,
new
ArrayList
<>(
Arrays
.
asList
(
fieldName
)));
new
ArrayList
<>(
Arrays
.
asList
(
fieldName
)));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment