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
645cf699
Commit
645cf699
authored
16 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-789 bugfix for material browser
SVN: 10512
parent
99254559
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
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java
+32
-16
32 additions, 16 deletions
...b/client/application/ui/material/MaterialBrowserGrid.java
with
32 additions
and
16 deletions
openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/material/MaterialBrowserGrid.java
+
32
−
16
View file @
645cf699
...
...
@@ -87,8 +87,18 @@ public class MaterialBrowserGrid extends AbstractBrowserGrid<Material, MaterialM
ListMaterialCriteria
tryGetCriteria
();
}
/**
* Creates a browser with a toolbar which allows to choose the material type. Allows to show or
* edit material details.
*/
public
static
DisposableEntityChooser
<
Material
>
createWithTypeChooser
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
)
{
return
createWithTypeChooser
(
viewContext
,
true
);
}
private
static
DisposableEntityChooser
<
Material
>
createWithTypeChooser
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
,
boolean
detailsAvailable
)
{
final
MaterialBrowserToolbar
toolbar
=
new
MaterialBrowserToolbar
(
viewContext
,
null
);
final
ICriteriaProvider
criteriaProvider
=
new
ICriteriaProvider
()
...
...
@@ -99,7 +109,7 @@ public class MaterialBrowserGrid extends AbstractBrowserGrid<Material, MaterialM
}
};
final
MaterialBrowserGrid
browserGrid
=
createBrowserGrid
ForChooser
(
viewContext
,
criteriaProvider
);
createBrowserGrid
(
viewContext
,
criteriaProvider
,
detailsAvailable
);
browserGrid
.
extendTopToolbar
(
toolbar
);
return
browserGrid
.
asDisposableWithToolbar
(
toolbar
);
...
...
@@ -107,7 +117,8 @@ public class MaterialBrowserGrid extends AbstractBrowserGrid<Material, MaterialM
/**
* If the material type is given, does not show the toolbar with material type selection and
* refreshes the grid automatically.
* refreshes the grid automatically.<br>
* Does not allow to show or edit the material details.
*/
public
static
DisposableEntityChooser
<
Material
>
create
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
,
...
...
@@ -115,7 +126,7 @@ public class MaterialBrowserGrid extends AbstractBrowserGrid<Material, MaterialM
{
if
(
initValueOrNull
==
null
)
{
return
createWithTypeChooser
(
viewContext
);
return
createWithTypeChooser
(
viewContext
,
false
);
}
else
{
return
createWithoutTypeChooser
(
viewContext
,
initValueOrNull
);
...
...
@@ -132,26 +143,31 @@ public class MaterialBrowserGrid extends AbstractBrowserGrid<Material, MaterialM
return
new
ListMaterialCriteria
(
initValue
);
}
};
boolean
detailsAvailable
=
false
;
final
MaterialBrowserGrid
browserGrid
=
createBrowserGrid
ForChooser
(
viewContext
,
criteriaProvider
);
createBrowserGrid
(
viewContext
,
criteriaProvider
,
detailsAvailable
);
return
browserGrid
.
asDisposableWithoutToolbar
();
}
private
static
MaterialBrowserGrid
createBrowserGrid
ForChooser
(
private
static
MaterialBrowserGrid
createBrowserGrid
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
,
final
ICriteriaProvider
criteriaProvider
)
final
ICriteriaProvider
criteriaProvider
,
boolean
detailsAvailable
)
{
final
MaterialBrowserGrid
browserGrid
=
new
MaterialBrowserGrid
(
viewContext
,
true
,
criteriaProvider
)
if
(
detailsAvailable
)
{
return
new
MaterialBrowserGrid
(
viewContext
,
true
,
criteriaProvider
);
}
else
{
return
new
MaterialBrowserGrid
(
viewContext
,
true
,
criteriaProvider
)
{
@Override
protected
void
showEntityViewer
(
MaterialModel
materialModel
,
boolean
editMode
)
{
@Override
protected
void
showEntityViewer
(
MaterialModel
materialModel
,
boolean
editMode
)
{
// do nothing - avoid showing the details after double click
}
};
return
browserGrid
;
// do nothing - avoid showing the details after double click
}
};
}
}
private
MaterialBrowserGrid
(
final
IViewContext
<
ICommonClientServiceAsync
>
viewContext
,
...
...
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