diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java index 28d941b941223f96867be2d4f9af09a7cd3d6840..f047ed80c1d2818ccd3805082502bffa694609ef 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/grid/AbstractBrowserGrid.java @@ -254,39 +254,56 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod this.contentPanel = createEmptyContentPanel(); bottomToolbars = createBottomToolbars(contentPanel, pagingToolbar); + configureBottomToolbarSyncSize(); contentPanel.add(grid); contentPanel.setBottomComponent(bottomToolbars); contentPanel.setHeaderVisible(false); + columnListener = new ColumnListener<T, M>(grid); + registerLinkClickListenerFor(Dict.CODE, new ICellListener<T>() + { + public void handle(T rowItem, boolean keyPressed) + { + showEntityViewer(rowItem, false, keyPressed); + } + }); + setLayout(new FitLayout()); + add(contentPanel); + + addRefreshDisplaySettingsListener(); + configureLoggingBetweenEvents(logID); + } + + private void configureBottomToolbarSyncSize() + { + // fixes problems with: + // - no 'overflow' button when some buttons don't fit into pagingToolbar pagingLoader.addListener(Loader.Load, new Listener<BaseEvent>() { public void handleEvent(BaseEvent be) { - // fixes for problems of: - // - no 'overflow' button when some buttons don't fit into pagingToolbar pagingToolbar.syncSize(); } }); + // - hidden paging toolbar pagingToolbar.addListener(Events.AfterLayout, new Listener<BaseEvent>() { public void handleEvent(BaseEvent be) { - // fixes for problems of: - // - hidden paging toolbar contentPanel.syncSize(); } }); - columnListener = new ColumnListener<T, M>(grid); - registerLinkClickListenerFor(Dict.CODE, new ICellListener<T>() + // - bottom toolbar is not resized when new filter row appears + filterToolbar.addListener(Events.AfterLayout, new Listener<BaseEvent>() { - public void handle(T rowItem, boolean keyPressed) + public void handleEvent(BaseEvent be) { - showEntityViewer(rowItem, false, keyPressed); + contentPanel.syncSize(); } }); - setLayout(new FitLayout()); - add(contentPanel); + } - addRefreshDisplaySettingsListener(); + private void configureLoggingBetweenEvents(int logID) + { if (viewContext.isLoggingEnabled()) { ComponentEventLogger logger = new ComponentEventLogger(viewContext, getId()); @@ -1573,6 +1590,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod // if user quickly changes tab / hides section before it is layouted. On the other hand // it is slower than adding it after requesting server for data. bottomToolbars.add(pagingToolbar, new RowData(1, -1)); + // filter toolbar is added on request return bottomToolbars; } @@ -1607,6 +1625,7 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod grid.setLoadMask(true); grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); grid.setView(new ExtendedGridView()); + grid.setStripeRows(true); return grid; } @@ -1757,4 +1776,5 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod .getTotalCount()).show(); } } + }