2546: Endow Workspace Resources Explorer with filtering and display features

Task-Url: https://support.d4science.org/2546

Added scroll for Dialog Gcube Properties

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@128831 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-05-25 15:04:28 +00:00
parent 3069c1440d
commit 1c7b54238f
2 changed files with 38 additions and 31 deletions

View File

@ -24,7 +24,7 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
@ -40,9 +40,10 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
private DockPanel dock = new DockPanel(); private DockPanel dock = new DockPanel();
private Button yesButton; private Button yesButton;
private VerticalPanel vpCenterContainer; private ScrollPanel spCenterContainer;
private ImageResource loading = WorkspaceExplorerResources.ICONS.loading(); private ImageResource loading = WorkspaceExplorerResources.ICONS.loading();
private HorizontalPanel hpButtons = new HorizontalPanel(); private HorizontalPanel hpButtons = new HorizontalPanel();
// public int tableHeigth = 300;
/** /**
* Instantiates a new dialog show gcube items related to WorkspaceItemId. * Instantiates a new dialog show gcube items related to WorkspaceItemId.
@ -71,19 +72,21 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
} }
}); });
vpCenterContainer = new VerticalPanel(); spCenterContainer = new ScrollPanel();
// vpContainer.getElement().getStyle().setMargin(5.0, Unit.PX); spCenterContainer.getElement().getStyle().setProperty("maxHeight", "300px");
vpCenterContainer.add(new HTML(text)); spCenterContainer.add(new HTML(text));
hpButtons = new HorizontalPanel(); hpButtons = new HorizontalPanel();
hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); hpButtons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
hpButtons.setSpacing(3); hpButtons.getElement().getStyle().setMarginTop(10.0, Unit.PX);
// hpButtons.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
// hpButtons.setSpacing(3);
// yesButton.getElement().getStyle().setMarginRight(20.0, Unit.PX); // yesButton.getElement().getStyle().setMarginRight(20.0, Unit.PX);
hpButtons.add(yesButton); hpButtons.add(yesButton);
dock.add(hpButtons, DockPanel.SOUTH); dock.add(hpButtons, DockPanel.SOUTH);
dock.setCellHorizontalAlignment(hpButtons, DockPanel.ALIGN_CENTER); dock.setCellHorizontalAlignment(hpButtons, DockPanel.ALIGN_CENTER);
dock.add(vpCenterContainer, DockPanel.CENTER); dock.add(spCenterContainer, DockPanel.CENTER);
setWidget(dock); setWidget(dock);
@ -120,18 +123,18 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
FlexTable table = new FlexTable(); FlexTable table = new FlexTable();
table.setWidth("100%"); table.setWidth("100%");
// table.setHeight("50px");
if(map.size()==0){ if(map.size()==0){
table.setHTML(0, 0, "No properties"); table.setHTML(0, 0, "No properties");
return table; return table;
} }
table.addStyleName("gcube-item-table"); table.addStyleName("gwt-DialogBoxNew-table");
table.setHTML(0, 0, "N."); table.setHTML(0, 0, "N.");
table.setHTML(0, 1, "Key"); table.setHTML(0, 1, "Key");
table.setHTML(0, 2, "Value"); table.setHTML(0, 2, "Value");
table.getRowFormatter().getElement(0).addClassName("gcube-item-table-header"); table.getRowFormatter().getElement(0).addClassName("gwt-DialogBoxNew-table-header");
int index = 1; int index = 1;
GWT.log("Properties are: "+map.keySet().size()); GWT.log("Properties are: "+map.keySet().size());
@ -166,13 +169,13 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
* @param message the message * @param message the message
*/ */
private void showLoader(String message){ private void showLoader(String message){
vpCenterContainer.clear(); spCenterContainer.clear();
HorizontalPanel hpMask = new HorizontalPanel(); HorizontalPanel hpMask = new HorizontalPanel();
hpMask.add(new Image(loading)); hpMask.add(new Image(loading));
HTML html = new HTML(message); HTML html = new HTML(message);
html.getElement().getStyle().setMarginLeft(5, Unit.PX); html.getElement().getStyle().setMarginLeft(5, Unit.PX);
hpMask.add(html); hpMask.add(html);
vpCenterContainer.add(hpMask); spCenterContainer.add(hpMask);
} }
@ -181,7 +184,7 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
*/ */
private void clearCenterContainer(){ private void clearCenterContainer(){
try{ try{
vpCenterContainer.clear(); spCenterContainer.clear();
}catch(Exception e){} }catch(Exception e){}
} }
@ -191,7 +194,7 @@ public class DialogShowGcubeItem extends DialogBox implements ClickHandler {
* @param w the w * @param w the w
*/ */
public void addToCenterPanel(Widget w) { public void addToCenterPanel(Widget w) {
vpCenterContainer.add(w); spCenterContainer.add(w);
} }
/** /**

View File

@ -89,6 +89,7 @@
z-index: 2000; z-index: 2000;
background-color: #FFFFFF; background-color: #FFFFFF;
min-width: 250px; min-width: 250px;
max-width: 500px;
} }
.gwt-DialogBoxNew .Caption { .gwt-DialogBoxNew .Caption {
@ -150,7 +151,27 @@
-background: url(images/circles_ie6.png) no-repeat -8px -36px; */ -background: url(images/circles_ie6.png) no-repeat -8px -36px; */
} }
.gwt-DialogBoxNew-table-header {
text-align: left;
font-weight: bold;
}
.gwt-DialogBoxNew-table {
margin-top: 10px;
margin-bottom: 10px;
}
.gwt-DialogBoxNew-table td {
border-bottom: 1px solid #EEEEEE;
height: 50%;
text-align: left;
vertical-align: middle;
padding: 5px;
}
/**** END GWT DIALOG NEW STYLE ****/ /**** END GWT DIALOG NEW STYLE ****/
/*** TABLE ***/ /*** TABLE ***/
.table-explorer td, th { .table-explorer td, th {
overflow: hidden !important; overflow: hidden !important;
@ -166,23 +187,6 @@
} }
.gcube-item-table {
margin-top: 10px;
margin-bottom: 10px;
}
.gcube-item-table td {
border-bottom: 1px solid #EEEEEE;
height: 50%;
text-align: center;
vertical-align: middle;
padding: 5px;
}
.gcube-item-table-header {
text-align: center;
font-weight: bold;
}
/******* END TABLE ********/ /******* END TABLE ********/
/* .adaptiveHeight { /* .adaptiveHeight {
Firefox Firefox