Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
k2023
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
tie
ohj2
esimerkit
k2023
Commits
a17a1ea6
Commit
a17a1ea6
authored
2 years ago
by
Vesa Lappalainen
Browse files
Options
Downloads
Patches
Plain Diff
Etsiminen nimen perusteella
parent
9a456c0d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
luennot/live23/src/fxKerho/KerhoGUIController.java
+8
-7
8 additions, 7 deletions
luennot/live23/src/fxKerho/KerhoGUIController.java
luennot/live23/src/kerho/Jasenet.java
+2
-1
2 additions, 1 deletion
luennot/live23/src/kerho/Jasenet.java
with
10 additions
and
8 deletions
luennot/live23/src/fxKerho/KerhoGUIController.java
+
8
−
7
View file @
a17a1ea6
...
@@ -338,16 +338,17 @@ public class KerhoGUIController implements Initializable {
...
@@ -338,16 +338,17 @@ public class KerhoGUIController implements Initializable {
/**
/**
* Hakee jäsenten tiedot listaan
* Hakee jäsenten tiedot listaan
* @param jnr
o
jäsenen numero, joka aktivoidaan haun jälkeen
* @param jnr jäsenen numero, joka aktivoidaan haun jälkeen
*/
*/
protected
void
hae
(
int
jnro
)
{
protected
void
hae
(
final
int
jnr
)
{
int
jnro
=
jnr
;
int
k
=
cbKentat
.
getSelectionModel
().
getSelectedIndex
();
int
k
=
cbKentat
.
getSelectionModel
().
getSelectedIndex
();
String
ehto
=
hakuehto
.
getText
();
String
ehto
=
hakuehto
.
getText
();
if
(
k
>
0
||
ehto
.
length
()
>
0
)
if
(
jnro
==
0
)
{
naytaVirhe
(
String
.
format
(
"Ei osata hakea (kenttä: %d, ehto: %s)"
,
k
,
ehto
)
);
Jasen
kohdalla
=
chooserJasenet
.
getSelectedObject
(
);
else
if
(
kohdalla
!=
null
)
jnro
=
kohdalla
.
getTunnusNro
();
naytaVirhe
(
null
);
}
chooserJasenet
.
clear
();
chooserJasenet
.
clear
();
int
index
=
0
;
int
index
=
0
;
...
...
This diff is collapsed.
Click to expand it.
luennot/live23/src/kerho/Jasenet.java
+
2
−
1
View file @
a17a1ea6
...
@@ -397,7 +397,8 @@ public class Jasenet implements Iterable<Jasen> {
...
@@ -397,7 +397,8 @@ public class Jasenet implements Iterable<Jasen> {
public
Collection
<
Jasen
>
etsi
(
String
hakuehto
,
int
k
)
{
public
Collection
<
Jasen
>
etsi
(
String
hakuehto
,
int
k
)
{
Collection
<
Jasen
>
loytyneet
=
new
ArrayList
<
Jasen
>();
Collection
<
Jasen
>
loytyneet
=
new
ArrayList
<
Jasen
>();
for
(
Jasen
jasen
:
this
)
{
for
(
Jasen
jasen
:
this
)
{
loytyneet
.
add
(
jasen
);
if
(
jasen
.
getNimi
().
contains
(
hakuehto
)
)
loytyneet
.
add
(
jasen
);
}
}
return
loytyneet
;
return
loytyneet
;
}
}
...
...
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