2015-10-30 18:13:02 +01:00
/ * *
*
* /
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 ;
2015-11-02 18:53:30 +01:00
@UiField
Label dnd ;
@UiField
Label plk ;
2015-10-30 18:13:02 +01:00
2015-11-02 18:53:30 +01:00
private Popover overDnD = new Popover ( ) ;
private Popover overPlk = new Popover ( ) ;
2015-10-30 18:13:02 +01:00
@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 < Widget , WorkspaceFeatures > {
}
/ * *
* 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% " ) ;
2015-11-02 18:53:30 +01:00
fp3 . getElement ( ) . getStyle ( ) . setTextAlign ( com . google . gwt . dom . client . Style . TextAlign . RIGHT ) ;
initPopupDndFeature ( ) ;
initPopupPlkFeature ( ) ;
2015-10-30 18:13:02 +01:00
// ws_features.add
}
/ * *
*
* /
private void initPopupDndFeature ( ) {
2015-11-02 18:53:30 +01:00
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 ( ) ;
2015-10-30 18:13:02 +01:00
// 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 ) {
2015-11-02 18:53:30 +01:00
dnd . setVisible ( bool ) ;
2015-10-30 18:13:02 +01:00
}
}