Changed behaviour for Show Bottom when clicking on URL
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@135029 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a36472ea91
commit
ffd949bf99
|
@ -58,7 +58,6 @@ import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEventHa
|
|||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.OpenUrlEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.PasteItemEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.PasteItemEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.PathElementSelectedEvent;
|
||||
|
@ -76,6 +75,8 @@ import org.gcube.portlets.user.workspace.client.event.SearchTextEvent;
|
|||
import org.gcube.portlets.user.workspace.client.event.SearchTextEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.SendMessageEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.SendMessageEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.ShowUrlEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.ShowUrlEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.StoreGridChangedEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.StoreGridChangedEventHandler;
|
||||
import org.gcube.portlets.user.workspace.client.event.TrashEvent;
|
||||
|
@ -209,10 +210,12 @@ public class AppController implements SubscriberInterface {
|
|||
*/
|
||||
private void bind() {
|
||||
//double click on URLs
|
||||
eventBus.addHandler(OpenUrlEvent.TYPE, new OpenUrlEventHandler() {
|
||||
eventBus.addHandler(ShowUrlEvent.TYPE, new ShowUrlEventHandler() {
|
||||
@Override
|
||||
public void onClickUrl(OpenUrlEvent openUrlEvent) {
|
||||
AppControllerExplorer.getInstance().doClickUrl(openUrlEvent);
|
||||
public void onClickUrl(ShowUrlEvent openUrlEvent) {
|
||||
if(openUrlEvent.getSourceFileModel()!=null)
|
||||
|
||||
AppControllerExplorer.getInstance().doClickUrl(new OpenUrlEvent(openUrlEvent.getSourceFileModel()));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
|
||||
/**
|
||||
* The Class ShowUrlEvent.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Nov 29, 2016
|
||||
*/
|
||||
public class ShowUrlEvent extends GwtEvent<ShowUrlEventHandler> {
|
||||
public static Type<ShowUrlEventHandler> TYPE = new Type<ShowUrlEventHandler>();
|
||||
|
||||
private FileModel sourceFileModel = null; //Url page
|
||||
|
||||
/**
|
||||
* Instantiates a new show url event.
|
||||
*
|
||||
* @param fileSourceModel the file source model
|
||||
*/
|
||||
public ShowUrlEvent(FileModel fileSourceModel) {
|
||||
this.sourceFileModel = fileSourceModel;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<ShowUrlEventHandler> getAssociatedType() {
|
||||
// TODO Auto-generated method stub
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(ShowUrlEventHandler handler) {
|
||||
handler.onClickUrl(this);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source file model.
|
||||
*
|
||||
* @return the source file model
|
||||
*/
|
||||
public FileModel getSourceFileModel() {
|
||||
return sourceFileModel;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
public interface ShowUrlEventHandler extends EventHandler {
|
||||
void onClickUrl(ShowUrlEvent openUrlEvent);
|
||||
}
|
|
@ -14,7 +14,7 @@ import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEvent
|
|||
import org.gcube.portlets.user.workspace.client.event.ImagePreviewEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.OpenContextMenuTreeEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.OpenReportsEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.OpenUrlEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.ShowUrlEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.StoreGridChangedEvent;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
|
@ -313,7 +313,7 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
|||
AppController.getEventBus().fireEvent(new FileDownloadEvent(target.getIdentifier(), target.getName(), DownloadType.SHOW, target.isDirectory() || target.isVreFolder()));
|
||||
break;
|
||||
case EXTERNAL_URL:
|
||||
AppController.getEventBus().fireEvent(new OpenUrlEvent(target));
|
||||
AppController.getEventBus().fireEvent(new ShowUrlEvent(target));
|
||||
break;
|
||||
case REPORT_TEMPLATE:
|
||||
case REPORT:
|
||||
|
|
|
@ -13,16 +13,16 @@ import org.gcube.portlets.user.workspace.client.event.DoubleClickElementSelected
|
|||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.FileDownloadEvent.DownloadType;
|
||||
import org.gcube.portlets.user.workspace.client.event.FileUploadEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.GetPublicLinkEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.GridRefreshEvent;
|
||||
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.ShowUrlEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.PasteItemEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.VREChangePermissionsEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
|
||||
import org.gcube.portlets.user.workspace.client.event.WsGetFolderLinkEvent;
|
||||
import org.gcube.portlets.user.workspace.client.interfaces.GXTFolderItemTypeEnum;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
|
@ -524,7 +524,7 @@ public class GxtToolBarItemFunctionality {
|
|||
public void componentSelected(ButtonEvent ce) {
|
||||
|
||||
final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
||||
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD, (fileGridModel.isDirectory() || fileGridModel.isVreFolder())));
|
||||
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD, fileGridModel.isDirectory() || fileGridModel.isVreFolder()));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -550,10 +550,13 @@ public class GxtToolBarItemFunctionality {
|
|||
if(fileGridModel!=null){
|
||||
if(fileGridModel.isDirectory())
|
||||
AppController.getEventBus().fireEvent(new DoubleClickElementSelectedEvent(fileGridModel));
|
||||
else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT) || fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT_TEMPLATE))
|
||||
AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
|
||||
else
|
||||
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW,(fileGridModel.isDirectory() || fileGridModel.isVreFolder())));
|
||||
// else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT) || fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.REPORT_TEMPLATE))
|
||||
// AppController.getEventBus().fireEvent(new OpenReportsEvent(fileGridModel));
|
||||
else if(fileGridModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.EXTERNAL_URL)){
|
||||
AppController.getEventBus().fireEvent(new ShowUrlEvent(fileGridModel));
|
||||
|
||||
}else
|
||||
AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.SHOW,fileGridModel.isDirectory() || fileGridModel.isVreFolder()));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue