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
c94ef5b7
Commit
c94ef5b7
authored
15 years ago
by
buczekp
Browse files
Options
Downloads
Patches
Plain Diff
[LMS-1194] fixed reordering of property type assignments
SVN: 13090
parent
ce0d01c0
No related branches found
No related tags found
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/property_type/PropertyTypeAssignmentGrid.java
+17
-11
17 additions, 11 deletions
...lication/ui/property_type/PropertyTypeAssignmentGrid.java
with
17 additions
and
11 deletions
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeAssignmentGrid.java
+
17
−
11
View file @
c94ef5b7
...
@@ -179,6 +179,9 @@ public class PropertyTypeAssignmentGrid extends
...
@@ -179,6 +179,9 @@ public class PropertyTypeAssignmentGrid extends
private
final
IDelegatedAction
postRegistrationCallback
;
private
final
IDelegatedAction
postRegistrationCallback
;
// < entity type, list of etpts assigned to this entity type >
private
Map
<
EntityType
,
List
<
EntityTypePropertyType
<?>>>
entityTypePropertyTypes
;
private
PropertyTypeAssignmentGrid
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
)
private
PropertyTypeAssignmentGrid
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
)
{
{
super
(
viewContext
,
BROWSER_ID
,
GRID_ID
,
super
(
viewContext
,
BROWSER_ID
,
GRID_ID
,
...
@@ -292,24 +295,29 @@ public class PropertyTypeAssignmentGrid extends
...
@@ -292,24 +295,29 @@ public class PropertyTypeAssignmentGrid extends
private
EntityTypePropertyTypeSelectionWidget
createETPTSelectionWidget
()
private
EntityTypePropertyTypeSelectionWidget
createETPTSelectionWidget
()
{
{
final
EntityType
entityType
=
etpt
.
getEntityType
();
final
EntityType
entityType
=
etpt
.
getEntityType
();
final
List
<
EntityTypePropertyType
<?>>
all
=
getPropertyTypes
(
entityType
);
// create a new list of items from all etpts assigned to entity type
final
List
<
EntityTypePropertyType
<?>>
all
=
new
ArrayList
<
EntityTypePropertyType
<?>>();
all
.
add
(
null
);
// null will be transformed into '(top)'
String
initialPropertyTypeCodeOrNull
=
null
;
String
previousPropertyTypeCodeOrNull
=
String
previousPropertyTypeCodeOrNull
=
EntityTypePropertyTypeSelectionWidget
.
TOP_ITEM_CODE
;
EntityTypePropertyTypeSelectionWidget
.
TOP_ITEM_CODE
;
for
(
i
nt
i
=
0
;
i
<
all
.
size
();
i
++
)
for
(
E
nt
ityTypePropertyType
<?>
currentETPT
:
getPropertyTypes
(
entityType
)
)
{
{
final
String
currentPropertyTypeCode
=
final
String
currentPropertyTypeCode
=
all
.
get
(
i
).
getPropertyType
().
getCode
();
currentETPT
.
getPropertyType
().
getCode
();
if
(
propertyTypeCode
.
equals
(
currentPropertyTypeCode
))
if
(
propertyTypeCode
.
equals
(
currentPropertyTypeCode
)
==
false
)
{
all
.
add
(
currentETPT
);
previousPropertyTypeCodeOrNull
=
currentPropertyTypeCode
;
}
else
{
{
all
.
remove
(
i
);
initialPropertyTypeCodeOrNull
=
previousPropertyTypeCodeOrNull
;
break
;
}
}
previousPropertyTypeCodeOrNull
=
currentPropertyTypeCode
;
}
}
all
.
add
(
0
,
null
);
// null will be transformed into '(top)'
final
EntityTypePropertyTypeSelectionWidget
result
=
final
EntityTypePropertyTypeSelectionWidget
result
=
new
EntityTypePropertyTypeSelectionWidget
(
viewContext
,
getId
(),
all
,
new
EntityTypePropertyTypeSelectionWidget
(
viewContext
,
getId
(),
all
,
previous
PropertyTypeCodeOrNull
);
initial
PropertyTypeCodeOrNull
);
FieldUtil
.
setMandatoryFlag
(
result
,
true
);
FieldUtil
.
setMandatoryFlag
(
result
,
true
);
return
result
;
return
result
;
}
}
...
@@ -389,8 +397,6 @@ public class PropertyTypeAssignmentGrid extends
...
@@ -389,8 +397,6 @@ public class PropertyTypeAssignmentGrid extends
PropertyTypeAssignmentColDefKind
.
ENTITY_KIND
});
PropertyTypeAssignmentColDefKind
.
ENTITY_KIND
});
}
}
private
Map
<
EntityType
,
List
<
EntityTypePropertyType
<?>>>
entityTypePropertyTypes
;
private
List
<
EntityTypePropertyType
<?>>
getPropertyTypes
(
EntityType
entityType
)
private
List
<
EntityTypePropertyType
<?>>
getPropertyTypes
(
EntityType
entityType
)
{
{
return
entityTypePropertyTypes
.
get
(
entityType
);
return
entityTypePropertyTypes
.
get
(
entityType
);
...
...
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