Create Multi Tab Management
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@100724 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0049bd8821
commit
d58c03ff1c
8
pom.xml
8
pom.xml
|
@ -241,6 +241,14 @@
|
||||||
<artifactId>tabular-data-wizard-widget</artifactId>
|
<artifactId>tabular-data-wizard-widget</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tabular-data-mainbox-widget -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-mainbox-widget</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- TD Expression -->
|
<!-- TD Expression -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -20,7 +20,9 @@ import org.gcube.portlets.user.td.expressionwidget.client.ReplaceColumnByExpress
|
||||||
import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistWizardTD;
|
import org.gcube.portlets.user.td.extractcodelistwidget.client.ExtractCodelistWizardTD;
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
||||||
import org.gcube.portlets.user.td.jsonexportwidget.client.JSONExportWidgetTD;
|
import org.gcube.portlets.user.td.jsonexportwidget.client.JSONExportWidgetTD;
|
||||||
|
import org.gcube.portlets.user.td.mainboxwidget.client.MainBoxPanel;
|
||||||
import org.gcube.portlets.user.td.mapwidget.client.MapWidgetTD;
|
import org.gcube.portlets.user.td.mapwidget.client.MapWidgetTD;
|
||||||
import org.gcube.portlets.user.td.openwidget.client.TDOpen;
|
import org.gcube.portlets.user.td.openwidget.client.TDOpen;
|
||||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD;
|
import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD;
|
||||||
|
@ -35,6 +37,8 @@ import org.gcube.portlets.user.td.taskswidget.client.TdTaskController;
|
||||||
import org.gcube.portlets.user.td.unionwizardwidget.client.UnionWizardTD;
|
import org.gcube.portlets.user.td.unionwizardwidget.client.UnionWizardTD;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.BackgroundRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.BackgroundRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.DataViewActiveEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.DataViewRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridContextMenuItemEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridContextMenuItemEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridHeaderColumnMenuItemEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridHeaderColumnMenuItemEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
|
||||||
|
@ -43,6 +47,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.event.TasksMonitorEve
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.WidgetRequestEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.WidgetRequestEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.BackgroundRequestType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.BackgroundRequestType;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.DataViewRequestType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.TaskType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.TaskType;
|
||||||
|
@ -53,11 +58,11 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.GridHeaderOperationId
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.GridOperationId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.GridOperationId;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.RequestProperties;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.RequestProperties;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.DataView;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardListener;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardListener;
|
||||||
import org.gcube.portlets.user.tdtemplate.client.TdTemplateController;
|
import org.gcube.portlets.user.tdtemplate.client.TdTemplateController;
|
||||||
import org.gcube.portlets.user.tdwx.client.TabularDataX;
|
|
||||||
import org.gcube.portlets.user.tdwx.shared.model.TableId;
|
|
||||||
import org.gcube.portlets.widgets.sessionchecker.client.CheckSession;
|
import org.gcube.portlets.widgets.sessionchecker.client.CheckSession;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
@ -87,7 +92,8 @@ public class TabularDataController {
|
||||||
// implements HasCloseHandlers<Long>, HasOpenHandlers<Long> {
|
// implements HasCloseHandlers<Long>, HasOpenHandlers<Long> {
|
||||||
|
|
||||||
protected SimpleEventBus eventBus;
|
protected SimpleEventBus eventBus;
|
||||||
protected TabularDataX tabularData;
|
// protected TabularDataX tabularData;
|
||||||
|
private MainBoxPanel mainBoxPanel;
|
||||||
protected UIStateType uiState = UIStateType.START;
|
protected UIStateType uiState = UIStateType.START;
|
||||||
|
|
||||||
private boolean taskManagerInit = false;
|
private boolean taskManagerInit = false;
|
||||||
|
@ -99,19 +105,19 @@ public class TabularDataController {
|
||||||
/**
|
/**
|
||||||
* Current user
|
* Current user
|
||||||
*/
|
*/
|
||||||
protected String userName;
|
protected UserInfo userInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tabular Resource Id
|
* Tabular Resource Id
|
||||||
*/
|
*/
|
||||||
protected TRId trId;
|
protected TRId trId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grid TableId
|
* Grid TableId
|
||||||
*/
|
*/
|
||||||
protected TableId tableOpening;
|
//protected TableId tableOpening;
|
||||||
|
|
||||||
|
private TRId openTRIdAfterServerUpdate;
|
||||||
|
|
||||||
public TabularDataController() {
|
public TabularDataController() {
|
||||||
eventBus = new SimpleEventBus();
|
eventBus = new SimpleEventBus();
|
||||||
|
@ -136,9 +142,10 @@ public class TabularDataController {
|
||||||
return eventBus;
|
return eventBus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTabularData(TabularDataX tabularData) {
|
/*
|
||||||
this.tabularData = tabularData;
|
* public void setTabularData(TabularDataX tabularData) { this.tabularData =
|
||||||
}
|
* tabularData; }
|
||||||
|
*/
|
||||||
|
|
||||||
public ContentPanel getToolBoxPanel() {
|
public ContentPanel getToolBoxPanel() {
|
||||||
return toolBoxPanel;
|
return toolBoxPanel;
|
||||||
|
@ -156,10 +163,13 @@ public class TabularDataController {
|
||||||
this.westData = westData;
|
this.westData = westData;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void callHello() {
|
public void setMainBoxPanel(MainBoxPanel mainBoxPanel) {
|
||||||
TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback<String>() {
|
this.mainBoxPanel = mainBoxPanel;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void callHello() {
|
||||||
|
TDGWTServiceAsync.INSTANCE.hello(new AsyncCallback<UserInfo>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -173,9 +183,9 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String result) {
|
public void onSuccess(UserInfo result) {
|
||||||
userName=result;
|
userInfo = result;
|
||||||
Log.info("Hello: " + result);
|
Log.info("Hello: " + result.getUsername());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,6 +219,17 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(DataViewActiveEvent.TYPE,
|
||||||
|
new DataViewActiveEvent.DataViewActiveEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataViewActive(DataViewActiveEvent event) {
|
||||||
|
Log.debug("Catch Event DataViewActiveEvent");
|
||||||
|
doDataViewActiveCommand(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
eventBus.addHandler(
|
eventBus.addHandler(
|
||||||
GridHeaderColumnMenuItemEvent.TYPE,
|
GridHeaderColumnMenuItemEvent.TYPE,
|
||||||
new GridHeaderColumnMenuItemEvent.GridHeaderColumnMenuItemEventHandler() {
|
new GridHeaderColumnMenuItemEvent.GridHeaderColumnMenuItemEventHandler() {
|
||||||
|
@ -294,32 +315,32 @@ public class TabularDataController {
|
||||||
|
|
||||||
//
|
//
|
||||||
public void restoreUISession() {
|
public void restoreUISession() {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
|
||||||
.getCurrentTRId(new AsyncCallback<TRId>() {
|
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(TRId trId) {
|
public void onSuccess(TRId trId) {
|
||||||
if(trId!=null){
|
if (trId != null) {
|
||||||
if(trId.getId()!=null && !trId.getId().isEmpty()){
|
if (trId.getId() != null && !trId.getId().isEmpty()) {
|
||||||
openTable(trId);
|
openTable(trId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//TODO
|
||||||
protected void putInBackgroundUIState() {
|
protected void putInBackgroundUIState() {
|
||||||
try {
|
try {
|
||||||
closeTabularResource();
|
requestCloseCurrent();
|
||||||
openBackgroundMonitor();
|
//closeAllTabularResource();
|
||||||
openTabularResource(true);
|
//openBackgroundMonitor();
|
||||||
|
//openTabularResource(true);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.debug("Put In Background :" + e.getLocalizedMessage());
|
Log.debug("Put In Background :" + e.getLocalizedMessage());
|
||||||
|
@ -375,9 +396,9 @@ public class TabularDataController {
|
||||||
protected void openTable(TRId tabularResourceId) {
|
protected void openTable(TRId tabularResourceId) {
|
||||||
Log.debug("openTable: " + tabularResourceId);
|
Log.debug("openTable: " + tabularResourceId);
|
||||||
trId = tabularResourceId;
|
trId = tabularResourceId;
|
||||||
tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
//tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
||||||
trId.getTableId());
|
// trId.getTableId());
|
||||||
tabularData.openTable(tableOpening);
|
// tabularData.openTable(tableOpening);
|
||||||
uiState = UIStateType.TR_OPEN;
|
uiState = UIStateType.TR_OPEN;
|
||||||
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_OPEN);
|
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_OPEN);
|
||||||
uiStateEvent.setTrId(tabularResourceId);
|
uiStateEvent.setTrId(tabularResourceId);
|
||||||
|
@ -388,9 +409,9 @@ public class TabularDataController {
|
||||||
protected void updateTable(TRId tabularResourceId) {
|
protected void updateTable(TRId tabularResourceId) {
|
||||||
Log.debug("updateTable: " + tabularResourceId);
|
Log.debug("updateTable: " + tabularResourceId);
|
||||||
trId = tabularResourceId;
|
trId = tabularResourceId;
|
||||||
tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
//tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
||||||
trId.getTableId());
|
// trId.getTableId());
|
||||||
tabularData.openTable(tableOpening);
|
// tabularData.openTable(tableOpening);
|
||||||
uiState = UIStateType.TABLEUPDATE;
|
uiState = UIStateType.TABLEUPDATE;
|
||||||
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLEUPDATE);
|
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLEUPDATE);
|
||||||
uiStateEvent.setTrId(tabularResourceId);
|
uiStateEvent.setTrId(tabularResourceId);
|
||||||
|
@ -401,9 +422,9 @@ public class TabularDataController {
|
||||||
protected void updateTableForCuration(TRId tabularResourceId) {
|
protected void updateTableForCuration(TRId tabularResourceId) {
|
||||||
Log.debug("updateTableForCuration: " + tabularResourceId);
|
Log.debug("updateTableForCuration: " + tabularResourceId);
|
||||||
trId = tabularResourceId;
|
trId = tabularResourceId;
|
||||||
tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
//tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
||||||
trId.getTableId());
|
// trId.getTableId());
|
||||||
tabularData.openTable(tableOpening);
|
// tabularData.openTable(tableOpening);
|
||||||
uiState = UIStateType.TABLECURATION;
|
uiState = UIStateType.TABLECURATION;
|
||||||
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLECURATION);
|
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TABLECURATION);
|
||||||
uiStateEvent.setTrId(tabularResourceId);
|
uiStateEvent.setTrId(tabularResourceId);
|
||||||
|
@ -411,7 +432,7 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close Tabular Resource
|
// Close Tabular Resource
|
||||||
protected void closeTabularResource() {
|
protected void closeAllTabularResource() {
|
||||||
switch (uiState) {
|
switch (uiState) {
|
||||||
case START:
|
case START:
|
||||||
break;
|
break;
|
||||||
|
@ -421,11 +442,11 @@ public class TabularDataController {
|
||||||
case TR_READONLY:
|
case TR_READONLY:
|
||||||
case WIZARD_OPEN:
|
case WIZARD_OPEN:
|
||||||
Log.debug("CloseTabularResource");
|
Log.debug("CloseTabularResource");
|
||||||
tabularData.closeTable();
|
// tabularData.closeTable();
|
||||||
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_CLOSE);
|
UIStateEvent uiStateEvent = new UIStateEvent(UIStateType.TR_CLOSE);
|
||||||
uiStateEvent.setTrId(trId);
|
uiStateEvent.setTrId(trId);
|
||||||
trId = null;
|
trId = null;
|
||||||
tableOpening = null;
|
//tableOpening = null;
|
||||||
uiState = UIStateType.TR_CLOSE;
|
uiState = UIStateType.TR_CLOSE;
|
||||||
Log.debug("fireEvent TR_CLOSE");
|
Log.debug("fireEvent TR_CLOSE");
|
||||||
try {
|
try {
|
||||||
|
@ -433,7 +454,7 @@ public class TabularDataController {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.debug("Bus Error: " + e.getMessage());
|
Log.debug("Bus Error: " + e.getMessage());
|
||||||
}
|
}
|
||||||
closeTabularResourceOnServer();
|
closeAllTabularResourceOnServer();
|
||||||
break;
|
break;
|
||||||
case TR_CLOSE:
|
case TR_CLOSE:
|
||||||
break;
|
break;
|
||||||
|
@ -444,23 +465,173 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeTabularResourceOnServer() {
|
protected void closeAllTabularResourceOnServer() {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.closeTabularResource(new AsyncCallback<Void>() {
|
.closeAllTabularResources(new AsyncCallback<Void>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
UtilsGXT3.alert("Error closing tabular resource",
|
UtilsGXT3.alert("Error closing all tabular resources",
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
protected void doActiveAfterClose(DataViewActiveEvent event) {
|
||||||
|
Log.debug("doActiveAfterClose: " + event);
|
||||||
|
|
||||||
|
DataView dataView = event.getDataView();
|
||||||
|
if (dataView instanceof TabularResourceDataView) {
|
||||||
|
TabularResourceDataView tabularResourceDataView = (TabularResourceDataView) dataView;
|
||||||
|
Log.debug("New TabularResourceDataView:" + tabularResourceDataView);
|
||||||
|
openTRIdAfterServerUpdate = tabularResourceDataView.getTrId();
|
||||||
|
DataView olderDataView = event.getOldDataView();
|
||||||
|
if (olderDataView instanceof TabularResourceDataView) {
|
||||||
|
TabularResourceDataView olderTabularResourceDataView = (TabularResourceDataView) olderDataView;
|
||||||
|
Log.debug("New TabularResourceDataView:"
|
||||||
|
+ olderTabularResourceDataView);
|
||||||
|
TDGWTServiceAsync.INSTANCE.closeTabularResourceAndOpen(
|
||||||
|
openTRIdAfterServerUpdate,
|
||||||
|
olderTabularResourceDataView.getTrId(),
|
||||||
|
|
||||||
|
new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("Error in Close and Open TR "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
caught.printStackTrace();
|
||||||
|
UtilsGXT3
|
||||||
|
.alert("Error",
|
||||||
|
"Error in close TR: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void result) {
|
||||||
|
doOpenTRIdAfterServerUpdate();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doOpenTRIdAfterServerUpdate() {
|
||||||
|
openTable(openTRIdAfterServerUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doNewActive(DataViewActiveEvent event) {
|
||||||
|
Log.debug("doNewActive: " + event);
|
||||||
|
DataView dataView = event.getDataView();
|
||||||
|
if (dataView instanceof TabularResourceDataView) {
|
||||||
|
TabularResourceDataView tabularResourceDataView = (TabularResourceDataView) dataView;
|
||||||
|
Log.debug("TabularResourceDataView:" + tabularResourceDataView);
|
||||||
|
openTRIdAfterServerUpdate = tabularResourceDataView.getTrId();
|
||||||
|
TDGWTServiceAsync.INSTANCE.setActiveTabularResource(
|
||||||
|
openTRIdAfterServerUpdate, new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("Error in set Active TR "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
caught.printStackTrace();
|
||||||
|
UtilsGXT3.alert(
|
||||||
|
"Error",
|
||||||
|
"Error in set Active TR: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void result) {
|
||||||
|
doOpenTRIdAfterServerUpdate();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doDataViewClose(DataViewActiveEvent event) {
|
||||||
|
Log.debug("doDataViewClose: " + event);
|
||||||
|
DataView oldDataView = event.getOldDataView();
|
||||||
|
if (oldDataView instanceof TabularResourceDataView) {
|
||||||
|
closeAllTabularResource();
|
||||||
|
/*TabularResourceDataView tabularResourceDataView = (TabularResourceDataView) oldDataView;
|
||||||
|
Log.debug("TabularResourceDataView:" + tabularResourceDataView);
|
||||||
|
TDGWTServiceAsync.INSTANCE.closeTabularResource(
|
||||||
|
tabularResourceDataView.getTrId(), new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error("Error in set Active TR "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
caught.printStackTrace();
|
||||||
|
UtilsGXT3.alert(
|
||||||
|
"Error",
|
||||||
|
"Error in set Active TR: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void result) {
|
||||||
|
Log.debug("Close Taular Resource");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
);*/
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void requestCloseCurrent(){
|
||||||
|
DataViewRequestEvent dataViewRequestEvent=new DataViewRequestEvent();
|
||||||
|
dataViewRequestEvent.setDataViewRequestType(DataViewRequestType.CLOSE);
|
||||||
|
dataViewRequestEvent.setDataView(new TabularResourceDataView(trId));
|
||||||
|
eventBus.fireEvent(dataViewRequestEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
protected void deleteTabularResource() {
|
protected void deleteTabularResource() {
|
||||||
|
|
||||||
final ConfirmMessageBox mb = new ConfirmMessageBox("Confirm",
|
final ConfirmMessageBox mb = new ConfirmMessageBox("Confirm",
|
||||||
|
@ -479,7 +650,7 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
closeTabularResource();
|
requestCloseCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -512,7 +683,7 @@ public class TabularDataController {
|
||||||
cloneTabularResource();
|
cloneTabularResource();
|
||||||
break;
|
break;
|
||||||
case CLOSE:
|
case CLOSE:
|
||||||
closeTabularResource();
|
closeAllTabularResource();
|
||||||
break;
|
break;
|
||||||
case DELETE:
|
case DELETE:
|
||||||
deleteTabularResource();
|
deleteTabularResource();
|
||||||
|
@ -1012,8 +1183,6 @@ public class TabularDataController {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void openTableUnionWizard() {
|
protected void openTableUnionWizard() {
|
||||||
GWT.runAsync(new RunAsyncCallback() {
|
GWT.runAsync(new RunAsyncCallback() {
|
||||||
|
@ -1060,8 +1229,8 @@ public class TabularDataController {
|
||||||
|
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
openWizard();
|
openWizard();
|
||||||
MapWidgetTD mapWizard = new MapWidgetTD(trId, userName, "Map Creation",
|
MapWidgetTD mapWizard = new MapWidgetTD(trId, userInfo,
|
||||||
eventBus);
|
"Map Creation", eventBus);
|
||||||
|
|
||||||
mapWizard.addListener(new WizardListener() {
|
mapWizard.addListener(new WizardListener() {
|
||||||
public void failed(String title, String message,
|
public void failed(String title, String message,
|
||||||
|
@ -1085,7 +1254,6 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFailure(Throwable reason) {
|
public void onFailure(Throwable reason) {
|
||||||
|
@ -1094,10 +1262,7 @@ public class TabularDataController {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param switchState
|
* @param switchState
|
||||||
*
|
*
|
||||||
|
@ -1530,7 +1695,10 @@ public class TabularDataController {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doRowsDelete() {
|
protected void doRowsDelete() {
|
||||||
ArrayList<String> rows = tabularData.getGridPanel().getSelectedRowsId();
|
// ArrayList<String> rows =
|
||||||
|
// tabularData.getGridPanel().getSelectedRowsId();
|
||||||
|
ArrayList<String> rows = mainBoxPanel.getSelectedRowsId();
|
||||||
|
|
||||||
onRowsDelete(rows);
|
onRowsDelete(rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1619,13 +1787,33 @@ public class TabularDataController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void doDataViewActiveCommand(DataViewActiveEvent event) {
|
||||||
|
Log.debug("DataViewActive Event: " + event);
|
||||||
|
switch (event.getDataViewActiveType()) {
|
||||||
|
case ACTIVEAFTERCLOSE:
|
||||||
|
doActiveAfterClose(event);
|
||||||
|
break;
|
||||||
|
case NEWACTIVE:
|
||||||
|
doNewActive(event);
|
||||||
|
break;
|
||||||
|
case CLOSE:
|
||||||
|
doDataViewClose(event);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void doGridHeaderColumnMenuCommand(
|
protected void doGridHeaderColumnMenuCommand(
|
||||||
GridHeaderColumnMenuItemEvent event) {
|
GridHeaderColumnMenuItemEvent event) {
|
||||||
Log.debug("GridHeaderColumnMenu Fire Event",
|
Log.debug("GridHeaderColumnMenu Fire Event",
|
||||||
"OperationId: " + event.getOperationId() + " Column: \n"
|
"OperationId: " + event.getOperationId() + " Column: \n"
|
||||||
+ event.getColumnSelected());
|
+ event.getColumnSelected());
|
||||||
String opId = event.getOperationId();
|
String opId = event.getOperationId();
|
||||||
String columnName = tabularData.getColumnId(event.getColumnSelected());
|
// String columnName =
|
||||||
|
// tabularData.getColumnName(event.getColumnSelected());
|
||||||
|
String columnName = mainBoxPanel.getColumnName(event
|
||||||
|
.getColumnSelected());
|
||||||
Log.debug("GridColumnName: " + columnName);
|
Log.debug("GridColumnName: " + columnName);
|
||||||
|
|
||||||
if (opId.compareTo(GridHeaderOperationId.COLUMNLABEL.toString()) == 0) {
|
if (opId.compareTo(GridHeaderOperationId.COLUMNLABEL.toString()) == 0) {
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
package org.gcube.portlets.user.td.client;
|
package org.gcube.portlets.user.td.client;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.grid.GridContextMenu;
|
|
||||||
import org.gcube.portlets.user.td.client.grid.GridHeaderColumnMenu;
|
|
||||||
import org.gcube.portlets.user.td.client.ribbon.TabularDataRibbon;
|
import org.gcube.portlets.user.td.client.ribbon.TabularDataRibbon;
|
||||||
import org.gcube.portlets.user.td.client.rpc.TabularDataService;
|
import org.gcube.portlets.user.td.client.rpc.TabularDataService;
|
||||||
import org.gcube.portlets.user.td.client.rpc.TabularDataServiceAsync;
|
import org.gcube.portlets.user.td.client.rpc.TabularDataServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.mainboxwidget.client.MainBoxPanel;
|
||||||
import org.gcube.portlets.user.td.toolboxwidget.client.ToolBoxPanel;
|
import org.gcube.portlets.user.td.toolboxwidget.client.ToolBoxPanel;
|
||||||
import org.gcube.portlets.user.tdwx.client.TabularDataX;
|
|
||||||
import org.gcube.portlets.user.tdwx.client.TabularDataXGridPanel;
|
|
||||||
import org.gcube.portlets.user.tdwx.client.event.FailureEvent;
|
|
||||||
import org.gcube.portlets.user.tdwx.client.event.FailureEventHandler;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.EntryPoint;
|
import com.google.gwt.core.client.EntryPoint;
|
||||||
|
@ -18,14 +13,12 @@ import com.google.gwt.core.client.Scheduler;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
import com.google.gwt.user.client.ui.RootPanel;
|
import com.google.gwt.user.client.ui.RootPanel;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sencha.gxt.core.client.Style.SelectionMode;
|
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.widget.core.client.TabPanel;
|
import com.sencha.gxt.widget.core.client.TabPanel;
|
||||||
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
|
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;
|
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;
|
||||||
import com.sencha.gxt.widget.core.client.container.MarginData;
|
import com.sencha.gxt.widget.core.client.container.MarginData;
|
||||||
import com.sencha.gxt.widget.core.client.container.Viewport;
|
import com.sencha.gxt.widget.core.client.container.Viewport;
|
||||||
import com.sencha.gxt.widget.core.client.info.Info;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -58,7 +51,7 @@ public class TabularDataPortlet implements EntryPoint {
|
||||||
private static BorderLayoutContainer mainPanelLayout;
|
private static BorderLayoutContainer mainPanelLayout;
|
||||||
|
|
||||||
// Private TabularData
|
// Private TabularData
|
||||||
private static TabularDataX tabularData;
|
//private static TabularDataX tabularData;
|
||||||
private static ToolBoxPanel toolBoxPanel;
|
private static ToolBoxPanel toolBoxPanel;
|
||||||
private static BorderLayoutData westData;
|
private static BorderLayoutData westData;
|
||||||
|
|
||||||
|
@ -88,7 +81,7 @@ public class TabularDataPortlet implements EntryPoint {
|
||||||
TabularDataController controller = new TabularDataController();
|
TabularDataController controller = new TabularDataController();
|
||||||
EventBus eventBus = controller.getEventBus();
|
EventBus eventBus = controller.getEventBus();
|
||||||
|
|
||||||
tabularData = new TabularDataX(Constants.TDX_DATASOURCE_FACTORY_ID);
|
/*tabularData = new TabularDataX(Constants.TDX_DATASOURCE_FACTORY_ID);
|
||||||
tabularData.addFailureHandler(new FailureEventHandler() {
|
tabularData.addFailureHandler(new FailureEventHandler() {
|
||||||
|
|
||||||
public void onFailure(FailureEvent event) {
|
public void onFailure(FailureEvent event) {
|
||||||
|
@ -98,7 +91,7 @@ public class TabularDataPortlet implements EntryPoint {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
controller.setTabularData(tabularData);
|
controller.setTabularData(tabularData);*/
|
||||||
|
|
||||||
// Layout
|
// Layout
|
||||||
mainPanelLayout = new BorderLayoutContainer();
|
mainPanelLayout = new BorderLayoutContainer();
|
||||||
|
@ -117,7 +110,11 @@ public class TabularDataPortlet implements EntryPoint {
|
||||||
mainPanelLayout.setNorthWidget(toolBarPanel, toolBarData);
|
mainPanelLayout.setNorthWidget(toolBarPanel, toolBarData);
|
||||||
|
|
||||||
// Grid Panel
|
// Grid Panel
|
||||||
final TabularDataXGridPanel gridPanel = tabularData.getGridPanel();
|
final MainBoxPanel mainBoxPanel = new MainBoxPanel("MainBoxPanel",
|
||||||
|
eventBus);
|
||||||
|
controller.setMainBoxPanel(mainBoxPanel);
|
||||||
|
|
||||||
|
/*final TabularDataXGridPanel gridPanel = tabularData.getGridPanel();
|
||||||
gridPanel.setHeaderVisible(false);
|
gridPanel.setHeaderVisible(false);
|
||||||
|
|
||||||
GridHeaderColumnMenu columnHeaderMenu = new GridHeaderColumnMenu();
|
GridHeaderColumnMenu columnHeaderMenu = new GridHeaderColumnMenu();
|
||||||
|
@ -128,11 +125,12 @@ public class TabularDataPortlet implements EntryPoint {
|
||||||
eventBus);
|
eventBus);
|
||||||
gridPanel.setGridContextMenu(gridContextMenu.getMenu());
|
gridPanel.setGridContextMenu(gridContextMenu.getMenu());
|
||||||
|
|
||||||
gridPanel.setSelectionModel(SelectionMode.MULTI);
|
gridPanel.setSelectionModel(SelectionMode.MULTI);*/
|
||||||
|
|
||||||
MarginData gridData = new MarginData();
|
MarginData gridData = new MarginData();
|
||||||
mainPanelLayout.setCenterWidget(gridPanel, gridData);
|
//mainPanelLayout.setCenterWidget(gridPanel, gridData);
|
||||||
|
mainPanelLayout.setCenterWidget(mainBoxPanel, gridData);
|
||||||
|
|
||||||
// ToolBox Panel
|
// ToolBox Panel
|
||||||
toolBoxPanel = new ToolBoxPanel("ToolBoxPanel", eventBus);
|
toolBoxPanel = new ToolBoxPanel("ToolBoxPanel", eventBus);
|
||||||
|
|
||||||
|
|
|
@ -1,129 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.client.grid;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.GridContextMenuItemEvent;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.GridOperationId;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
|
|
||||||
import org.gcube.portlets.user.tdwx.client.TabularDataXGridPanel;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
|
||||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
|
||||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
|
||||||
import com.sencha.gxt.widget.core.client.menu.Item;
|
|
||||||
import com.sencha.gxt.widget.core.client.menu.Menu;
|
|
||||||
import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author "Giancarlo Panichi" <a
|
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
* Defines the context menu of grid
|
|
||||||
*/
|
|
||||||
public class GridContextMenu {
|
|
||||||
protected Menu tableContextMenu;
|
|
||||||
protected final TabularDataXGridPanel gridPanel;
|
|
||||||
protected EventBus eventBus;
|
|
||||||
|
|
||||||
public GridContextMenu(final TabularDataXGridPanel gridPanel,
|
|
||||||
final EventBus eventBus) {
|
|
||||||
this.gridPanel = gridPanel;
|
|
||||||
this.eventBus = eventBus;
|
|
||||||
tableContextMenu = new Menu();
|
|
||||||
|
|
||||||
MenuItem addRowItem = new MenuItem("Add Row");
|
|
||||||
addRowItem.setId(GridOperationId.ROWADD.toString());
|
|
||||||
addRowItem.setIcon(TabularDataResources.INSTANCE.rowInsert());
|
|
||||||
addRowItem.addSelectionHandler(new SelectionHandler<Item>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
|
||||||
Log.debug("gridPanel is: " + gridPanel);
|
|
||||||
if (gridPanel != null) {
|
|
||||||
GridContextMenuItemEvent eventGridContextMenu = new GridContextMenuItemEvent(
|
|
||||||
GridOperationId.ROWADD);
|
|
||||||
eventBus.fireEvent(eventGridContextMenu);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tableContextMenu.add(addRowItem);
|
|
||||||
|
|
||||||
MenuItem editRowItem = new MenuItem("Edit Row");
|
|
||||||
editRowItem.setId(GridOperationId.ROWEDIT.toString());
|
|
||||||
editRowItem.setIcon(TabularDataResources.INSTANCE.rowEdit());
|
|
||||||
editRowItem.addSelectionHandler(new SelectionHandler<Item>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
|
||||||
Log.debug("gridPanel is: " + gridPanel);
|
|
||||||
if (gridPanel != null) {
|
|
||||||
|
|
||||||
RowRaw row = gridPanel.getSelectedRowAsRaw();
|
|
||||||
if (row != null) {
|
|
||||||
GridContextMenuItemEvent eventGridContextMenu = new GridContextMenuItemEvent(
|
|
||||||
GridOperationId.ROWEDIT, row);
|
|
||||||
eventBus.fireEvent(eventGridContextMenu);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tableContextMenu.add(editRowItem);
|
|
||||||
|
|
||||||
MenuItem deleteRowItem = new MenuItem("Delete Row");
|
|
||||||
deleteRowItem.setId(GridOperationId.ROWDELETE.toString());
|
|
||||||
deleteRowItem.setIcon(TabularDataResources.INSTANCE.rowRemove());
|
|
||||||
deleteRowItem.addSelectionHandler(new SelectionHandler<Item>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
|
||||||
Log.debug("gridPanel is: " + gridPanel);
|
|
||||||
if (gridPanel != null) {
|
|
||||||
ArrayList<String> rows = gridPanel.getSelectedRowsId();
|
|
||||||
GridContextMenuItemEvent eventGridContextMenu = new GridContextMenuItemEvent(
|
|
||||||
GridOperationId.ROWDELETE, rows);
|
|
||||||
eventBus.fireEvent(eventGridContextMenu);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tableContextMenu.add(deleteRowItem);
|
|
||||||
|
|
||||||
MenuItem replaceRowsItem = new MenuItem("Replace Value");
|
|
||||||
replaceRowsItem.setId(GridOperationId.REPLACE.toString());
|
|
||||||
replaceRowsItem.setIcon(TabularDataResources.INSTANCE.columnReplace());
|
|
||||||
replaceRowsItem.addSelectionHandler(new SelectionHandler<Item>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSelection(SelectionEvent<Item> event) {
|
|
||||||
Log.debug("gridPanel is: " + gridPanel);
|
|
||||||
if (gridPanel != null) {
|
|
||||||
CellData cellData = gridPanel.getSelectedCell();
|
|
||||||
if (cellData != null) {
|
|
||||||
GridContextMenuItemEvent eventGridContextMenu = new GridContextMenuItemEvent(
|
|
||||||
GridOperationId.REPLACE, cellData);
|
|
||||||
eventBus.fireEvent(eventGridContextMenu);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
tableContextMenu.add(replaceRowsItem);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return context menu for grid
|
|
||||||
*/
|
|
||||||
public Menu getMenu() {
|
|
||||||
return tableContextMenu;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,99 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.client.grid;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.GridHeaderOperationId;
|
|
||||||
|
|
||||||
import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the menu for column on the grid
|
|
||||||
*
|
|
||||||
* @author "Giancarlo Panichi"
|
|
||||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class GridHeaderColumnMenu {
|
|
||||||
|
|
||||||
protected final ArrayList<MenuItem> menuItems;
|
|
||||||
|
|
||||||
public GridHeaderColumnMenu() {
|
|
||||||
menuItems = new ArrayList<MenuItem>();
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem changeLabelItem = new MenuItem("Labels");
|
|
||||||
changeLabelItem.setId(GridHeaderOperationId.COLUMNLABEL
|
|
||||||
.toString());
|
|
||||||
changeLabelItem.setIcon(TabularDataResources.INSTANCE.columnLabel());
|
|
||||||
menuItems.add(changeLabelItem);
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem addColumnItem = new MenuItem("Add Column");
|
|
||||||
addColumnItem.setId(GridHeaderOperationId.COLUMNADD.toString());
|
|
||||||
addColumnItem.setIcon(TabularDataResources.INSTANCE.columnAdd());
|
|
||||||
menuItems.add(addColumnItem);
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem deleteColumnItem = new MenuItem("Delete Column");
|
|
||||||
deleteColumnItem.setId(GridHeaderOperationId.COLUMNDELETE.toString());
|
|
||||||
deleteColumnItem.setIcon(TabularDataResources.INSTANCE.columnDelete());
|
|
||||||
menuItems.add(deleteColumnItem);
|
|
||||||
|
|
||||||
MenuItem splitColumnItem = new MenuItem("Split Column");
|
|
||||||
splitColumnItem.setId(GridHeaderOperationId.COLUMNSPLIT.toString());
|
|
||||||
splitColumnItem.setIcon(TabularDataResources.INSTANCE.columnSplit());
|
|
||||||
menuItems.add(splitColumnItem);
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem mergeColumnItem = new MenuItem("Merge Column");
|
|
||||||
mergeColumnItem.setId(GridHeaderOperationId.COLUMNMERGE.toString());
|
|
||||||
mergeColumnItem.setIcon(TabularDataResources.INSTANCE.columnMerge());
|
|
||||||
menuItems.add(mergeColumnItem);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem changeToTypeItem = new MenuItem("Change Type");
|
|
||||||
changeToTypeItem.setId(GridHeaderOperationId.COLUMNTYPE.toString());
|
|
||||||
changeToTypeItem.setIcon(TabularDataResources.INSTANCE.columnType());
|
|
||||||
menuItems.add(changeToTypeItem);
|
|
||||||
|
|
||||||
MenuItem filterItem = new MenuItem("Filter");
|
|
||||||
filterItem.setId(GridHeaderOperationId.COLUMNFILTER.toString());
|
|
||||||
filterItem.setIcon(TabularDataResources.INSTANCE.columnFilter());
|
|
||||||
menuItems.add(filterItem);
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem replaceValueBatchItem = new MenuItem("Replace Batch");
|
|
||||||
replaceValueBatchItem.setId(GridHeaderOperationId.COLUMNBATCHREPLACE.toString());
|
|
||||||
replaceValueBatchItem.setIcon(TabularDataResources.INSTANCE.columnReplaceBatch());
|
|
||||||
menuItems.add(replaceValueBatchItem);
|
|
||||||
|
|
||||||
|
|
||||||
MenuItem replaceValueOnConditionItem = new MenuItem("Replace By Expression");
|
|
||||||
replaceValueOnConditionItem.setId(GridHeaderOperationId.COLUMNREPLACEBYEXPRESSION.toString());
|
|
||||||
replaceValueOnConditionItem.setIcon(TabularDataResources.INSTANCE.columnReplaceByExpression());
|
|
||||||
menuItems.add(replaceValueOnConditionItem);
|
|
||||||
|
|
||||||
|
|
||||||
/*MenuItem newAnnotationColumnItem = new MenuItem("Annotation");
|
|
||||||
newAnnotationColumnItem.setId(GridHeaderOperationId.ANNOTATIONADD.toString());
|
|
||||||
newAnnotationColumnItem.setIcon(TabularDataResources.INSTANCE.annotationAdd());
|
|
||||||
menuItems.add(newAnnotationColumnItem);*/
|
|
||||||
|
|
||||||
/*MenuItem columnDuplicateValidationItem = new MenuItem("Duplicate Detection");
|
|
||||||
columnDuplicateValidationItem.setId(GridHeaderOperationId.DUPLICATEDETECTION.toString());
|
|
||||||
columnDuplicateValidationItem.setIcon(TabularDataResources.INSTANCE.tableDuplicateRows());
|
|
||||||
menuItems.add(columnDuplicateValidationItem);*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return the list of menu items to be added
|
|
||||||
*/
|
|
||||||
public List<MenuItem> getMenu() {
|
|
||||||
return menuItems;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -20,6 +20,8 @@
|
||||||
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
||||||
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
||||||
|
|
||||||
|
|
||||||
|
<inherits name='org.gcube.portlets.user.td.mainboxwidget.MainBox' />
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.user.td.expressionwidget.ExpressionWidget' />
|
name='org.gcube.portlets.user.td.expressionwidget.ExpressionWidget' />
|
||||||
<inherits name='org.gcube.portlets.user.td.tablewidget.TableWidget' />
|
<inherits name='org.gcube.portlets.user.td.tablewidget.TableWidget' />
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
<inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD' />
|
||||||
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
||||||
|
|
||||||
|
<inherits name='org.gcube.portlets.user.td.mainboxwidget.MainBox' />
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.user.td.expressionwidget.ExpressionWidget' />
|
name='org.gcube.portlets.user.td.expressionwidget.ExpressionWidget' />
|
||||||
<inherits name='org.gcube.portlets.user.td.tablewidget.TableWidget' />
|
<inherits name='org.gcube.portlets.user.td.tablewidget.TableWidget' />
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
<set-property name="log_DivLogger" value="ENABLED" /> <set-property
|
<set-property name="log_DivLogger" value="ENABLED" /> <set-property
|
||||||
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_FirebugLogger"
|
name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_FirebugLogger"
|
||||||
value="ENABLED" /> <set-property name="log_GWTLogger" value="ENABLED" />
|
value="ENABLED" /> <set-property name="log_GWTLogger" value="ENABLED" />
|
||||||
<set-property name="log_SystemLogger" value="ENABLED" /> -->
|
<set-property name="log_SystemLogger" value="ENABLED" /> -->
|
||||||
|
|
||||||
|
|
||||||
<set-property name="log_DivLogger" value="DISABLED" />
|
<set-property name="log_DivLogger" value="DISABLED" />
|
||||||
|
|
|
@ -16,9 +16,16 @@
|
||||||
<!-- Base Service -->
|
<!-- Base Service -->
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>tdservlet</servlet-name>
|
<servlet-name>tdservlet</servlet-name>
|
||||||
<servlet-class>org.gcube.portlets.user.td.server.TabularDataServiceImpl</servlet-class>
|
<servlet-class>org.gcube.portlets.user.td.mainboxwidget.server.TabularDataServiceImpl</servlet-class>
|
||||||
<load-on-startup>1</load-on-startup>
|
<load-on-startup>1</load-on-startup>
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
|
<!-- Base Service
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>tdservlet</servlet-name>
|
||||||
|
<servlet-class>org.gcube.portlets.user.td.server.TabularDataServiceImpl</servlet-class>
|
||||||
|
<load-on-startup>1</load-on-startup>
|
||||||
|
</servlet>-->
|
||||||
|
|
||||||
<!-- TDWidget -->
|
<!-- TDWidget -->
|
||||||
<servlet>
|
<servlet>
|
||||||
|
|
Loading…
Reference in New Issue