fixed shared link

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@76880 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-06-07 13:45:56 +00:00
parent 6bd8c1e211
commit c3f4d011ac
2 changed files with 27 additions and 4 deletions

View File

@ -29,6 +29,8 @@ import org.gcube.portlets.user.workspace.client.event.FileUploadEventHandler;
import org.gcube.portlets.user.workspace.client.event.FilterScopeEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEvent;
import org.gcube.portlets.user.workspace.client.event.GetInfoEventHandler;
import org.gcube.portlets.user.workspace.client.event.GetShareLinkEvent;
import org.gcube.portlets.user.workspace.client.event.GetSharedLinkEventHandler;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEvent;
import org.gcube.portlets.user.workspace.client.event.GridElementSelectedEventHandler;
import org.gcube.portlets.user.workspace.client.event.GridElementUnSelectedEvent;
@ -199,6 +201,15 @@ public class AppController implements SubscriberInterface {
new DialogGetInfo(file);
}
});
eventBus.addHandler(GetShareLinkEvent.TYPE, new GetSharedLinkEventHandler() {
@Override
public void onGetLink(GetShareLinkEvent getLinkEvent) {
AppControllerExplorer.getEventBus().fireEvent(new GetShareLinkEvent(getLinkEvent.getSourceFile()));
}
});
eventBus.addHandler(PreviewMessageEvent.TYPE, new PreviewMessageEventHandler() {
@ -630,7 +641,7 @@ public class AppController implements SubscriberInterface {
private void doElementGridSelected(boolean isSelected, FileModel target) {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activeButtonsOnSelect(target, isSelected);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activeButtonsOnSelectForOperation(target, isSelected);
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemDetails().enableButtons(isSelected);
if(isSelected){

View File

@ -143,7 +143,6 @@ public class GxtToolBarItemFunctionality {
// 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);
@ -191,7 +190,7 @@ public class GxtToolBarItemFunctionality {
// toolBar.add(new FillToolItem());
this.activeButtonsOnSelect(null, false);
this.activeButtonsOnSelectForOperation(null, false);
}
public void toggleGridViewButton(boolean toogle){
@ -409,7 +408,7 @@ public class GxtToolBarItemFunctionality {
}
public void activeButtonsOnSelect(FileModel target, boolean active) {
public void activeButtonsOnSelectForOperation(FileModel target, boolean active) {
this.btnPreview.disable();
this.btnOpen.enable();
@ -460,6 +459,12 @@ public class GxtToolBarItemFunctionality {
}
}
//HANDLER SharedLink
if(target.isShared())
activeButtonForSharing(active);
else
activeButtonForSharing(false);
}
activeButtons(active);
@ -475,6 +480,7 @@ public class GxtToolBarItemFunctionality {
this.btnDownloadFile.disable();
this.btnOpen.disable();
// this.btnGetInfo.disable();
this.btnGetSharedLink.disable();
} else {
this.btnRemoveItem.enable();
this.btnRenameItem.enable();
@ -485,10 +491,16 @@ public class GxtToolBarItemFunctionality {
}
public void activeButtonForSharing(boolean active){
this.btnGetSharedLink.setEnabled(active);
}
public void activeAllButtonWithoutGroupView(boolean active){
btnRemoveItem.setEnabled(active);
btnRenameItem.setEnabled(active);
btnGetSharedLink.setEnabled(active);
// btnGetInfo.setEnabled(active);
btnDownloadFile.setEnabled(active);
btnPreview.setEnabled(active);