Skip to content
Snippets Groups Projects
Commit 6b8fe3a6 authored by cramakri's avatar cramakri
Browse files

LMS-1357 Show the ">>" button when necessary. These changes only work on a window resize.

SVN: 14616
parent 9d218943
No related branches found
No related tags found
No related merge requests found
......@@ -1457,12 +1457,28 @@ public abstract class AbstractBrowserGrid<T/* Entity */, M extends BaseEntityMod
private static <T> LayoutContainer createBottomToolbars(Component filterToolbar,
Component pagingToolbar)
{
LayoutContainer bottomToolbars = new LayoutContainer();
LayoutContainer bottomToolbars = new LayoutContainer()
{
@Override
protected void onWindowResize(int aWidth, int aHeight)
{
super.onWindowResize(aWidth, aHeight);
layout(true);
}
};
bottomToolbars.setMonitorWindowResize(true);
bottomToolbars.setLayout(new RowLayout(com.extjs.gxt.ui.client.Style.Orientation.VERTICAL));
bottomToolbars.add(filterToolbar);
bottomToolbars.add(pagingToolbar);
bottomToolbars.add(filterToolbar, new RowData(1, -1));
bottomToolbars.add(pagingToolbar, new RowData(1, -1));
return bottomToolbars;
}
@Override
protected void onAttach()
{
super.onAttach();
bottomToolbars.layout(true);
}
private static <T extends ModelData> Grid<T> createGrid(
PagingLoader<PagingLoadResult<T>> dataLoader, String gridId)
......
......@@ -24,6 +24,7 @@ import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants;
......@@ -59,9 +60,18 @@ public final class BrowserGridPagingToolBar extends PagingToolBar
IMessageProvider messageProvider, int pageSize, String gridId)
{
super(pageSize);
nextTableButtonIndex = indexOf(refresh);
// Remove the refresh button (since we add our own)
remove(refresh);
// Remove the space before the refresh button and replace it with display text
Component fillItem = getItem(indexOf(displayText) - 1);
remove(fillItem);
// Add a separator and some fill space
nextTableButtonIndex = indexOf(displayText) + 1;
SeparatorToolItem separator = new SeparatorToolItem();
insertTableButton(separator);
insertTableButton(new FillToolItem());
this.messageProvider = messageProvider;
insertTableButton(createTableOperationsLabel());
......@@ -97,7 +107,7 @@ public final class BrowserGridPagingToolBar extends PagingToolBar
public final void addEntityOperationsLabel()
{
add(new FillToolItem());
add(new SeparatorToolItem());
add(new LabelToolItem(messageProvider.getMessage(Dict.ENTITY_OPERATIONS)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment