256: Workspace explorer

Task-Url: https://support.d4science.org/issues/256

Added resize to panel height

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@117603 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-07-31 12:11:01 +00:00
parent bf5958fedc
commit cbe0734a79
5 changed files with 76 additions and 4 deletions

View File

@ -32,7 +32,7 @@ public class WorkspaceExplorerPanel extends DockPanel{
* @param breadcrumbs the breadcrumbs * @param breadcrumbs the breadcrumbs
* @param navigation the navigation * @param navigation the navigation
*/ */
public WorkspaceExplorerPanel(int splitterSize, ScrollPanel wsExplorer, Composite breadcrumbs, Composite navigation, String heigth) { public WorkspaceExplorerPanel(int splitterSize, ScrollPanel wsExplorer, Composite breadcrumbs, Composite navigation, String height) {
// setStyleName("cw-DockPanel"); // setStyleName("cw-DockPanel");
ensureDebugId("WorkspaceNavigatorPanel"); ensureDebugId("WorkspaceNavigatorPanel");
// setSpacing(4); // setSpacing(4);
@ -45,7 +45,7 @@ public class WorkspaceExplorerPanel extends DockPanel{
westPanel.add(navigation); westPanel.add(navigation);
add(westPanel, DockPanel.WEST); add(westPanel, DockPanel.WEST);
centerScrollable.setSize(width+"px", heigth); centerScrollable.setSize(width+"px", height);
centerScrollable.add(wsExplorer); centerScrollable.add(wsExplorer);
add(centerScrollable, DockPanel.CENTER); add(centerScrollable, DockPanel.CENTER);
} }

View File

@ -21,6 +21,7 @@ import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.base.TextBox; import com.github.gwtbootstrap.client.ui.base.TextBox;
import com.github.gwtbootstrap.client.ui.constants.ButtonType; import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
@ -105,6 +106,38 @@ public class WorkspaceExplorerSavePanel extends ScrollPanel implements HasWorskp
loadExplorer(fileName); loadExplorer(fileName);
} }
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.ScrollPanel#onResize()
*/
@Override
public void onResize() {
super.onResize();
GWT.log("on Resize...");
adjustSize();
}
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.Widget#onLoad()
*/
@Override
protected void onLoad() {
super.onLoad();
GWT.log("on Load...");
// adjustSize();
adjustSize();
}
private void adjustSize(){
int heigth = this.getParent().getElement().getClientHeight();
GWT.log("getClientHeight Resize Panel: "+heigth);
int offset = 80;
heigth = (heigth-offset>100)?heigth-offset:0;
if(heigth>0){
GWT.log("set new Explorer size: "+heigth);
controller.getWsExplorer().getPanel().setHeight(heigth+"px");
}
}
/** /**
* Load explorer. * Load explorer.

View File

@ -21,6 +21,7 @@ import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.constants.AlertType; import com.github.gwtbootstrap.client.ui.constants.AlertType;
import com.github.gwtbootstrap.client.ui.constants.ButtonType; import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
@ -80,6 +81,38 @@ public class WorkspaceExplorerSelectPanel extends ScrollPanel implements HasWors
}); });
} }
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.ScrollPanel#onResize()
*/
@Override
public void onResize() {
super.onResize();
GWT.log("on Resize...");
adjustSize();
}
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.Widget#onLoad()
*/
@Override
protected void onLoad() {
super.onLoad();
GWT.log("on Load...");
// adjustSize();
adjustSize();
}
private void adjustSize(){
int heigth = this.getParent().getElement().getClientHeight();
GWT.log("getClientHeight Resize Panel: "+heigth);
int offset = 80;
heigth = (heigth-offset>100)?heigth-offset:0;
if(heigth>0){
GWT.log("set new Explorer size: "+heigth);
controller.getWsExplorer().getPanel().setHeight(heigth+"px");
}
}
/** /**
* Instantiates a new workspace explorer select panel. * Instantiates a new workspace explorer select panel.
* *

View File

@ -238,6 +238,13 @@ public class WorkspaceExplorer implements ShowableTypes, SelectableTypes{
return explorerPanel; return explorerPanel;
} }
/**
* @return the itTables
*/
public ItemsTable getItTables() {
return itTables;
}
/** /**
* Gets the item selected. * Gets the item selected.
* *

View File

@ -65,8 +65,7 @@ public abstract class AbstractItemsCellTable {
cellTable.addStyleName("table-overflow"); cellTable.addStyleName("table-overflow");
cellTable.setStriped(true); cellTable.setStriped(true);
cellTable.setCondensed(true); cellTable.setCondensed(true);
cellTable.setWidth("100%", false); cellTable.setWidth("100%", true);
cellTable.setHeight("100px");
dataProvider.addDataDisplay(cellTable); dataProvider.addDataDisplay(cellTable);
initTable(cellTable, null, null); initTable(cellTable, null, null);
cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED); cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);