From 906e8f8bf181508b0254297e0c3ea11944c485a4 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Thu, 4 Apr 2019 14:33:08 +0000 Subject: [PATCH] just added a workaround to fit the grid width to the window width git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@178843 82a268e6-3cf1-43bd-a215-b396298e98cf --- .settings/org.eclipse.wst.common.component | 6 ++++ .../view/grids/GxtGridFilterGroupPanel.java | 32 ++++++++++++++++--- .../view/toolbars/GxtBottomToolBarItem.java | 2 +- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index c375949..7a1ce92 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -5,6 +5,12 @@ + + uses + + + uses + uses diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/grids/GxtGridFilterGroupPanel.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/grids/GxtGridFilterGroupPanel.java index d884dc7..c5ac8fc 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/grids/GxtGridFilterGroupPanel.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/grids/GxtGridFilterGroupPanel.java @@ -72,6 +72,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer { private boolean groupingEnabled = false; private NumberFormat number = ConstantsExplorer.numberFormatterKB; private final Grid grid; + private ColumnModel cm = null; /** * Instantiates a new gxt grid filter group panel. @@ -81,7 +82,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer { public GxtGridFilterGroupPanel(boolean group) { // setLayout(new FitLayout()); setId("GxtGridFilterGroupPanel "+Random.nextInt()); - ColumnConfig icon = new ColumnConfig(FileModel.ICON, "", 25); + ColumnConfig icon = new ColumnConfig(FileModel.ICON, "", 40); icon.setSortable(false); ColumnConfig name = new ColumnConfig(FileGridModel.NAME, FileGridModel.NAME, 280); ColumnConfig type = new ColumnConfig(FileGridModel.TYPE, FileGridModel.TYPE, 60); @@ -94,7 +95,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer { size.setEditor(new CellEditor(new NumberField())); - ColumnModel cm = null; + if(group) cm = new ColumnModel(Arrays.asList(icon, name, ownerFullName, type, lastUpdate, size, category)); @@ -463,7 +464,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer { /** - * Rename item. + * Rename item.// * * @param itemIdentifier the item identifier * @param newName the new name @@ -538,7 +539,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer { /** * Sets the border as on search. - * + *percentulae in java * @param bool the new border as on search */ public void setBorderAsOnSearch(boolean bool){ @@ -617,7 +618,28 @@ public class GxtGridFilterGroupPanel extends LayoutContainer { GWT.log("refresh size grid "+width +"; heigth: "+height); this.setSize(width, height); cp.setSize(width, height); -// grid.setSize(width, height); + grid.setWidth(width); + int theWidth = Integer.parseInt(width.replace("px", "")); + GWT.log("theWidth is "+theWidth); + for (int i=1; i