add copy link, completed
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@76869 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9410639f50
commit
6bd8c1e211
|
@ -190,7 +190,13 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGetInfo(GetInfoEvent getInfoEvent) {
|
public void onGetInfo(GetInfoEvent getInfoEvent) {
|
||||||
new DialogGetInfo(getInfoEvent.getSourceFile());
|
|
||||||
|
FileModel file = getInfoEvent.getSourceFile();
|
||||||
|
if(file==null)
|
||||||
|
file = getGridSelectedItem();
|
||||||
|
|
||||||
|
if(file!=null)
|
||||||
|
new DialogGetInfo(file);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package org.gcube.portlets.user.workspace.client.event;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GetShareLinkEvent extends GwtEvent<GetSharedLinkEventHandler> {
|
||||||
|
public static Type<GetSharedLinkEventHandler> TYPE = new Type<GetSharedLinkEventHandler>();
|
||||||
|
|
||||||
|
private FileModel targetFile = null;
|
||||||
|
|
||||||
|
public GetShareLinkEvent(FileModel target) {
|
||||||
|
this.targetFile = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<GetSharedLinkEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(GetSharedLinkEventHandler handler) {
|
||||||
|
handler.onGetLink(this);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public FileModel getSourceFile() {
|
||||||
|
return targetFile;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package org.gcube.portlets.user.workspace.client.event;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface GetSharedLinkEventHandler extends EventHandler {
|
||||||
|
/**
|
||||||
|
* @param getLinkEvent
|
||||||
|
*/
|
||||||
|
void onGetLink(GetShareLinkEvent getLinkEvent);
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.workspace.client.view.toolbars;
|
||||||
import org.gcube.portlets.user.workspace.client.AppController;
|
import org.gcube.portlets.user.workspace.client.AppController;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
|
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
|
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
||||||
|
@ -19,6 +20,10 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||||
*/
|
*/
|
||||||
public class GxtToolBarItemAccounting extends ToolBar{
|
public class GxtToolBarItemAccounting extends ToolBar{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected static final String INFO = "Info";
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -32,6 +37,7 @@ public class GxtToolBarItemAccounting extends ToolBar{
|
||||||
private Text txtCreationTime = new Text("Empty");
|
private Text txtCreationTime = new Text("Empty");
|
||||||
private Text txtDimension = new Text("Empty");
|
private Text txtDimension = new Text("Empty");
|
||||||
|
|
||||||
|
private Button btnGetInfo;
|
||||||
private Button bHistory;
|
private Button bHistory;
|
||||||
private Button bRead;
|
private Button bRead;
|
||||||
|
|
||||||
|
@ -68,6 +74,20 @@ public class GxtToolBarItemAccounting extends ToolBar{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
btnGetInfo = new Button(INFO, Resources.getIconInfo());
|
||||||
|
|
||||||
|
btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void componentSelected(ButtonEvent ce) {
|
||||||
|
|
||||||
|
AppController.getEventBus().fireEvent(new GetInfoEvent(null));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
add(btnGetInfo);
|
||||||
|
add(new SeparatorToolItem());
|
||||||
add(bHistory);
|
add(bHistory);
|
||||||
add(new SeparatorToolItem());
|
add(new SeparatorToolItem());
|
||||||
add(bRead);
|
add(bRead);
|
||||||
|
@ -86,6 +106,7 @@ public class GxtToolBarItemAccounting extends ToolBar{
|
||||||
public void enableButtons(boolean enable){
|
public void enableButtons(boolean enable){
|
||||||
bHistory.setEnabled(enable);
|
bHistory.setEnabled(enable);
|
||||||
bRead.setEnabled(enable);
|
bRead.setEnabled(enable);
|
||||||
|
btnGetInfo.setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDetails(String itemName, String description, String dimension, String creationTime, String owner){
|
public void setDetails(String itemName, String description, String dimension, String creationTime, String owner){
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.Download
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
|
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent.UploadType;
|
||||||
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
|
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
|
||||||
|
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
|
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
|
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
|
||||||
|
@ -54,7 +55,8 @@ public class GxtToolBarItemFunctionality {
|
||||||
private ToolBar toolBar = new ToolBar();
|
private ToolBar toolBar = new ToolBar();
|
||||||
private Button btnPreview;
|
private Button btnPreview;
|
||||||
private ToggleButton btnGridView;
|
private ToggleButton btnGridView;
|
||||||
private Button btnGetInfo;
|
// private Button btnGetInfo;
|
||||||
|
private Button btnGetSharedLink;
|
||||||
|
|
||||||
public GxtToolBarItemFunctionality() {
|
public GxtToolBarItemFunctionality() {
|
||||||
initToolBar();
|
initToolBar();
|
||||||
|
@ -93,13 +95,12 @@ public class GxtToolBarItemFunctionality {
|
||||||
toolBar.add(btnUploadFile);
|
toolBar.add(btnUploadFile);
|
||||||
|
|
||||||
toolBar.add(new SeparatorToolItem());
|
toolBar.add(new SeparatorToolItem());
|
||||||
|
// btnGetInfo = new Button("Info", Resources.getIconInfo());
|
||||||
btnGetInfo = new Button("Info", Resources.getIconInfo());
|
// btnGetInfo.setScale(ButtonScale.SMALL);
|
||||||
btnGetInfo.setScale(ButtonScale.SMALL);
|
// btnGetInfo.setIconAlign(IconAlign.TOP);
|
||||||
btnGetInfo.setIconAlign(IconAlign.TOP);
|
// btnGetInfo.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
btnGetInfo.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
//
|
||||||
|
// toolBar.add(btnGetInfo);
|
||||||
toolBar.add(btnGetInfo);
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
// toolBar.add(new SeparatorToolItem());
|
||||||
|
|
||||||
btnRemoveItem = new Button(ConstantsPortlet.REMOVEITEM,
|
btnRemoveItem = new Button(ConstantsPortlet.REMOVEITEM,
|
||||||
|
@ -142,6 +143,14 @@ public class GxtToolBarItemFunctionality {
|
||||||
// toolBar.add(new SeparatorToolItem());
|
// toolBar.add(new SeparatorToolItem());
|
||||||
toolBar.add(new SeparatorToolItem());
|
toolBar.add(new SeparatorToolItem());
|
||||||
|
|
||||||
|
toolBar.add(new SeparatorToolItem());
|
||||||
|
btnGetSharedLink = new Button("Share Link", Resources.getIconShareLink());
|
||||||
|
btnGetSharedLink.setScale(ButtonScale.SMALL);
|
||||||
|
btnGetSharedLink.setIconAlign(IconAlign.TOP);
|
||||||
|
btnGetSharedLink.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
|
||||||
|
toolBar.add(btnGetSharedLink);
|
||||||
|
|
||||||
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
|
btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
|
||||||
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
|
btnAccessFromDesktop.setScale(ButtonScale.SMALL);
|
||||||
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
|
btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
|
||||||
|
@ -224,18 +233,31 @@ public class GxtToolBarItemFunctionality {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
|
btnGetSharedLink.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
|
|
||||||
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
||||||
|
|
||||||
AppController.getEventBus().fireEvent(new GetInfoEvent(fileGridModel));
|
AppController.getEventBus().fireEvent(new GetShareLinkEvent(fileGridModel));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// btnGetInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void componentSelected(ButtonEvent ce) {
|
||||||
|
//
|
||||||
|
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
||||||
|
//
|
||||||
|
// AppController.getEventBus().fireEvent(new GetInfoEvent(fileGridModel));
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -452,14 +474,13 @@ public class GxtToolBarItemFunctionality {
|
||||||
this.btnRenameItem.disable();
|
this.btnRenameItem.disable();
|
||||||
this.btnDownloadFile.disable();
|
this.btnDownloadFile.disable();
|
||||||
this.btnOpen.disable();
|
this.btnOpen.disable();
|
||||||
this.btnGetInfo.disable();
|
// this.btnGetInfo.disable();
|
||||||
} else {
|
} else {
|
||||||
this.btnRemoveItem.enable();
|
this.btnRemoveItem.enable();
|
||||||
this.btnRenameItem.enable();
|
this.btnRenameItem.enable();
|
||||||
this.btnDownloadFile.enable();
|
this.btnDownloadFile.enable();
|
||||||
this.btnOpen.enable();
|
this.btnOpen.enable();
|
||||||
this.btnGetInfo.enable();
|
// this.btnGetInfo.enable();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -468,7 +489,7 @@ public class GxtToolBarItemFunctionality {
|
||||||
|
|
||||||
btnRemoveItem.setEnabled(active);
|
btnRemoveItem.setEnabled(active);
|
||||||
btnRenameItem.setEnabled(active);
|
btnRenameItem.setEnabled(active);
|
||||||
btnGetInfo.setEnabled(active);
|
// btnGetInfo.setEnabled(active);
|
||||||
btnDownloadFile.setEnabled(active);
|
btnDownloadFile.setEnabled(active);
|
||||||
btnPreview.setEnabled(active);
|
btnPreview.setEnabled(active);
|
||||||
btnOpen.setEnabled(active);
|
btnOpen.setEnabled(active);
|
||||||
|
|
Loading…
Reference in New Issue