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
5c86f2fe
Commit
5c86f2fe
authored
13 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2531 channel chooser: fix combobox width and NPE
SVN: 23011
parent
77533817
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ChannelChooserPanel.java
+41
-20
41 additions, 20 deletions
...client/application/detailviewers/ChannelChooserPanel.java
with
41 additions
and
20 deletions
screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/ChannelChooserPanel.java
+
41
−
20
View file @
5c86f2fe
...
...
@@ -159,7 +159,7 @@ public class ChannelChooserPanel extends LayoutContainer
{
SimpleModelComboBox
<
String
>
comboBox
=
new
SimpleModelComboBox
<
String
>(
this
.
messageProvider
,
new
ArrayList
<
LabeledItem
<
String
>>(),
1
);
new
ArrayList
<
LabeledItem
<
String
>>(),
null
);
comboBox
.
addListener
(
Events
.
SelectionChange
,
selectionChangeListener
);
return
comboBox
;
...
...
@@ -195,7 +195,7 @@ public class ChannelChooserPanel extends LayoutContainer
*/
public
List
<
String
>
getSelectedValues
()
{
String
comboBoxValue
=
channelsComboBox
.
get
SimpleValue
().
get
Item
();
String
comboBoxValue
=
channelsComboBox
.
get
Chosen
Item
();
if
(
comboBoxValue
==
null
)
{
return
Collections
.<
String
>
emptyList
();
...
...
@@ -324,7 +324,7 @@ public class ChannelChooserPanel extends LayoutContainer
}
LabeledItem
<
String
>
itemToSelect
=
channelsComboBox
.
findModelForVal
(
codeToSelect
);
channelsComboBox
.
setS
impleValue
(
itemToSelect
);
channelsComboBox
.
setS
election
(
itemToSelect
);
initializeCheckBoxValues
(
channels
);
updateTransformationComboBox
();
}
...
...
@@ -348,7 +348,7 @@ public class ChannelChooserPanel extends LayoutContainer
List
<
String
>
selection
=
getSelectedValues
();
defaultChannelState
.
setDefaultChannels
(
selection
);
String
selectedComboValue
=
channelsComboBox
.
get
SimpleValue
().
get
Item
();
String
selectedComboValue
=
channelsComboBox
.
get
Chosen
Item
();
boolean
showCheckBoxGroup
=
ScreeningConstants
.
MERGED_CHANNELS
.
equals
(
selectedComboValue
);
channelsCheckBoxGroup
.
setVisible
(
showCheckBoxGroup
);
...
...
@@ -476,7 +476,10 @@ public class ChannelChooserPanel extends LayoutContainer
&&
(
infos
=
transformationsForChannels
.
get
(
selectedValues
.
get
(
0
)))
!=
null
&&
infos
.
size
()
>
0
)
{
model
.
add
(
DEFAULT_TRANSFORMATION
);
if
(
isDefaultTransformationDefined
(
infos
)
==
false
)
{
model
.
add
(
DEFAULT_TRANSFORMATION
);
}
for
(
ImageTransformationInfo
imageTransformationInfo
:
infos
)
{
model
.
add
(
convertToLabeledItem
(
imageTransformationInfo
));
...
...
@@ -497,6 +500,18 @@ public class ChannelChooserPanel extends LayoutContainer
}
}
private
static
boolean
isDefaultTransformationDefined
(
Set
<
ImageTransformationInfo
>
infos
)
{
for
(
ImageTransformationInfo
imageTransformationInfo
:
infos
)
{
if
(
imageTransformationInfo
.
isDefault
())
{
return
true
;
}
}
return
false
;
}
private
void
setTransformationsVisible
(
boolean
visible
)
{
transformationsComboBox
.
setVisible
(
visible
);
...
...
@@ -507,20 +522,9 @@ public class ChannelChooserPanel extends LayoutContainer
{
boolean
selected
=
false
;
String
code
=
defaultChannelState
.
tryGetDefaultTransformation
(
channelCode
);
if
(
code
!=
null
)
{
for
(
SimpleComboValue
<
LabeledItem
<
ImageTransformationInfo
>>
info
:
transformationsComboBox
.
getStore
().
getModels
())
{
if
(
info
.
getValue
().
getItem
().
getCode
().
equals
(
code
))
{
selected
=
true
;
// transformationsComboBox.select(info);
transformationsComboBox
.
setSelection
(
Collections
.
singletonList
(
info
));
break
;
}
}
}
SimpleModelComboBox
<
ImageTransformationInfo
>
combobox
=
transformationsComboBox
;
selected
=
setSelectedValue
(
code
,
combobox
);
if
(
false
==
selected
)
{
for
(
SimpleComboValue
<
LabeledItem
<
ImageTransformationInfo
>>
info
:
transformationsComboBox
...
...
@@ -528,7 +532,6 @@ public class ChannelChooserPanel extends LayoutContainer
{
if
(
info
.
getValue
().
getItem
().
isDefault
())
{
// transformationsComboBox.select(info);
transformationsComboBox
.
setSelection
(
Collections
.
singletonList
(
info
));
selected
=
true
;
break
;
...
...
@@ -543,6 +546,24 @@ public class ChannelChooserPanel extends LayoutContainer
}
}
private
boolean
setSelectedValue
(
String
code
,
SimpleModelComboBox
<
ImageTransformationInfo
>
combobox
)
{
if
(
code
!=
null
)
{
for
(
SimpleComboValue
<
LabeledItem
<
ImageTransformationInfo
>>
info
:
combobox
.
getStore
()
.
getModels
())
{
if
(
info
.
getValue
().
getItem
().
getCode
().
equals
(
code
))
{
combobox
.
setSelection
(
Collections
.
singletonList
(
info
));
return
true
;
}
}
}
return
false
;
}
private
static
LabeledItem
<
ImageTransformationInfo
>
convertToLabeledItem
(
ImageTransformationInfo
imageTransformationInfo
)
{
...
...
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