added get info completed
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@71689 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4f4d7f890d
commit
08604da86c
|
@ -64,8 +64,8 @@ import org.gcube.portlets.user.workspace.client.model.ScopeModel;
|
||||||
import org.gcube.portlets.user.workspace.client.view.WorskpacePortlet;
|
import org.gcube.portlets.user.workspace.client.view.WorskpacePortlet;
|
||||||
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
|
import org.gcube.portlets.user.workspace.client.view.panels.GxtBorderLayoutPanel;
|
||||||
import org.gcube.portlets.user.workspace.client.view.panels.GxtItemsPanel;
|
import org.gcube.portlets.user.workspace.client.view.panels.GxtItemsPanel;
|
||||||
|
import org.gcube.portlets.user.workspace.client.view.windows.DialogGetInfo;
|
||||||
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
|
import org.gcube.portlets.user.workspace.client.view.windows.MessageBoxAlert;
|
||||||
import org.gcube.portlets.user.workspace.client.window.DialogGetInfo;
|
|
||||||
import org.gcube.portlets.user.wsmail.client.forms.MailForm;
|
import org.gcube.portlets.user.wsmail.client.forms.MailForm;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -137,16 +137,7 @@ public class AppController implements SubscriberInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
eventBus.addHandler(GetInfoEvent.TYPE, new GetInfoEventHandler() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onGetInfo(GetInfoEvent getInfoEvent) {
|
|
||||||
new DialogGetInfo(getInfoEvent.getSourceFile());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//********EVENTS TO NOTIFY SUBSCRIBERS
|
//********EVENTS TO NOTIFY SUBSCRIBERS
|
||||||
eventBus.addHandler(OpenReportsEvent.TYPE, new OpenReportsEventHandler() {
|
eventBus.addHandler(OpenReportsEvent.TYPE, new OpenReportsEventHandler() {
|
||||||
|
|
||||||
|
@ -157,6 +148,14 @@ public class AppController implements SubscriberInterface {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(GetInfoEvent.TYPE, new GetInfoEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGetInfo(GetInfoEvent getInfoEvent) {
|
||||||
|
new DialogGetInfo(getInfoEvent.getSourceFile());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
eventBus.addHandler(PreviewMessageEvent.TYPE, new PreviewMessageEventHandler() {
|
eventBus.addHandler(PreviewMessageEvent.TYPE, new PreviewMessageEventHandler() {
|
||||||
|
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.client.event;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class GetInfoEvent extends GwtEvent<GetInfoEventHandler> {
|
|
||||||
public static Type<GetInfoEventHandler> TYPE = new Type<GetInfoEventHandler>();
|
|
||||||
|
|
||||||
private FileGridModel targetFile = null;
|
|
||||||
|
|
||||||
public GetInfoEvent(FileGridModel target) {
|
|
||||||
this.targetFile = target;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Type<GetInfoEventHandler> getAssociatedType() {
|
|
||||||
return TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void dispatch(GetInfoEventHandler handler) {
|
|
||||||
handler.onGetInfo(this);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public FileGridModel getSourceFile() {
|
|
||||||
return targetFile;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
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 GetInfoEventHandler extends EventHandler {
|
|
||||||
void onGetInfo(GetInfoEvent getInfoEvent);
|
|
||||||
}
|
|
|
@ -57,9 +57,9 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
private GroupingStore<FileGridModel> store = GroupingStoreModel.getInstance().getStore();
|
private GroupingStore<FileGridModel> store = GroupingStoreModel.getInstance().getStore();
|
||||||
private FileGridModel currenItemSelected = null;
|
private FileGridModel currenItemSelected = null;
|
||||||
private FileModel currentFolderView = null;
|
private FileModel currentFolderView = null;
|
||||||
private final NumberFormat number = NumberFormat.getFormat("#,##0 KB;(#,##0 KB)");
|
|
||||||
private GroupingView view = new GroupingView();
|
private GroupingView view = new GroupingView();
|
||||||
private boolean groupingEnabled = false;
|
private boolean groupingEnabled = false;
|
||||||
|
private NumberFormat number = ConstantsExplorer.numberFormatterKB;
|
||||||
|
|
||||||
public GxtGridFilterGroupPanel(boolean group) {
|
public GxtGridFilterGroupPanel(boolean group) {
|
||||||
setLayout(new FitLayout());
|
setLayout(new FitLayout());
|
||||||
|
@ -127,7 +127,9 @@ public class GxtGridFilterGroupPanel extends LayoutContainer {
|
||||||
};
|
};
|
||||||
|
|
||||||
GridCellRenderer<FileGridModel> kbRender = new GridCellRenderer<FileGridModel>() {
|
GridCellRenderer<FileGridModel> kbRender = new GridCellRenderer<FileGridModel>() {
|
||||||
@Override
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public String render(FileGridModel model, String property, ColumnData config,
|
public String render(FileGridModel model, String property, ColumnData config,
|
||||||
int rowIndex, int colIndex, ListStore<FileGridModel> store, Grid<FileGridModel> grid) {
|
int rowIndex, int colIndex, ListStore<FileGridModel> store, Grid<FileGridModel> grid) {
|
||||||
|
|
||||||
|
|
|
@ -1,388 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
|
||||||
//
|
|
||||||
//import org.gcube.portlets.user.workspace.client.AppController;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.ConstantsPortlet;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.ConstantsPortlet.ViewSwitchTypeInResult;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.event.AddFolderEvent;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.event.DeleteItemEvent;
|
|
||||||
//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.FileUploadEvent.UploadType;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.event.RenameItemEvent;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.event.WebDavUrlEvent;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.resources.Resources;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.view.GxtListView;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.view.grids.GxtGridFilterGroupPanel;
|
|
||||||
//import org.gcube.portlets.user.workspace.client.view.grids.GxtGridMessagesFilterPanel;
|
|
||||||
//
|
|
||||||
//import com.extjs.gxt.ui.client.Style.ButtonArrowAlign;
|
|
||||||
//import com.extjs.gxt.ui.client.Style.ButtonScale;
|
|
||||||
//import com.extjs.gxt.ui.client.Style.IconAlign;
|
|
||||||
//import com.extjs.gxt.ui.client.event.ButtonEvent;
|
|
||||||
//import com.extjs.gxt.ui.client.event.SelectionListener;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.ContentPanel;
|
|
||||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.button.Button;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.button.ToggleButton;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.layout.CardLayout;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
|
||||||
//import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
|
||||||
//import com.google.gwt.user.client.Element;
|
|
||||||
//
|
|
||||||
/**
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
* THIS CLASS IS NOT USED
|
|
||||||
*/
|
|
||||||
public class GxtToolBarFunctionsPanel extends LayoutContainer {
|
|
||||||
//
|
|
||||||
//// private GxtGridFilterPanel gridFilterViewContainer = null;
|
|
||||||
// private Button btnAddFolder = null;
|
|
||||||
// private Button btnRemoveItem = null;
|
|
||||||
// private Button btnRenameItem = null;
|
|
||||||
// private Button btnUploadFile = null;
|
|
||||||
// private Button btnUploadArchive = null;
|
|
||||||
// private Button btnDownloadFile = null;
|
|
||||||
// private GxtListView iconsViewContainer = null;
|
|
||||||
// private ToggleButton toggleGroup = new ToggleButton();
|
|
||||||
// private ToggleButton toggleList = new ToggleButton();
|
|
||||||
// private ToggleButton toggleIcon = new ToggleButton();
|
|
||||||
// private GxtGridFilterGroupPanel gridGroupViewContainer;
|
|
||||||
// private GxtPathPanel toolBarPathContainer;
|
|
||||||
// private GxtGridMessagesFilterPanel messagesPanelContainer;
|
|
||||||
// private GxtGridFilterGroupPanel gridFilterViewContainer;
|
|
||||||
// private ToolBar toolBar = new ToolBar();
|
|
||||||
// private CardLayout cardLayout = new CardLayout();
|
|
||||||
// private Button btnAccessFromDesktop = null;
|
|
||||||
//
|
|
||||||
// public GxtToolBarFunctionsPanel(GxtPathPanel toolBarPath,
|
|
||||||
// GxtGridFilterGroupPanel gridFilterContainer,
|
|
||||||
// GxtGridFilterGroupPanel gridFilterGroupContainer,
|
|
||||||
// GxtListView listViewContainer,
|
|
||||||
// GxtGridMessagesFilterPanel messagesPanelContainer) {
|
|
||||||
//
|
|
||||||
// this.gridFilterViewContainer = gridFilterContainer;
|
|
||||||
// this.iconsViewContainer = listViewContainer;
|
|
||||||
// this.gridGroupViewContainer = gridFilterGroupContainer;
|
|
||||||
// this.toolBarPathContainer = toolBarPath;
|
|
||||||
// this.messagesPanelContainer = messagesPanelContainer;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// protected void onRender(Element parent, int pos) {
|
|
||||||
// super.onRender(parent, pos);
|
|
||||||
// setLayout(new FitLayout());
|
|
||||||
//
|
|
||||||
// ContentPanel cp = createStandardToolbarPanel(cardLayout);
|
|
||||||
// // ContentPanel cp = new ContentPanel();
|
|
||||||
//
|
|
||||||
// addSelectionListenersOnToolBar();
|
|
||||||
// cp.add(gridGroupViewContainer);
|
|
||||||
//// cp.add(gridFilterViewContainer);
|
|
||||||
//// cp.add(iconsViewContainer);
|
|
||||||
//
|
|
||||||
// cp.add(messagesPanelContainer);
|
|
||||||
//
|
|
||||||
// cardLayout.setActiveItem(gridGroupViewContainer);
|
|
||||||
//
|
|
||||||
// add(cp);
|
|
||||||
//
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// public void setActivePanel(ViewSwitchTypeInResult type){
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// if(type.equals(ViewSwitchTypeInResult.Group)){
|
|
||||||
// cardLayout.setActiveItem(gridGroupViewContainer);
|
|
||||||
// toolBar.setEnabled(true);
|
|
||||||
// }
|
|
||||||
// else if(type.equals(ViewSwitchTypeInResult.Icons)){
|
|
||||||
// cardLayout.setActiveItem(iconsViewContainer);
|
|
||||||
// toolBar.setEnabled(true);
|
|
||||||
// }
|
|
||||||
// else if(type.equals(ViewSwitchTypeInResult.Messages)){
|
|
||||||
// cardLayout.setActiveItem(messagesPanelContainer);
|
|
||||||
// toolBar.setEnabled(false);
|
|
||||||
// }
|
|
||||||
//// else if(type.equals(ViewSwitchTypeInResult.List))
|
|
||||||
//// cardLayout.setActiveItem(gridFilterViewContainer);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private ContentPanel createStandardToolbarPanel(CardLayout cardLayout) {
|
|
||||||
// ContentPanel panel = new ContentPanel();
|
|
||||||
// panel.setLayout(cardLayout);
|
|
||||||
//// panel.setLayout(new FitLayout());
|
|
||||||
// panel.setBodyStyle("padding: 1px");
|
|
||||||
// panel.setHeaderVisible(false);
|
|
||||||
//
|
|
||||||
// btnAddFolder = new Button(ConstantsPortlet.ADDFOLDER, Resources.getIconAddFolder());
|
|
||||||
//
|
|
||||||
// btnAddFolder.setScale(ButtonScale.SMALL);
|
|
||||||
// btnAddFolder.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnAddFolder.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
//
|
|
||||||
// toolBar.add(btnAddFolder);
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
//
|
|
||||||
// btnRemoveItem = new Button(ConstantsPortlet.REMOVEITEM, Resources.getIconDeleteItem());
|
|
||||||
// btnRemoveItem.setScale(ButtonScale.SMALL);
|
|
||||||
// btnRemoveItem.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnRemoveItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
//
|
|
||||||
// toolBar.add(btnRemoveItem);
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
//
|
|
||||||
// btnRenameItem = new Button(ConstantsPortlet.RENAMEITEM, Resources.getIconRenameItem());
|
|
||||||
// btnRenameItem.setScale(ButtonScale.SMALL);
|
|
||||||
// btnRenameItem.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnRenameItem.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
// toolBar.add(btnRenameItem);
|
|
||||||
//
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
//
|
|
||||||
// btnUploadFile = new Button(ConstantsPortlet.UPLOADFILE, Resources.getIconFileUpload());
|
|
||||||
// btnUploadFile.setScale(ButtonScale.SMALL);
|
|
||||||
// btnUploadFile.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnUploadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
//
|
|
||||||
// toolBar.add(btnUploadFile);
|
|
||||||
//
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
//
|
|
||||||
// btnUploadArchive = new Button(ConstantsPortlet.UPLOADARCHIVE, Resources.getIconArchiveUpload());
|
|
||||||
// btnUploadArchive.setScale(ButtonScale.SMALL);
|
|
||||||
// btnUploadArchive.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnUploadArchive.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
//
|
|
||||||
// toolBar.add(btnUploadArchive);
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
// toolBar.add(new SeparatorToolItem());
|
|
||||||
//
|
|
||||||
// btnDownloadFile = new Button(ConstantsPortlet.DOWNLOADITEM, Resources.getIconDownload());
|
|
||||||
// btnDownloadFile.setScale(ButtonScale.SMALL);
|
|
||||||
// btnDownloadFile.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnDownloadFile.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
//
|
|
||||||
// toolBar.add(btnDownloadFile);
|
|
||||||
//
|
|
||||||
// toolBar.add(new FillToolItem());
|
|
||||||
//
|
|
||||||
// btnAccessFromDesktop = new Button(ConstantsPortlet.TITLEACCESSWEBDAV, Resources.getIconWebDav());
|
|
||||||
// btnAccessFromDesktop.setScale(ButtonScale.SMALL);
|
|
||||||
// btnAccessFromDesktop.setIconAlign(IconAlign.TOP);
|
|
||||||
// btnAccessFromDesktop.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
|
||||||
//
|
|
||||||
// toolBar.add(btnAccessFromDesktop);
|
|
||||||
//
|
|
||||||
// toggleGroup = new ToggleButton();
|
|
||||||
// toggleGroup.setIcon(Resources.getIconToggleGroup());
|
|
||||||
// toggleGroup.setToggleGroup("viewgrid");
|
|
||||||
// toggleGroup.toggle(true);
|
|
||||||
//
|
|
||||||
// toggleIcon = new ToggleButton();
|
|
||||||
// toggleIcon.setIcon(Resources.getIconToggleIcon());
|
|
||||||
// toggleIcon.setToggleGroup("viewgrid");
|
|
||||||
//
|
|
||||||
// toggleList = new ToggleButton();
|
|
||||||
// toggleList.setIcon(Resources.getIconToggleList());
|
|
||||||
// toggleList.setToggleGroup("viewgrid");
|
|
||||||
//
|
|
||||||
// switchView(ViewSwitchTypeInResult.Group);
|
|
||||||
//
|
|
||||||
// this.activeButtonsOnSelect(false);
|
|
||||||
//
|
|
||||||
// panel.setTopComponent(toolBar); //Add toolBar
|
|
||||||
//
|
|
||||||
// return panel;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private void addSelectionListenersOnToolBar(){
|
|
||||||
//
|
|
||||||
// btnAddFolder.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//
|
|
||||||
//// final FileGridModel fileGridModel = gridFilterContainer.getSelectedItem();
|
|
||||||
//
|
|
||||||
// AppController.getEventBus().fireEvent(new AddFolderEvent(gridGroupViewContainer.getCurrentFolderView(),null));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// btnRemoveItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//
|
|
||||||
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
|
||||||
//
|
|
||||||
// AppController.getEventBus().fireEvent(new DeleteItemEvent(fileGridModel));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// btnRenameItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//
|
|
||||||
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
|
||||||
//
|
|
||||||
// AppController.getEventBus().fireEvent(new RenameItemEvent(fileGridModel));
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// btnUploadFile.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//// AppController.getEventBus().fireEvent(event)
|
|
||||||
//// new DialogUpload(ConstantsExplorer.FILEUPLOADHEADER, toolBarPathContainer.getLastParent().getName(), ConstantsExplorer.FILE);
|
|
||||||
// AppController.getEventBus().fireEvent(new FileUploadEvent(null, UploadType.FILE));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// btnUploadArchive.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//// new DialogUpload(ConstantsExplorer.ARCHIVEUPLOADHEADER, , ConstantsExplorer.ARCHIVE);
|
|
||||||
// AppController.getEventBus().fireEvent(new FileUploadEvent(null, UploadType.ARCHIVE));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// btnDownloadFile.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//
|
|
||||||
// final FileGridModel fileGridModel = gridGroupViewContainer.getSelectedItem();
|
|
||||||
//
|
|
||||||
// AppController.getEventBus().fireEvent(new FileDownloadEvent(fileGridModel.getIdentifier(), fileGridModel.getName(), DownloadType.DOWNLOAD));
|
|
||||||
//
|
|
||||||
//// com.google.gwt.user.client.Window.open(GWT.getModuleBaseURL()+"DownloadService?id="+contextItem.getId(), "", "");
|
|
||||||
//// break;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// btnAccessFromDesktop.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
//
|
|
||||||
// AppController.getEventBus().fireEvent(new WebDavUrlEvent(null));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// toggleGroup.addSelectionListener(new SelectionListener<ButtonEvent>(){
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
// if(toggleGroup.isPressed()){
|
|
||||||
// switchView(ViewSwitchTypeInResult.Group);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//// Window.alert("ViewSwitchTypeInResult.Group");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// toggleList.addSelectionListener(new SelectionListener<ButtonEvent>(){
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
// if(toggleList.isPressed()){
|
|
||||||
// switchView(ViewSwitchTypeInResult.List);
|
|
||||||
// }
|
|
||||||
//// Window.alert("ViewSwitchTypeInResult.List");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// toggleIcon.addSelectionListener(new SelectionListener<ButtonEvent>(){
|
|
||||||
// @Override
|
|
||||||
// public void componentSelected(ButtonEvent ce) {
|
|
||||||
// if(toggleIcon.isPressed()){
|
|
||||||
// switchView(ViewSwitchTypeInResult.Icons);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private void switchView(ViewSwitchTypeInResult type) {
|
|
||||||
//
|
|
||||||
// if (type.compareTo(ViewSwitchTypeInResult.Icons) == 0) {
|
|
||||||
// this.gridFilterViewContainer.setVisible(false);
|
|
||||||
// this.gridGroupViewContainer.setVisible(false);
|
|
||||||
// this.iconsViewContainer.setVisible(true);
|
|
||||||
//// toggleGroup.toggle(false);
|
|
||||||
//// toggleList.toggle(false);
|
|
||||||
//// toggleIcon.toggle(true);
|
|
||||||
//
|
|
||||||
// } else{
|
|
||||||
// if (type.compareTo(ViewSwitchTypeInResult.List) == 0) {
|
|
||||||
//
|
|
||||||
// this.iconsViewContainer.setVisible(false);
|
|
||||||
// this.gridGroupViewContainer.setVisible(false);
|
|
||||||
// this.gridFilterViewContainer.setVisible(true);
|
|
||||||
//// toggleGroup.toggle(false);
|
|
||||||
//// toggleList.toggle(true);
|
|
||||||
//// toggleIcon.toggle(false);
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// this.iconsViewContainer.setVisible(false);
|
|
||||||
// this.gridFilterViewContainer.setVisible(false);
|
|
||||||
// this.gridGroupViewContainer.setVisible(true);
|
|
||||||
//// toggleGroup.toggle(true);
|
|
||||||
//// toggleList.toggle(false);
|
|
||||||
//// toggleIcon.toggle(false);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void activeButtonsOnSelect(boolean active){
|
|
||||||
//
|
|
||||||
// if(!active){
|
|
||||||
//// this.btnAddFolder.disable();
|
|
||||||
// this.btnRemoveItem.disable();
|
|
||||||
// this.btnRenameItem.disable();
|
|
||||||
// this.btnDownloadFile.disable();
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
//// this.btnAddFolder.enable();
|
|
||||||
// this.btnRemoveItem.enable();
|
|
||||||
// this.btnRenameItem.enable();
|
|
||||||
// this.btnDownloadFile.enable();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void activeAllButtons(boolean active){
|
|
||||||
//
|
|
||||||
// if(!active){
|
|
||||||
// this.btnAddFolder.disable();
|
|
||||||
// this.btnRemoveItem.disable();
|
|
||||||
// this.btnRenameItem.disable();
|
|
||||||
// this.btnDownloadFile.disable();
|
|
||||||
// this.btnUploadArchive.disable();
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// this.btnAddFolder.enable();
|
|
||||||
// this.btnRemoveItem.enable();
|
|
||||||
// this.btnRenameItem.enable();
|
|
||||||
// this.btnDownloadFile.enable();
|
|
||||||
// this.btnUploadArchive.enable();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//public GxtGridMessagesFilterPanel getMessagesPanelContainer() {
|
|
||||||
// return messagesPanelContainer;
|
|
||||||
//}
|
|
||||||
}
|
|
|
@ -163,8 +163,6 @@ public class GxtToolBarItem {
|
||||||
// toolBar.add(new SeparatorToolItem());
|
// toolBar.add(new SeparatorToolItem());
|
||||||
// toolBar.add(new SeparatorToolItem());
|
// toolBar.add(new SeparatorToolItem());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO OLD CODE
|
//TODO OLD CODE
|
||||||
toggleGroup = new ToggleButton();
|
toggleGroup = new ToggleButton();
|
||||||
|
|
|
@ -1,199 +0,0 @@
|
||||||
package org.gcube.portlets.user.workspace.client.window;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.AppControllerExplorer;
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.FileGridModel;
|
|
||||||
import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
|
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
|
||||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
|
||||||
import com.extjs.gxt.ui.client.event.SelectionListener;
|
|
||||||
import com.extjs.gxt.ui.client.widget.Dialog;
|
|
||||||
import com.extjs.gxt.ui.client.widget.form.TextArea;
|
|
||||||
import com.extjs.gxt.ui.client.widget.form.TextField;
|
|
||||||
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.i18n.client.NumberFormat;
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DialogGetInfo extends Dialog {
|
|
||||||
|
|
||||||
private int widthDialog = 450;
|
|
||||||
private int heightTextArea = 50;
|
|
||||||
private TextField<String> txtName = new TextField<String>();
|
|
||||||
private TextField<String> txtType = new TextField<String>();
|
|
||||||
private TextField<String> txtCategory = new TextField<String>();
|
|
||||||
private TextField<String> txtOwner = new TextField<String>();
|
|
||||||
|
|
||||||
private TextField<String> txtCreated = new TextField<String>();
|
|
||||||
private TextField<String> txtSize = new TextField<String>();
|
|
||||||
private TextField<String> txtLocation = new TextField<String>();
|
|
||||||
private TextField<String> txtShared = new TextField<String>();
|
|
||||||
private TextArea textAreaSharedWith = new TextArea();
|
|
||||||
private final NumberFormat number = NumberFormat.getFormat("#,##0 KB;(#,##0 KB)");
|
|
||||||
|
|
||||||
|
|
||||||
public DialogGetInfo(FileGridModel fileModel) {
|
|
||||||
|
|
||||||
FormLayout layout = new FormLayout();
|
|
||||||
layout.setLabelWidth(90);
|
|
||||||
layout.setDefaultWidth(300);
|
|
||||||
setLayout(layout);
|
|
||||||
|
|
||||||
setIcon(fileModel.getAbstractPrototypeIcon());
|
|
||||||
setHeading(fileModel.getName() + " Properties");
|
|
||||||
|
|
||||||
setButtonAlign(HorizontalAlignment.RIGHT);
|
|
||||||
setModal(true);
|
|
||||||
// setBodyBorder(true);
|
|
||||||
setBodyStyle("padding: 9px; background: none");
|
|
||||||
setWidth(widthDialog);
|
|
||||||
setResizable(false);
|
|
||||||
setButtons(Dialog.OK);
|
|
||||||
|
|
||||||
txtName = new TextField<String>();
|
|
||||||
txtName.setFieldLabel("Name");
|
|
||||||
txtName.setReadOnly(true);
|
|
||||||
textFieldSetValue(txtName,fileModel.getName());
|
|
||||||
add(txtName);
|
|
||||||
|
|
||||||
txtType = new TextField<String>();
|
|
||||||
txtType.setFieldLabel("Type");
|
|
||||||
txtType.setReadOnly(true);
|
|
||||||
textFieldSetValue(txtType,fileModel.getType());
|
|
||||||
add(txtType);
|
|
||||||
|
|
||||||
txtCategory = new TextField<String>();
|
|
||||||
txtCategory.setFieldLabel("Category");
|
|
||||||
txtCategory.setReadOnly(true);
|
|
||||||
textFieldSetValue(txtCategory,fileModel.getShortcutCategory());
|
|
||||||
add(txtCategory);
|
|
||||||
|
|
||||||
txtOwner = new TextField<String>();
|
|
||||||
txtOwner.setFieldLabel("Owner");
|
|
||||||
txtOwner.setReadOnly(true);
|
|
||||||
loadOwner(fileModel.getIdentifier());
|
|
||||||
add(txtOwner);
|
|
||||||
|
|
||||||
txtCreated = new TextField<String>();
|
|
||||||
txtCreated.setFieldLabel("Created");
|
|
||||||
txtCreated.setReadOnly(true);
|
|
||||||
textFieldSetValue(txtCreated,fileModel.getCreationDate().toString());
|
|
||||||
add(txtCreated);
|
|
||||||
|
|
||||||
txtSize = new TextField<String>();
|
|
||||||
txtSize.setFieldLabel("Size");
|
|
||||||
txtSize.setReadOnly(true);
|
|
||||||
|
|
||||||
textFieldSetValue(txtSize,getFormattedSize(fileModel.getSize()));
|
|
||||||
add(txtSize);
|
|
||||||
|
|
||||||
|
|
||||||
txtShared = new TextField<String>();
|
|
||||||
txtShared.setFieldLabel("Shared");
|
|
||||||
txtShared.setReadOnly(true);
|
|
||||||
textFieldSetValue(txtShared,fileModel.isShared()+"");
|
|
||||||
add(txtShared);
|
|
||||||
|
|
||||||
|
|
||||||
if(fileModel.isShared()){
|
|
||||||
|
|
||||||
textAreaSharedWith.setFieldLabel("Shared with");
|
|
||||||
textAreaSharedWith.setHeight(heightTextArea);
|
|
||||||
textAreaSharedWith.setReadOnly(true);
|
|
||||||
getListSharedContacts(fileModel.getIdentifier());
|
|
||||||
add(textAreaSharedWith);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void componentSelected(ButtonEvent ce) {
|
|
||||||
hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textFieldSetValue(TextField<String> field, String value){
|
|
||||||
|
|
||||||
if(value==null || value.isEmpty())
|
|
||||||
field.setValue("unknown");
|
|
||||||
else
|
|
||||||
field.setValue(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadOwner(final String itemId){
|
|
||||||
|
|
||||||
txtOwner.mask();
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getOwnerByItemId(itemId, new AsyncCallback<InfoContactModel>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
GWT.log("an error occured in get Owner by Id "+itemId + " "+caught.getMessage());
|
|
||||||
txtOwner.unmask();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(InfoContactModel result) {
|
|
||||||
textFieldSetValue(txtOwner,result.getName());
|
|
||||||
txtOwner.unmask();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getListSharedContacts(String sharedId){
|
|
||||||
|
|
||||||
textAreaSharedWith.mask();
|
|
||||||
|
|
||||||
AppControllerExplorer.rpcWorkspaceService.getListUserSharedBySharedItem(sharedId, new AsyncCallback<List<InfoContactModel>>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Throwable caught) {
|
|
||||||
textAreaSharedWith.unmask();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<InfoContactModel> result) {
|
|
||||||
|
|
||||||
String users = "";
|
|
||||||
|
|
||||||
for (int i = 0; i < result.size()-1; i++) {
|
|
||||||
users+= result.get(i).getName() + ", ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(result.size()>1)
|
|
||||||
users += result.get(result.size()-1).getName();
|
|
||||||
|
|
||||||
textAreaSharedWith.setValue(users);
|
|
||||||
|
|
||||||
textAreaSharedWith.unmask();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getFormattedSize(long value){
|
|
||||||
|
|
||||||
if(value>0){
|
|
||||||
double kb = value/1024;
|
|
||||||
if(kb<1)
|
|
||||||
kb=1;
|
|
||||||
return number.format(kb);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue