2015-10-30 18:13:02 +01:00
/ * *
*
* /
package org.gcube.portlets.user.workspace.client.view ;
2015-11-03 16:36:20 +01:00
import org.gcube.portlets.user.workspace.client.resources.Resources ;
2015-10-30 18:13:02 +01:00
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 ;
2015-11-03 16:36:20 +01:00
import com.google.gwt.user.client.ui.HasVerticalAlignment ;
2015-10-30 18:13:02 +01:00
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
2015-11-03 16:36:20 +01:00
HorizontalPanel ws_features ;
2015-10-30 18:13:02 +01:00
@UiField
HorizontalPanel hp_feautures ;
2015-11-02 18:53:30 +01:00
@UiField
2015-11-03 16:36:20 +01:00
com . google . gwt . user . client . ui . Label how_to ;
2015-11-02 18:53:30 +01:00
@UiField
2015-11-03 16:36:20 +01:00
Label ws_quote ;
@UiField
Label shf ; //Share Folders & Files
2015-11-02 18:53:30 +01:00
2015-11-03 16:36:20 +01:00
private Popover overShF = new Popover ( ) ;
@UiField
Label upl ; //DRAG & DROP
private Popover overUpload = new Popover ( ) ;
@UiField
Label plk ; //PUBLIC LINK
2015-11-02 18:53:30 +01:00
private Popover overPlk = new Popover ( ) ;
2015-10-30 18:13:02 +01:00
2015-11-03 16:36:20 +01:00
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
2015-11-03 16:36:20 +01:00
UiBinder < Widget , WorkspaceFeatures > {
2015-10-30 18:13:02 +01:00
}
/ * *
* Instantiates a new page template .
* /
public WorkspaceFeatures ( ) {
initWidget ( uiBinder . createAndBindUi ( this ) ) ;
2015-11-03 16:36:20 +01:00
hp_feautures . setVerticalAlignment ( HasVerticalAlignment . ALIGN_MIDDLE ) ;
ws_features . setVerticalAlignment ( HasVerticalAlignment . ALIGN_MIDDLE ) ;
2015-10-30 18:13:02 +01:00
hp_feautures . setCellWidth ( fp1 , " 33% " ) ;
hp_feautures . setCellWidth ( fp2 , " 33% " ) ;
hp_feautures . setCellWidth ( fp3 , " 33% " ) ;
2015-11-03 16:36:20 +01:00
how_to . addStyleName ( " margin-right-10 " ) ;
shf . addStyleName ( " margin-right-10 " ) ;
upl . addStyleName ( " margin-right-10 " ) ;
plk . addStyleName ( " margin-right-10 " ) ;
initPopupShareFeature ( ) ;
initPopupUploadFeature ( ) ;
2015-11-02 18:53:30 +01:00
initPopupPlkFeature ( ) ;
2015-11-03 16:36:20 +01:00
}
/ * *
*
* /
private void initPopupShareFeature ( ) {
overShF . setAnimation ( false ) ;
overShF . setWidget ( shf ) ;
overShF . setHeading ( " Workspace Share Folders and Files " ) ;
String icon = " <span style= \" margin-right:5px \" > " + Resources . getIconShareFolder ( ) . getSafeHtml ( ) . asString ( ) + " </span> " ;
overShF . setText ( icon + " The quickest way to share something is using the Share Folder. Locate the folder with the files you want to share and then click 'Share' " ) ;
overShF . setHtml ( true ) ;
overShF . setPlacement ( Placement . TOP ) ;
overShF . setTrigger ( Trigger . HOVER ) ;
overShF . reconfigure ( ) ;
2015-10-30 18:13:02 +01:00
}
/ * *
*
* /
2015-11-03 16:36:20 +01:00
private void initPopupUploadFeature ( ) {
overUpload . setAnimation ( false ) ;
overUpload . setWidget ( upl ) ;
overUpload . setHeading ( " Workspace Upload Files and Archives " ) ;
String iconUploadDND = " <span style= \" margin-right:5px \" > " + Resources . getIconHand ( ) . getSafeHtml ( ) . asString ( ) + " </span> " ;
String iconUploadFile = " <span style= \" margin-right:5px \" > " + Resources . getIconFileUpload ( ) . getSafeHtml ( ) . asString ( ) + " </span> " ;
String iconUploadArchive = " <span style= \" margin-right:5px \" > " + Resources . getIconArchiveUpload ( ) . getSafeHtml ( ) . asString ( ) + " </span> " ;
overUpload . setText ( " You can upload files in the Workspace in several ways:<br/> "
+ iconUploadDND + " 1 - Drop your files from Desktop;<br/> "
+ iconUploadFile + " 2 - Click 'Upload' and Browse Files;<br/> "
+ iconUploadArchive + " 3 - Upload a zip file to unzip directly its content in the Workspace.<br/> " ) ;
overUpload . setHtml ( true ) ;
overUpload . setPlacement ( Placement . TOP ) ;
overUpload . setTrigger ( Trigger . HOVER ) ;
overUpload . reconfigure ( ) ;
2015-11-02 18:53:30 +01:00
// overImgUpload.show();
}
private void initPopupPlkFeature ( ) {
2015-11-03 16:36:20 +01:00
overPlk . setAnimation ( false ) ;
2015-11-02 18:53:30 +01:00
overPlk . setWidget ( plk ) ;
overPlk . setHeading ( " Workspace Public Link " ) ;
2015-11-03 16:36:20 +01:00
String icon = " <span style= \" margin-right:5px \" > " + Resources . getIconPublicLink ( ) . getSafeHtml ( ) . asString ( ) + " </span> " ;
overPlk . setText ( icon + " 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 . setHtml ( true ) ;
2015-11-02 18:53:30 +01:00
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 ) {
2015-11-03 16:36:20 +01:00
ws_quote . setText ( html ) ;
2015-10-30 18:13:02 +01:00
}
2015-11-03 16:36:20 +01:00
2015-10-30 18:13:02 +01:00
/ * *
* @param bool
* /
public void setQuoteVisible ( boolean bool ) {
2015-11-03 16:36:20 +01:00
ws_quote . setVisible ( bool ) ;
2015-10-30 18:13:02 +01:00
}
/ * *
* @param bool
* /
public void setDndFeatureVisible ( boolean bool ) {
2015-11-03 16:36:20 +01:00
upl . setVisible ( bool ) ;
2015-10-30 18:13:02 +01:00
}
}