open url with double click implemented, changed icons for html and links, updated revision
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@99428 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
902802e954
commit
c087e182e6
|
@ -182,15 +182,17 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
private FileUploader fileUploader;
|
||||
public static String myLogin;
|
||||
|
||||
private static AppControllerExplorer singleton;
|
||||
|
||||
public AppControllerExplorer() {
|
||||
Registry.register(ConstantsExplorer.RPC_WORKSPACE_SERVICE, rpcWorkspaceService);
|
||||
subscribers = new HashMap<EventsTypeEnum, ArrayList<SubscriberInterface>>();
|
||||
bind();
|
||||
|
||||
singleton = this;
|
||||
}
|
||||
|
||||
public AppControllerExplorer getInstance() {
|
||||
return this;
|
||||
public static AppControllerExplorer getInstance() {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
public static HandlerManager getEventBus() {
|
||||
|
@ -1634,44 +1636,6 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
doClickUrl(openUrlEvent);
|
||||
|
||||
}
|
||||
|
||||
private void doClickUrl(OpenUrlEvent openUrlEvent) {
|
||||
|
||||
final FileModel fileModel = openUrlEvent.getSourceFileModel();
|
||||
|
||||
if(fileModel==null)
|
||||
return;
|
||||
|
||||
rpcWorkspaceService.getUrlById(fileModel.getIdentifier(), fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.URL_DOCUMENT), false, new AsyncCallback<GWTWorkspaceItem>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
explorerPanel.getAsycTreePanel().unmask();
|
||||
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " clicking url.", null);
|
||||
explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(GWTWorkspaceItem result) {
|
||||
|
||||
|
||||
if(fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.URL_DOCUMENT)){
|
||||
new WindowOpenUrl(((GWTUrlDocument) result).getUrl(), "_blank", "");
|
||||
GWT.log("URL_DOCUMENT Open " + ((GWTUrlDocument) result).getUrl());
|
||||
}
|
||||
else{
|
||||
new WindowOpenUrl(((GWTExternalUrl) result).getUrl(), "_blank", "");
|
||||
GWT.log("ExternalUrl Open " + ((GWTExternalUrl) result).getUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// com.google.gwt.user.client.Window.open(ConstantsExplorer.DOWNLOAD_WORKSPACE_SERVICE+"?id="+fileModel.getIdentifier()+"&viewContent=true", fileModel.getName(), "");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
@ -2528,4 +2492,41 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
explorerPanel.getAsycTreePanel().setSearch(isSearch);
|
||||
}
|
||||
|
||||
public void doClickUrl(OpenUrlEvent openUrlEvent) {
|
||||
|
||||
final FileModel fileModel = openUrlEvent.getSourceFileModel();
|
||||
|
||||
if(fileModel==null)
|
||||
return;
|
||||
|
||||
rpcWorkspaceService.getUrlById(fileModel.getIdentifier(), fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.URL_DOCUMENT), false, new AsyncCallback<GWTWorkspaceItem>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
explorerPanel.getAsycTreePanel().unmask();
|
||||
new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " clicking url.", null);
|
||||
explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(GWTWorkspaceItem result) {
|
||||
|
||||
|
||||
if(fileModel.getGXTFolderItemType().equals(GXTFolderItemTypeEnum.URL_DOCUMENT)){
|
||||
new WindowOpenUrl(((GWTUrlDocument) result).getUrl(), "_blank", "");
|
||||
GWT.log("URL_DOCUMENT Open " + ((GWTUrlDocument) result).getUrl());
|
||||
}
|
||||
else{
|
||||
new WindowOpenUrl(((GWTExternalUrl) result).getUrl(), "_blank", "");
|
||||
GWT.log("ExternalUrl Open " + ((GWTExternalUrl) result).getUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// com.google.gwt.user.client.Window.open(ConstantsExplorer.DOWNLOAD_WORKSPACE_SERVICE+"?id="+fileModel.getIdentifier()+"&viewContent=true", fileModel.getName(), "");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public interface Icons extends ClientBundle {
|
|||
@Source("icons/mime/xml.gif")
|
||||
ImageResource xml();
|
||||
|
||||
@Source("icons/mime/html.gif")
|
||||
@Source("icons/mime/ico_htm.gif")
|
||||
ImageResource html();
|
||||
|
||||
@Source("icons/mime/java.gif")
|
||||
|
@ -284,6 +284,10 @@ public interface Icons extends ClientBundle {
|
|||
@Source("icons/link-try.png")
|
||||
ImageResource shareLink();
|
||||
|
||||
|
||||
@Source("icons/openURL.png")
|
||||
ImageResource extLink();
|
||||
|
||||
@Source("icons/sharelink.png")
|
||||
ImageResource publicLink();
|
||||
|
||||
|
|
|
@ -55,6 +55,10 @@ public class Resources {
|
|||
return AbstractImagePrototype.create(ICONS.undo());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconLink(){
|
||||
return AbstractImagePrototype.create(ICONS.extLink());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconShareLink(){
|
||||
|
||||
return AbstractImagePrototype.create(ICONS.shareLink());
|
||||
|
@ -625,7 +629,7 @@ public class Resources {
|
|||
}else if(itemType.equals(GXTFolderItemTypeEnum.EXTERNAL_PDF_FILE)){
|
||||
return Resources.getIconPdf();
|
||||
}else if(itemType.equals(GXTFolderItemTypeEnum.EXTERNAL_URL)){
|
||||
return Resources.getIconHtml();
|
||||
return Resources.getIconLink();
|
||||
}else if(itemType.equals(GXTFolderItemTypeEnum.IMAGE_DOCUMENT)){
|
||||
return Resources.getIconPng();
|
||||
}else if(itemType.equals(GXTFolderItemTypeEnum.METADATA)){
|
||||
|
@ -641,7 +645,7 @@ public class Resources {
|
|||
}else if(itemType.equals(GXTFolderItemTypeEnum.REPORT_TEMPLATE)){
|
||||
return Resources.getIconReportTemplate();
|
||||
}else if(itemType.equals(GXTFolderItemTypeEnum.URL_DOCUMENT)){
|
||||
return Resources.getIconHtml();
|
||||
return Resources.getIconLink();
|
||||
}else if(itemType.equals(GXTFolderItemTypeEnum.WORKFLOW_REPORT)){
|
||||
return Resources.getIconWorkflowReport();
|
||||
}else if(itemType.equals(GXTFolderItemTypeEnum.WORKFLOW_TEMPLATE)){
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 265 B |
Binary file not shown.
After Width: | Height: | Size: 229 B |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in New Issue