Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
d85b87ec
Commit
d85b87ec
authored
15 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
fixed moving vocabulary term to the beginning of a list of terms
SVN: 12968
parent
f4d18b0b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java
+15
-16
15 additions, 16 deletions
.../client/application/ui/vocabulary/VocabularyTermGrid.java
with
15 additions
and
16 deletions
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/vocabulary/VocabularyTermGrid.java
+
15
−
16
View file @
d85b87ec
...
...
@@ -218,6 +218,10 @@ public class VocabularyTermGrid extends AbstractSimpleBrowserGrid<VocabularyTerm
{
term
.
setDescription
(
descriptionField
.
getValue
());
term
.
setLabel
(
labelField
.
getValue
());
if
(
termSelectionWidget
!=
null
)
{
term
.
setOrdinal
(
extractPreviousTermOrdinal
()
+
1
);
}
viewContext
.
getService
().
updateVocabularyTerm
(
term
,
registrationCallback
);
}
...
...
@@ -241,24 +245,19 @@ public class VocabularyTermGrid extends AbstractSimpleBrowserGrid<VocabularyTerm
new
VocabularyTermSelectionWidget
(
getId
()
+
term
,
"Position after"
,
mandatory
,
allTerms
,
previousTermCodeOrNull
);
result
.
setEmptyText
(
"empty value == beginning"
);
result
.
addSelectionChangedListener
(
new
SelectionChangedListener
<
VocabularyTermModel
>()
{
@Override
public
void
selectionChanged
(
SelectionChangedEvent
<
VocabularyTermModel
>
se
)
{
VocabularyTermModel
selectedItem
=
se
.
getSelectedItem
();
// set ordinal to:
// - 0 if nothing is selected,
// - (otherwise) selected term's ordinal + 1
term
.
setOrdinal
((
selectedItem
!=
null
)
?
selectedItem
.
getTerm
().
getOrdinal
()
+
1
:
0
);
}
});
return
result
;
}
/**
* extracts ordinal of a term after which edited terms should be put
*/
private
Long
extractPreviousTermOrdinal
()
{
// - 0 if nothing is selected (move to the beginning),
// - (otherwise) selected term's ordinal
VocabularyTermModel
selectedItem
=
termSelectionWidget
.
getValue
();
return
selectedItem
!=
null
?
selectedItem
.
getTerm
().
getOrdinal
()
:
0
;
}
};
}
...
...
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