Added TRId to UIStateEvent

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@86620 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-12-05 15:26:43 +00:00
parent 1b35f25fa9
commit 6c83a4b1c6
2 changed files with 17 additions and 6 deletions

View File

@ -11,10 +11,10 @@ import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.UIStateEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.UIStateType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.csvexportwidget.client.CSVExportWizardTD;
import org.gcube.portlets.user.td.csvimportwidget.client.CSVImportWizardTD;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
import org.gcube.portlets.user.td.informationwidget.client.TabularResourceProperties;
import org.gcube.portlets.user.td.openwidget.client.TDOpen;
@ -139,19 +139,24 @@ public class TabularDataController {
protected void resumeUIState() {
if (uiState == UIStateType.TR_OPEN) {
eventBus.fireEvent(new UIStateEvent(UIStateType.TR_OPEN));
UIStateEvent uiStateEvent=new UIStateEvent(UIStateType.TR_OPEN);
uiStateEvent.setTrId(trId);
eventBus.fireEvent(uiStateEvent);
} else {
eventBus.fireEvent(new UIStateEvent(UIStateType.TR_CLOSE));
}
}
protected void openTable(TRId tabularResourceId) {
Log.debug("openTabe: "+tabularResourceId);
trId = tabularResourceId;
tableOpening = new TableId(Constants.TD_DATASOURCE_FACTORY_ID,
trId.getTableId());
tabularData.openTable(tableOpening);
uiState = UIStateType.TR_OPEN;
eventBus.fireEvent(new UIStateEvent(UIStateType.TR_OPEN));
UIStateEvent uiStateEvent=new UIStateEvent(UIStateType.TR_OPEN);
uiStateEvent.setTrId(tabularResourceId);
eventBus.fireEvent(uiStateEvent);
updateUIProperties();
}

View File

@ -277,7 +277,7 @@ public class FileToolBar {
@Override
public void onUIState(UIStateEvent event) {
setUI(event.getUIStateType());
setUI(event);
}
@ -297,7 +297,8 @@ public class FileToolBar {
}
public void setUI(UIStateType uiStateType) {
public void setUI(UIStateEvent event) {
UIStateType uiStateType=event.getUIStateType();
try {
switch (uiStateType) {
case START:
@ -332,9 +333,14 @@ public class FileToolBar {
importCSVButton.enable();
importJSONButton.disable();
importSDMXButton.enable();
if(event.getTrId().getTableType().compareTo("Codelist")==0){
exportSDMXButton.enable();
} else {
exportSDMXButton.disable();
}
exportCSVButton.enable();
exportJSONButton.disable();
exportSDMXButton.enable();
break;
case WIZARD_OPEN:
openButton.disable();