centered items number

added scope compile to common-scope-maps

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@96031 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2014-05-23 13:07:50 +00:00
parent bbef0665dc
commit d1f37c8191
5 changed files with 52 additions and 7 deletions

View File

@ -93,8 +93,7 @@
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<!-- UNCOMMENT THIS FOR RELEASE -->
<!-- <scope>provided</scope> -->
<scope>compile</scope>
</dependency>
<!-- END FWS -->

View File

@ -124,6 +124,16 @@ public class GxtBorderLayoutPanel extends ContentPanel {
}
});
center.addListener(Events.Resize,new Listener<BoxComponentEvent>(){
@Override
public void handleEvent(BoxComponentEvent be) {
toolBarItemDetails.refreshSize();
}
});
// center.add(this.toolbarContainer);
center.add(this.gxtCardLayoutResultPanel);

View File

@ -20,6 +20,7 @@ public class ACLDivInfo extends LayoutContainer {
public ACLDivInfo(String caption, AbstractImagePrototype img) {
super();
super.setWidth(80);
setId("ACLDivInfo");
text.setPixelSize(50, 26);
hpPanel.setWidth("100%");

View File

@ -11,7 +11,10 @@ import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Label;
@ -20,6 +23,7 @@ import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
/**
@ -124,18 +128,32 @@ public class GxtBottomToolBarItem extends ToolBar{
add(bHistory);
hpItemsNumber = new HorizontalPanel();
hpItemsNumber.setStyleAttribute("margin-left", "10px");
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.CENTER);
hpItemsNumber.setId("HP-ItemsNumber");
hpItemsNumber.setStyleAttribute("margin-right", "50px");
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
hpItemsNumber.add(labelItemsNumber);
hpItemsNumber.addListener(Events.Render, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
refreshSize();
}
});
// add(new FillToolItem());
add(hpItemsNumber);
add(new FillToolItem());
FillToolItem filler = new FillToolItem();
filler.setId("filler-item");
add(filler);
add(aclDivInfo);
enableInfoHistoryButtons(false);
}
public void resetDetails(){
@ -207,4 +225,23 @@ public class GxtBottomToolBarItem extends ToolBar{
hpItemsNumber.layout();
}
public void refreshSize(){
if(this.isRendered()){
String width = this.getElement().getStyle().getWidth();
width = width.replace("px", "");
try{
long intWidth = Long.parseLong(width);
intWidth = (intWidth/2)-30; //calculate the center
intWidth = intWidth-(60*3); //previous buttons
GWT.log("width is "+width);
// hpItemsNumber.setWidth(intWidth+"px");
hpItemsNumber.setStyleAttribute("margin-left", intWidth+"px");
hpItemsNumber.layout();
}catch (Exception e) {
GWT.log("width is not a long "+e);
}
}
}
}

View File

@ -151,8 +151,6 @@ public class GxtBreadcrumbPathPanel {
*
*/
public void refreshSize() {
GWT.log("Refreshed size");
}