updated accountings
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@75354 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
93c1e4fbda
commit
304601f4a3
|
@ -655,14 +655,21 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
@Override
|
||||
public void onAccountingHistoryShow(AccountingHistoryEvent accountingHistoryEvent) {
|
||||
|
||||
String itemIdentifier = accountingHistoryEvent.getItemIdentifier();
|
||||
FileModel fileItem = accountingHistoryEvent.getTargetFileModel();
|
||||
|
||||
if(itemIdentifier!=null){
|
||||
if(fileItem!=null){
|
||||
|
||||
rpcWorkspaceService.getAccountingHistory(itemIdentifier, new AsyncCallback<List<GxtAccountingField>>() {
|
||||
String title = "Accounting history of: "+fileItem.getName();
|
||||
|
||||
final WindowAccountingInfo winInfo = new WindowAccountingInfo(fileItem,title);
|
||||
winInfo.show();
|
||||
winInfo.maskAccountingInfo(true);
|
||||
|
||||
rpcWorkspaceService.getAccountingHistory(fileItem.getIdentifier(), new AsyncCallback<List<GxtAccountingField>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
winInfo.maskAccountingInfo(false);
|
||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||
|
||||
}
|
||||
|
@ -670,9 +677,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
@Override
|
||||
public void onSuccess(List<GxtAccountingField> result) {
|
||||
|
||||
WindowAccountingInfo info = new WindowAccountingInfo(result);
|
||||
info.setWindowTitle("Test");
|
||||
info.show();
|
||||
winInfo.updateInfoContainer(result);
|
||||
winInfo.maskAccountingInfo(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -687,14 +693,21 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
@Override
|
||||
public void onAccountingReadersShow(AccountingReadersEvent accountingReadersEvent) {
|
||||
|
||||
String itemIdentifier = accountingReadersEvent.getItemIdentifier();
|
||||
FileModel fileItem = accountingReadersEvent.getTargetFileModel();
|
||||
|
||||
if(itemIdentifier!=null){
|
||||
if(fileItem!=null){
|
||||
|
||||
rpcWorkspaceService.getAccountingReaders(itemIdentifier, new AsyncCallback<List<GxtAccountingField>>() {
|
||||
String title = "Accounting readers of: "+fileItem.getName();
|
||||
|
||||
final WindowAccountingInfo winInfo = new WindowAccountingInfo(fileItem,title);
|
||||
winInfo.show();
|
||||
winInfo.maskAccountingInfo(true);
|
||||
|
||||
rpcWorkspaceService.getAccountingReaders(fileItem.getIdentifier(), new AsyncCallback<List<GxtAccountingField>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
winInfo.maskAccountingInfo(false);
|
||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||
|
||||
}
|
||||
|
@ -702,9 +715,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
@Override
|
||||
public void onSuccess(List<GxtAccountingField> result) {
|
||||
|
||||
WindowAccountingInfo info = new WindowAccountingInfo(result);
|
||||
info.setWindowTitle("Test");
|
||||
info.show();
|
||||
winInfo.updateInfoContainer(result);
|
||||
winInfo.maskAccountingInfo(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -725,6 +737,8 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
}
|
||||
else
|
||||
com.google.gwt.user.client.Window.open(ConstantsExplorer.DOWNLOAD_WORKSPACE_SERVICE+"?id="+fileDownloadEvent.getItemIdentifier(), "_self", "");
|
||||
|
||||
notifySubscriber(fileDownloadEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1515,6 +1529,12 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
|
||||
|
||||
}else if(event instanceof FileDownloadEvent){
|
||||
|
||||
FileDownloadEvent messageEvent = (FileDownloadEvent) event;
|
||||
|
||||
sub.fileDownloaded(messageEvent.getItemIdentifier());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
|
@ -11,10 +13,10 @@ import com.google.gwt.event.shared.GwtEvent;
|
|||
public class AccountingHistoryEvent extends
|
||||
GwtEvent<AccountingHistoryEventHandler> {
|
||||
public static Type<AccountingHistoryEventHandler> TYPE = new Type<AccountingHistoryEventHandler>();
|
||||
private String itemIdentifier;
|
||||
private FileModel targetFileModel;
|
||||
|
||||
public AccountingHistoryEvent(String itemIdentifier) {
|
||||
this.itemIdentifier = itemIdentifier;
|
||||
public AccountingHistoryEvent(FileModel target) {
|
||||
this.setTargetFileModel(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,12 +29,19 @@ public class AccountingHistoryEvent extends
|
|||
handler.onAccountingHistoryShow(this);
|
||||
}
|
||||
|
||||
public String getItemIdentifier() {
|
||||
return itemIdentifier;
|
||||
/**
|
||||
* @return the targetFileModel
|
||||
*/
|
||||
public FileModel getTargetFileModel() {
|
||||
return targetFileModel;
|
||||
}
|
||||
|
||||
public void setItemIdentifier(String itemIdentifier) {
|
||||
this.itemIdentifier = itemIdentifier;
|
||||
/**
|
||||
* @param targetFileModel the targetFileModel to set
|
||||
*/
|
||||
public void setTargetFileModel(FileModel targetFileModel) {
|
||||
this.targetFileModel = targetFileModel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
/**
|
||||
|
@ -11,10 +13,10 @@ import com.google.gwt.event.shared.GwtEvent;
|
|||
public class AccountingReadersEvent extends
|
||||
GwtEvent<AccountingReadersEventHandler> {
|
||||
public static Type<AccountingReadersEventHandler> TYPE = new Type<AccountingReadersEventHandler>();
|
||||
private String itemIdentifier;
|
||||
private FileModel targetFileModel;
|
||||
|
||||
public AccountingReadersEvent(String itemIdentifier) {
|
||||
this.itemIdentifier = itemIdentifier;
|
||||
public AccountingReadersEvent(FileModel target) {
|
||||
this.setTargetFileModel(target);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,12 +29,19 @@ public class AccountingReadersEvent extends
|
|||
handler.onAccountingReadersShow(this);
|
||||
}
|
||||
|
||||
public String getItemIdentifier() {
|
||||
return itemIdentifier;
|
||||
/**
|
||||
* @return the targetFileModel
|
||||
*/
|
||||
public FileModel getTargetFileModel() {
|
||||
return targetFileModel;
|
||||
}
|
||||
|
||||
public void setItemIdentifier(String itemIdentifier) {
|
||||
this.itemIdentifier = itemIdentifier;
|
||||
/**
|
||||
* @param targetFileModel the targetFileModel to set
|
||||
*/
|
||||
public void setTargetFileModel(FileModel targetFileModel) {
|
||||
this.targetFileModel = targetFileModel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
package org.gcube.portlets.user.workspace.client.event;
|
||||
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.interfaces.EventsTypeEnum;
|
||||
import org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
public class FileDownloadEvent extends GwtEvent<FileDownloadEventHandler> {
|
||||
public class FileDownloadEvent extends GwtEvent<FileDownloadEventHandler> implements GuiEventInterface {
|
||||
public static Type<FileDownloadEventHandler> TYPE = new Type<FileDownloadEventHandler>();
|
||||
public enum DownloadType {SHOW, DOWNLOAD};
|
||||
private String itemIdentifier = null;
|
||||
|
@ -46,13 +49,12 @@ public class FileDownloadEvent extends GwtEvent<FileDownloadEventHandler> {
|
|||
return itemName;
|
||||
}
|
||||
|
||||
// public FileType getFileType() {
|
||||
// return fileType;
|
||||
// }
|
||||
//
|
||||
// public String getFileTypeToString() {
|
||||
// return fileType.toString();
|
||||
// }
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.gcube.portlets.user.workspace.client.interfaces.GuiEventInterface#getKey()
|
||||
*/
|
||||
@Override
|
||||
public EventsTypeEnum getKey() {
|
||||
return EventsTypeEnum.FILE_DOWNLAD_EVENT;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,5 +25,6 @@ public enum EventsTypeEnum
|
|||
REFRESH_FOLDER,
|
||||
SELECTED_MESSAGE,
|
||||
CREATE_NEW_MESSAGE,
|
||||
REPLY_FORWARD_MESSAGE
|
||||
REPLY_FORWARD_MESSAGE,
|
||||
FILE_DOWNLAD_EVENT
|
||||
}
|
|
@ -34,5 +34,9 @@ public interface SubscriberInterface {
|
|||
// void updatePrevieMessage(String fromLogin, String subject, String date, String body, List<FileModel> attachs);
|
||||
|
||||
void createNewMessage(HashMap<String, String> hashAttachs);
|
||||
/**
|
||||
* @param itemIdentifier
|
||||
*/
|
||||
void fileDownloaded(String itemIdentifier);
|
||||
|
||||
}
|
||||
|
|
|
@ -271,5 +271,8 @@ public interface Icons extends ClientBundle {
|
|||
|
||||
@Source("icons/history.png")
|
||||
ImageResource history();
|
||||
|
||||
@Source("icons/cut.png")
|
||||
ImageResource cut();
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,11 @@ public class Resources {
|
|||
return AbstractImagePrototype.create(ICONS.users());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconCut(){
|
||||
|
||||
return AbstractImagePrototype.create(ICONS.cut());
|
||||
}
|
||||
|
||||
public static AbstractImagePrototype getIconInfo(){
|
||||
|
||||
return AbstractImagePrototype.create(ICONS.info());
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 650 B |
|
@ -3,22 +3,33 @@ package org.gcube.portlets.user.workspace.client.view.windows;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.resources.Resources;
|
||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingEntryType;
|
||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
||||
|
||||
import com.extjs.gxt.ui.client.Style.ButtonScale;
|
||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||
import com.extjs.gxt.ui.client.data.BaseModelData;
|
||||
import com.extjs.gxt.ui.client.data.ModelData;
|
||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
||||
import com.extjs.gxt.ui.client.event.SelectionListener;
|
||||
import com.extjs.gxt.ui.client.store.GroupingStore;
|
||||
import com.extjs.gxt.ui.client.store.ListStore;
|
||||
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
||||
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
||||
import com.extjs.gxt.ui.client.widget.button.ToggleButton;
|
||||
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
|
||||
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
|
||||
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
|
||||
import com.extjs.gxt.ui.client.widget.grid.Grid;
|
||||
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
|
||||
import com.extjs.gxt.ui.client.widget.grid.GridGroupRenderer;
|
||||
import com.extjs.gxt.ui.client.widget.grid.GroupColumnData;
|
||||
import com.extjs.gxt.ui.client.widget.grid.GroupingView;
|
||||
import com.extjs.gxt.ui.client.widget.grid.filters.DateFilter;
|
||||
import com.extjs.gxt.ui.client.widget.grid.filters.GridFilters;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
||||
|
||||
public class AccoutingInfoContainer extends LayoutContainer {
|
||||
|
||||
|
@ -31,10 +42,50 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
private Grid<ModelData> grid;
|
||||
private ContentPanel cp;
|
||||
private GroupingStore<ModelData> store = new GroupingStore<ModelData>();
|
||||
private boolean groupingEnabled;
|
||||
|
||||
public AccoutingInfoContainer(){
|
||||
initContentPanel();
|
||||
initGrid();
|
||||
createToolBar();
|
||||
}
|
||||
|
||||
private void initContentPanel() {
|
||||
setLayout(new FitLayout());
|
||||
getAriaSupport().setPresentation(true);
|
||||
cp = new ContentPanel();
|
||||
cp.setHeaderVisible(false);
|
||||
cp.setBodyBorder(true);
|
||||
cp.setLayout(new FitLayout());
|
||||
cp.setButtonAlign(HorizontalAlignment.CENTER);
|
||||
// cp.getHeader().setIconAltText("Grid Icon");
|
||||
// cp.setSize(550, 280);
|
||||
add(cp);
|
||||
}
|
||||
|
||||
private void createToolBar(){
|
||||
|
||||
ToolBar bar = new ToolBar();
|
||||
final ToggleButton buttonGrouping = new ToggleButton("", Resources.getIconGridView());
|
||||
buttonGrouping.setToolTip("Grouping by operation");
|
||||
buttonGrouping.setScale(ButtonScale.SMALL);
|
||||
buttonGrouping.toggle(true);
|
||||
|
||||
buttonGrouping.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
|
||||
if(buttonGrouping.isPressed())
|
||||
enableGrouping();
|
||||
else
|
||||
disableGrouping();
|
||||
}
|
||||
});
|
||||
|
||||
bar.add(buttonGrouping);
|
||||
cp.setTopComponent(bar);
|
||||
|
||||
}
|
||||
|
||||
public void initGrid() {
|
||||
|
@ -43,16 +94,55 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
|
||||
List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
|
||||
|
||||
|
||||
ColumnConfig icon = createSortableColumnConfig("Type", "", 20);
|
||||
columns.add(icon);
|
||||
|
||||
icon.setRenderer(new GridCellRenderer<ModelData>() {
|
||||
|
||||
public Object render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex,
|
||||
ListStore<ModelData> store, Grid<ModelData> grid) {
|
||||
|
||||
if(model.get(OPERATION).equals(GxtAccountingEntryType.READ))
|
||||
return Resources.getIconRead().createImage();
|
||||
else if(model.get(OPERATION).equals(GxtAccountingEntryType.CUT))
|
||||
return Resources.getIconCut().createImage();
|
||||
else if(model.get(OPERATION).equals(GxtAccountingEntryType.PASTE))
|
||||
return Resources.getIconCopy().createImage();
|
||||
else if(model.get(OPERATION).equals(GxtAccountingEntryType.REMOVED))
|
||||
return Resources.getIconCancel().createImage();
|
||||
else if(model.get(OPERATION).equals(GxtAccountingEntryType.RENAMED))
|
||||
return Resources.getIconRenameItem().createImage();
|
||||
return null;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
ColumnConfig descr = createSortableColumnConfig(DESCRIPTION, DESCRIPTION, 230);
|
||||
columns.add(descr);
|
||||
|
||||
descr.setRenderer(new GridCellRenderer<ModelData>() {
|
||||
|
||||
public Object render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex,
|
||||
ListStore<ModelData> store, Grid<ModelData> grid) {
|
||||
|
||||
// if(model.get(OPERATION).equals(GxtAccountingEntryType.READ))
|
||||
// return "<b><p style=\"color: red;\">"
|
||||
// + model.get(DESCRIPTION)+ "</p></b>";
|
||||
|
||||
return model.get(DESCRIPTION);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ColumnConfig oper = createSortableColumnConfig(OPERATION, OPERATION, 70);
|
||||
columns.add(oper);
|
||||
|
||||
ColumnConfig auth = createSortableColumnConfig(OPERATION, AUTHOR, 70);
|
||||
ColumnConfig auth = createSortableColumnConfig(AUTHOR, AUTHOR, 120);
|
||||
columns.add(auth);
|
||||
|
||||
ColumnConfig date = createSortableColumnConfig(DATE, DATE, 70);
|
||||
ColumnConfig date = createSortableColumnConfig(DATE, DATE, 140);
|
||||
columns.add(date);
|
||||
|
||||
cm = new ColumnModel(columns);
|
||||
|
@ -60,7 +150,7 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
final ColumnModel columnModel = cm;
|
||||
|
||||
grid = new Grid<ModelData>(this.store, cm);
|
||||
|
||||
|
||||
GroupingView view = new GroupingView();
|
||||
view.setShowGroupedColumn(true);
|
||||
this.grid.setView(view);
|
||||
|
@ -73,16 +163,34 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
GridFilters filters = new GridFilters();
|
||||
filters.setLocal(true);
|
||||
|
||||
DateFilter dateFilter = new DateFilter(DATE);
|
||||
filters.addFilter(dateFilter);
|
||||
|
||||
grid.addPlugin(filters);
|
||||
|
||||
|
||||
grid.setBorders(true);
|
||||
grid.setStripeRows(true);
|
||||
grid.getView().setAutoFill(true);
|
||||
grid.setColumnLines(true);
|
||||
grid.setColumnReordering(true);
|
||||
grid.setStyleAttribute("borderTop", "none");
|
||||
|
||||
// grid.setLoadMask(true);
|
||||
cp.add(grid);
|
||||
|
||||
}
|
||||
|
||||
public void setPanelSize(int width, int height){
|
||||
|
||||
if(width>0 && height>0 && grid!=null){
|
||||
cp.setSize(width, height);
|
||||
// grid.setSize(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
public AccoutingInfoContainer(List<GxtAccountingField> accountings) {
|
||||
|
||||
|
@ -91,8 +199,29 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
updateListAccounting(accountings);
|
||||
}
|
||||
|
||||
public void disableGrouping() {
|
||||
GroupingStore<ModelData> groupingStore = null;
|
||||
if (store instanceof GroupingStore) {
|
||||
groupingStore = (GroupingStore<ModelData>) store;
|
||||
if (groupingStore != null) {
|
||||
groupingStore.clearGrouping();
|
||||
}
|
||||
this.groupingEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void enableGrouping() {
|
||||
GroupingStore<ModelData> groupingStore = null;
|
||||
if (store instanceof GroupingStore) {
|
||||
groupingStore = (GroupingStore<ModelData>) store;
|
||||
if (groupingStore != null) {
|
||||
groupingStore.groupBy(OPERATION);
|
||||
}
|
||||
this.groupingEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateListAccounting(List<GxtAccountingField> accountings){
|
||||
public void updateListAccounting(List<GxtAccountingField> accountings){
|
||||
|
||||
List<BaseModelData> listModelData = new ArrayList<BaseModelData>();
|
||||
|
||||
|
@ -103,7 +232,7 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
|
||||
baseModel.set(DESCRIPTION, gxtAccountingField.getDescription());
|
||||
baseModel.set(OPERATION, gxtAccountingField.getOperation());
|
||||
baseModel.set(AUTHOR, gxtAccountingField.getUser());
|
||||
baseModel.set(AUTHOR, gxtAccountingField.getUser().getName());
|
||||
baseModel.set(DATE, gxtAccountingField.getDate());
|
||||
|
||||
listModelData.add(baseModel);
|
||||
|
@ -112,31 +241,17 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
store.add(listModelData);
|
||||
}
|
||||
|
||||
private void initContentPanel() {
|
||||
setLayout(new FitLayout());
|
||||
getAriaSupport().setPresentation(true);
|
||||
cp = new ContentPanel();
|
||||
cp.setHeaderVisible(false);
|
||||
cp.setBodyBorder(true);
|
||||
cp.setLayout(new FitLayout());
|
||||
cp.setButtonAlign(HorizontalAlignment.CENTER);
|
||||
cp.setLayout(new FitLayout());
|
||||
// cp.getHeader().setIconAltText("Grid Icon");
|
||||
cp.setSize(500, 250);
|
||||
|
||||
add(cp);
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void updateStore(ListStore<ModelData> store){
|
||||
|
||||
resetStore();
|
||||
this.grid.getStore().add(store.getModels());
|
||||
}
|
||||
|
||||
public void updateStore(ListStore<ModelData> store){
|
||||
|
||||
public void resetStore(){
|
||||
this.grid.getStore().removeAll();
|
||||
// for (ModelData modelData : store.getModels()){
|
||||
// this.grid.getStore().add(modelData);
|
||||
// }
|
||||
|
||||
this.grid.getStore().add(store.getModels());
|
||||
|
||||
// cp.layout();
|
||||
}
|
||||
|
||||
public ColumnConfig createSortableColumnConfig(String id, String name, int width)
|
||||
|
@ -152,4 +267,14 @@ public class AccoutingInfoContainer extends LayoutContainer {
|
|||
// cp.layout();
|
||||
}
|
||||
|
||||
public boolean isGroupingEnabled() {
|
||||
return groupingEnabled;
|
||||
}
|
||||
|
||||
public void setGroupingEnabled(boolean groupingEnabled) {
|
||||
this.groupingEnabled = groupingEnabled;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -30,6 +30,7 @@ public class DialogGetInfo extends Dialog {
|
|||
private int widthDialog = 450;
|
||||
private int heightTextArea = 50;
|
||||
private TextField<String> txtName = new TextField<String>();
|
||||
private TextField<String> txtAreaDescription = new TextArea();
|
||||
private TextField<String> txtType = new TextField<String>();
|
||||
private TextField<String> txtCategory = new TextField<String>();
|
||||
private TextField<String> txtOwner = new TextField<String>();
|
||||
|
@ -77,6 +78,14 @@ public class DialogGetInfo extends Dialog {
|
|||
|
||||
add(txtLocation);
|
||||
|
||||
if(fileModel.isDirectory()){
|
||||
txtAreaDescription.setFieldLabel("Description");
|
||||
txtAreaDescription.setHeight(30);
|
||||
txtAreaDescription.setReadOnly(true);
|
||||
txtAreaDescription.setValue(fileModel.getDescription());
|
||||
add(txtAreaDescription);
|
||||
}
|
||||
|
||||
txtType = new TextField<String>();
|
||||
txtType.setFieldLabel("Type");
|
||||
txtType.setReadOnly(true);
|
||||
|
@ -88,13 +97,14 @@ public class DialogGetInfo extends Dialog {
|
|||
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);
|
||||
|
|
|
@ -1,42 +1,105 @@
|
|||
package org.gcube.portlets.user.workspace.client.view.windows;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||
import org.gcube.portlets.user.workspace.client.model.FileModel;
|
||||
import org.gcube.portlets.user.workspace.shared.accounting.GxtAccountingField;
|
||||
|
||||
import com.extjs.gxt.ui.client.event.Events;
|
||||
import com.extjs.gxt.ui.client.event.Listener;
|
||||
import com.extjs.gxt.ui.client.event.WindowEvent;
|
||||
import com.extjs.gxt.ui.client.widget.Window;
|
||||
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* @May 23, 2013
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WindowAccountingInfo extends Window{
|
||||
|
||||
|
||||
public class WindowAccountingInfo extends Window {
|
||||
|
||||
private List<GxtAccountingField> accountingsFields;
|
||||
private AccoutingInfoContainer accountingsContainers;
|
||||
|
||||
public WindowAccountingInfo(List<GxtAccountingField> accountingsFields) {
|
||||
setModal(true);
|
||||
setSize(550, 300);
|
||||
this.accountingsFields = accountingsFields;
|
||||
this.accountingsContainers = new AccoutingInfoContainer(accountingsFields);
|
||||
|
||||
add(accountingsContainers);
|
||||
}
|
||||
|
||||
|
||||
public void setWindowTitle(String title) {
|
||||
this.setHeading(title);
|
||||
public WindowAccountingInfo() {
|
||||
initAccounting();
|
||||
// addResizeListner();
|
||||
|
||||
}
|
||||
|
||||
public WindowAccountingInfo(FileModel fileModel, String title) {
|
||||
initAccounting();
|
||||
setIcon(fileModel.getAbstractPrototypeIcon());
|
||||
setHeading(title);
|
||||
// addResizeListner();
|
||||
}
|
||||
|
||||
public void addResizeListner(){
|
||||
|
||||
this.addListener(Events.Resize, new Listener<WindowEvent>() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(WindowEvent we )
|
||||
{
|
||||
|
||||
if(accountingsContainers!=null){
|
||||
// System.out.println("Size in event: " + we.getWidth() + "x" + we.getHeight() );
|
||||
// accountingsContainers.setPanelSize(we.getWidth()-14, we.getHeight()-30);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public WindowAccountingInfo(List<GxtAccountingField> accountingsFields) {
|
||||
updateInfoContainer(accountingsFields);
|
||||
}
|
||||
|
||||
private void initAccounting() {
|
||||
setModal(true);
|
||||
setLayout(new FitLayout());
|
||||
setSize(700, 350);
|
||||
setResizable(true);
|
||||
setMaximizable(true);
|
||||
// setCollapsible(true);
|
||||
this.accountingsContainers = new AccoutingInfoContainer();
|
||||
add(accountingsContainers);
|
||||
}
|
||||
|
||||
public void setWindowTitle(String title) {
|
||||
this.setHeading(title);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void updateInfoContainer(List<GxtAccountingField> accountingsFields) {
|
||||
|
||||
this.accountingsContainers.resetStore();
|
||||
this.accountingsFields = accountingsFields;
|
||||
this.accountingsContainers.updateListAccounting(accountingsFields);
|
||||
}
|
||||
|
||||
public List<GxtAccountingField> getAccountingsFields() {
|
||||
return accountingsFields;
|
||||
}
|
||||
|
||||
public void maskAccountingInfo(boolean bool){
|
||||
|
||||
// if(accountingsContainers!=null){
|
||||
//
|
||||
// if(bool)
|
||||
// accountingsContainers.mask(ConstantsExplorer.LOADING, ConstantsExplorer.LOADINGSTYLE);
|
||||
// else
|
||||
// accountingsContainers.unmask();
|
||||
// }
|
||||
|
||||
if(bool)
|
||||
this.mask(ConstantsExplorer.LOADING, ConstantsExplorer.LOADINGSTYLE);
|
||||
else
|
||||
this.unmask();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1673,7 +1673,7 @@ public class GWTWorkspaceBuilder {
|
|||
|
||||
AccountingEntryCut cut = (AccountingEntryCut) accountingEntry;
|
||||
|
||||
af.setDescription("cut by "+user.getName() +" from "+cut.getItemName());
|
||||
af.setDescription("cut "+cut.getItemName()+" by "+user.getName());
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1699,15 +1699,15 @@ public class GWTWorkspaceBuilder {
|
|||
|
||||
AccountingEntryRemoval rem = (AccountingEntryRemoval) accountingEntry;
|
||||
|
||||
af.setDescription("remove by "+user.getName() +", name: "+rem.getItemName());
|
||||
af.setDescription("remove "+rem.getItemName()+" by "+user.getName());
|
||||
}
|
||||
break;
|
||||
|
||||
case RENAMING:
|
||||
|
||||
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.RENAMING)){
|
||||
if(gxtEntryType==null || gxtEntryType.equals(GxtAccountingEntryType.ALLWITHOUTREAD) || gxtEntryType.equals(GxtAccountingEntryType.RENAMED)){
|
||||
|
||||
af.setOperation(GxtAccountingEntryType.RENAMING);
|
||||
af.setOperation(GxtAccountingEntryType.RENAMED);
|
||||
|
||||
AccountingEntryRenaming ren = (AccountingEntryRenaming) accountingEntry;
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ public class Util {
|
|||
// public static final String TEST_USER_FULL_NAME = "Francesco Mangiacrapa";
|
||||
// public static final String TEST_USER = "aureliano.gentile";
|
||||
public static final String TEST_USER = "test.user";
|
||||
// public static final String TEST_USER = "antonio.gioia";
|
||||
public static final String TEST_USER_FULL_NAME = "Test User";
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ public enum GxtAccountingEntryType {
|
|||
|
||||
REMOVED("removed", "removed"),
|
||||
|
||||
RENAMING("renamed", "renamed"),
|
||||
RENAMED("renamed", "renamed"),
|
||||
|
||||
CREATED("created", "created"),
|
||||
|
||||
|
|
Loading…
Reference in New Issue