moving to responsive portlet almost finished
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/image-previewer-widget@126950 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
e0ded15b43
commit
182545150a
|
@ -22,6 +22,8 @@ import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.uibinder.client.UiHandler;
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,6 +60,9 @@ public class Carousel extends Composite{
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
Image loadingImage;
|
Image loadingImage;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
HorizontalPanel commands;
|
||||||
|
|
||||||
// list of enhanced images to show
|
// list of enhanced images to show
|
||||||
private List<EnhancedImage> listOfAttachmentsToShow;
|
private List<EnhancedImage> listOfAttachmentsToShow;
|
||||||
|
@ -76,9 +81,22 @@ public class Carousel extends Composite{
|
||||||
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
|
||||||
// set buttons width
|
// set vertical alignment
|
||||||
closeButton.setWidth("100px");
|
commands.setCellVerticalAlignment(nextButton, VerticalPanel.ALIGN_MIDDLE);
|
||||||
downloadButton.setWidth("100px");
|
commands.setCellVerticalAlignment(prevButton, VerticalPanel.ALIGN_MIDDLE);
|
||||||
|
|
||||||
|
// set alignment of the horizontal panel's children
|
||||||
|
commands.setCellHorizontalAlignment(closeButton, HorizontalPanel.ALIGN_CENTER);
|
||||||
|
commands.setCellHorizontalAlignment(downloadButton, HorizontalPanel.ALIGN_CENTER);
|
||||||
|
commands.setCellHorizontalAlignment(prevButton, HorizontalPanel.ALIGN_LEFT);
|
||||||
|
commands.setCellHorizontalAlignment(nextButton, HorizontalPanel.ALIGN_RIGHT);
|
||||||
|
|
||||||
|
// set central buttons' cell widths to be equal as well as their widths
|
||||||
|
commands.setCellWidth(downloadButton, "20%");
|
||||||
|
commands.setCellWidth(closeButton, "20%");
|
||||||
|
|
||||||
|
downloadButton.setWidth("80px");
|
||||||
|
closeButton.setWidth("80px");
|
||||||
|
|
||||||
// set icons
|
// set icons
|
||||||
downloadButton.setIcon(IconType.DOWNLOAD);
|
downloadButton.setIcon(IconType.DOWNLOAD);
|
||||||
|
@ -264,8 +282,8 @@ public class Carousel extends Composite{
|
||||||
shownImage.setTitle(listOfAttachmentsToShow.get(currentPreviewPosition).getToolTipToShow());
|
shownImage.setTitle(listOfAttachmentsToShow.get(currentPreviewPosition).getToolTipToShow());
|
||||||
|
|
||||||
// change the title to the modal
|
// change the title to the modal
|
||||||
String shownTitle = listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow().length() > 50 ?
|
String shownTitle = listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow().length() > 40 ?
|
||||||
listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow().substring(0, 50) + "..." :
|
listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow().substring(0, 40) + "..." :
|
||||||
listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow();
|
listOfAttachmentsToShow.get(currentPreviewPosition).getTitleToShow();
|
||||||
mainModalPanel.setTitle(shownTitle);
|
mainModalPanel.setTitle(shownTitle);
|
||||||
|
|
||||||
|
|
|
@ -4,31 +4,20 @@
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<b:Modal ui:field="mainModalPanel" backdrop="NORMAL" keyboard="true"
|
<b:Modal ui:field="mainModalPanel" backdrop="NORMAL" keyboard="true"
|
||||||
closeVisible="true" animation="true" dynamicSafe="true">
|
closeVisible="true" animation="true" dynamicSafe="true">
|
||||||
|
|
||||||
<g:HTMLPanel styleName="body-container">
|
<g:HTMLPanel styleName="body-container">
|
||||||
|
|
||||||
<g:HTMLPanel styleName="image-container">
|
<g:HTMLPanel styleName="image-container">
|
||||||
<b:Image styleName="image-loading" ui:field="loadingImage"></b:Image>
|
<b:Image styleName="image-loading" ui:field="loadingImage"></b:Image>
|
||||||
<b:Image styleName="shown-image" ui:field="shownImage"></b:Image>
|
<b:Image styleName="shown-image" ui:field="shownImage"></b:Image>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
||||||
<g:HTMLPanel styleName="command-container">
|
<g:HorizontalPanel ui:field="commands" styleName="command-container">
|
||||||
<b:Row>
|
<b:Button title="Previous" ui:field="prevButton"
|
||||||
<b:Column size="1">
|
styleName="arrow"></b:Button>
|
||||||
<b:Button title="Previous" ui:field="prevButton"
|
<b:Button title="Download" ui:field="downloadButton">Download</b:Button>
|
||||||
styleName="arrow"></b:Button>
|
<b:Button title="Close" ui:field="closeButton">Close</b:Button>
|
||||||
</b:Column>
|
<b:Button title="Next" ui:field="nextButton" styleName="arrow"></b:Button>
|
||||||
<b:Column offset="2" size="1">
|
</g:HorizontalPanel>
|
||||||
<b:Button title="Download" ui:field="downloadButton">Download</b:Button>
|
|
||||||
</b:Column>
|
|
||||||
<b:Column offset="1" size="1">
|
|
||||||
<b:Button title="Close" ui:field="closeButton">Close</b:Button>
|
|
||||||
</b:Column>
|
|
||||||
<b:Column offset="2" size="1">
|
|
||||||
<b:Button title="Next" ui:field="nextButton" styleName="arrow"></b:Button>
|
|
||||||
</b:Column>
|
|
||||||
</b:Row>
|
|
||||||
</g:HTMLPanel>
|
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</b:Modal>
|
</b:Modal>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
Loading…
Reference in New Issue