/** * */ package org.gcube.portlets.user.workspace.client.view; import com.github.gwtbootstrap.client.ui.Label; import com.github.gwtbootstrap.client.ui.Popover; import com.github.gwtbootstrap.client.ui.constants.Placement; import com.github.gwtbootstrap.client.ui.constants.Trigger; import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Widget; /** * The Class PageTemplate. * * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 19, 2015 */ public class WorkspaceFeatures extends Composite { @UiField Label ws_quote_alert; @UiField FlowPanel ws_features; @UiField HorizontalPanel hp_feautures; @UiField Label dnd; @UiField Label plk; private Popover overDnD = new Popover(); private Popover overPlk = new Popover(); @UiField FlowPanel fp1; @UiField FlowPanel fp2; @UiField FlowPanel fp3; private static WorkspaceFeaturesUiBinder uiBinder = GWT.create(WorkspaceFeaturesUiBinder.class); /** * The Interface PageTemplateUiBinder. * * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 19, * 2015 */ interface WorkspaceFeaturesUiBinder extends UiBinder { } /** * Instantiates a new page template. */ public WorkspaceFeatures() { initWidget(uiBinder.createAndBindUi(this)); hp_feautures.setCellWidth(fp1, "33%"); hp_feautures.setCellWidth(fp2, "33%"); hp_feautures.setCellWidth(fp3, "33%"); fp3.getElement().getStyle().setTextAlign(com.google.gwt.dom.client.Style.TextAlign.RIGHT); initPopupDndFeature(); initPopupPlkFeature(); // ws_features.add } /** * */ private void initPopupDndFeature() { overDnD.setAnimation(true); overDnD.setWidget(dnd); overDnD.setHeading("Workspace DnD"); overDnD.setText("Drag & Drop your files from Desktop to upload to Workspace"); overDnD.setPlacement(Placement.TOP); overDnD.setTrigger(Trigger.HOVER); overDnD.reconfigure(); // overImgUpload.show(); } private void initPopupPlkFeature() { overPlk.setAnimation(true); overPlk.setWidget(plk); overPlk.setHeading("Workspace Public Link"); overPlk.setText("Create links to files in your Workspace to download them. You can send the links to anyone by pasting them into Workspace Message, your emails, instant messages, etc."); overPlk.setPlacement(Placement.TOP); overPlk.setTrigger(Trigger.HOVER); overPlk.reconfigure(); // overImgUpload.show(); } /** * @param html */ public void updateQuotes(String html) { ws_quote_alert.setText(html); } // public void showImgUploadDnD(boolean show) { // if (show) // overImgUpload.show(); // else // overImgUpload.hide(); // } /** * @param bool */ public void setQuoteVisible(boolean bool) { ws_quote_alert.setVisible(bool); } /** * @param bool */ public void setDndFeatureVisible(boolean bool) { dnd.setVisible(bool); } }