fix on cursor icon and item's url input type (changed to textarea)
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/catalogue-sharing-widget@146578 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ef4a34008d
commit
ac42035491
|
@ -6,8 +6,16 @@ import com.github.gwtbootstrap.client.ui.AlertBlock;
|
|||
import com.github.gwtbootstrap.client.ui.Form;
|
||||
import com.github.gwtbootstrap.client.ui.Icon;
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
import com.github.gwtbootstrap.client.ui.TextArea;
|
||||
import com.github.gwtbootstrap.client.ui.TextBox;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Cursor;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.dom.client.DoubleClickEvent;
|
||||
import com.google.gwt.event.dom.client.DoubleClickHandler;
|
||||
import com.google.gwt.event.dom.client.MouseMoveEvent;
|
||||
import com.google.gwt.event.dom.client.MouseMoveHandler;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
@ -26,7 +34,7 @@ public class ShareCatalogueWidget extends Composite {
|
|||
public static final ShareServicesAsync ckanServices = GWT.create(ShareServices.class);
|
||||
|
||||
public static final String SERVICE_UNAVAILABLE = "The service is currently unavailable, retry later";
|
||||
|
||||
|
||||
@UiField
|
||||
Icon loadingIcon;
|
||||
|
||||
|
@ -38,16 +46,16 @@ public class ShareCatalogueWidget extends Composite {
|
|||
|
||||
@UiField
|
||||
TextBox itemShortUrl;
|
||||
//
|
||||
// @UiField
|
||||
// TextBox itemTitle;
|
||||
//
|
||||
// @UiField
|
||||
// TextBox itemName;
|
||||
|
||||
@UiField
|
||||
TextBox itemTitle;
|
||||
|
||||
@UiField
|
||||
TextBox itemName;
|
||||
TextArea itemLongUrl;
|
||||
|
||||
@UiField
|
||||
TextBox itemLongUrl;
|
||||
|
||||
@UiField
|
||||
Modal modalShareLink;
|
||||
|
||||
|
@ -65,13 +73,51 @@ public class ShareCatalogueWidget extends Composite {
|
|||
onError(null);
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
loadingIcon.setVisible(false);
|
||||
formWithInformation.setVisible(true);
|
||||
itemShortUrl.setText(result.getShortUrl() == null ? "" : result.getShortUrl());
|
||||
itemLongUrl.setText(result.getUrl() == null ? "" : result.getUrl());
|
||||
itemTitle.setText(result.getProductTitle() == null ? "" : result.getProductTitle());
|
||||
itemName.setText(result.getProductName() == null ? "" : result.getProductName());
|
||||
// itemTitle.setText(result.getProductTitle() == null ? "" : result.getProductTitle());
|
||||
// itemName.setText(result.getProductName() == null ? "" : result.getProductName());
|
||||
|
||||
itemShortUrl.getElement().getStyle().setCursor(Cursor.DEFAULT);
|
||||
itemLongUrl.getElement().getStyle().setCursor(Cursor.DEFAULT);
|
||||
|
||||
|
||||
itemLongUrl.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
itemLongUrl.selectAll();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
itemLongUrl.addDoubleClickHandler(new DoubleClickHandler() {
|
||||
@Override
|
||||
public void onDoubleClick(DoubleClickEvent event) {
|
||||
itemLongUrl.selectAll();
|
||||
}
|
||||
});
|
||||
|
||||
itemShortUrl.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
itemShortUrl.selectAll();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
itemShortUrl.addDoubleClickHandler(new DoubleClickHandler() {
|
||||
@Override
|
||||
public void onDoubleClick(DoubleClickEvent event) {
|
||||
itemShortUrl.selectAll();
|
||||
}
|
||||
});
|
||||
|
||||
itemLongUrl.selectAll();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<g:HTMLPanel>
|
||||
<b:Modal ui:field="modalShareLink" title="Item's information"
|
||||
<b:Modal ui:field="modalShareLink" title="Please, select the URL and copy it in the clipboard by Ctrl + C or Cmd + C"
|
||||
backdrop="STATIC" keyboard="true" animation="true">
|
||||
<g:VerticalPanel width="100%">
|
||||
|
||||
<b:Icon type="COG" size="FOUR_TIMES" spin="true" ui:field="loadingIcon" visible="true"/>
|
||||
<b:Icon type="COG" size="FOUR_TIMES" spin="true" ui:field="loadingIcon"
|
||||
visible="true" />
|
||||
|
||||
<!-- Alert blocks for info/errors -->
|
||||
<b:AlertBlock type="ERROR" close="false" animation="true"
|
||||
|
@ -15,34 +16,34 @@
|
|||
<b:Form type="VERTICAL" ui:field="formWithInformation"
|
||||
visible="false" width="100%">
|
||||
<b:Fieldset>
|
||||
<b:ControlGroup>
|
||||
<b:ControlLabel for="input01">
|
||||
<b>Item's title:</b>
|
||||
</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox alternateSize="XLARGE" b:id="input01"
|
||||
width="98%" placeholder="Item's title" readOnly="true"
|
||||
ui:field="itemTitle"></b:TextBox>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup>
|
||||
<b:ControlLabel for="input04">
|
||||
<b>Item's name:</b>
|
||||
</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox alternateSize="XLARGE" b:id="input04"
|
||||
width="98%" placeholder="Item's title" readOnly="true"
|
||||
ui:field="itemName"></b:TextBox>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<!-- <b:ControlGroup> -->
|
||||
<!-- <b:ControlLabel for="input01"> -->
|
||||
<!-- <b>Item's title:</b> -->
|
||||
<!-- </b:ControlLabel> -->
|
||||
<!-- <b:Controls> -->
|
||||
<!-- <b:TextBox alternateSize="XLARGE" b:id="input01" -->
|
||||
<!-- width="98%" placeholder="Item's title" readOnly="true" -->
|
||||
<!-- ui:field="itemTitle"></b:TextBox> -->
|
||||
<!-- </b:Controls> -->
|
||||
<!-- </b:ControlGroup> -->
|
||||
<!-- <b:ControlGroup> -->
|
||||
<!-- <b:ControlLabel for="input04"> -->
|
||||
<!-- <b>Item's name:</b> -->
|
||||
<!-- </b:ControlLabel> -->
|
||||
<!-- <b:Controls> -->
|
||||
<!-- <b:TextBox alternateSize="XLARGE" b:id="input04" -->
|
||||
<!-- width="98%" placeholder="Item's title" readOnly="true" -->
|
||||
<!-- ui:field="itemName"></b:TextBox> -->
|
||||
<!-- </b:Controls> -->
|
||||
<!-- </b:ControlGroup> -->
|
||||
<b:ControlGroup>
|
||||
<b:ControlLabel for="input02">
|
||||
<b>Item's url:</b>
|
||||
</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox alternateSize="XLARGE" b:id="input02"
|
||||
<b:TextArea alternateSize="XLARGE" b:id="input02"
|
||||
width="98%" placeholder="Item's long url" readOnly="true"
|
||||
ui:field="itemLongUrl"></b:TextBox>
|
||||
ui:field="itemLongUrl"></b:TextArea>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup>
|
||||
|
|
Loading…
Reference in New Issue