git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@82167 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-09-30 17:30:47 +00:00
parent 65b120a380
commit 3f3c949afa
7 changed files with 227 additions and 241 deletions

View File

@ -4,6 +4,9 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="tabular-data-information-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-information/tabular-data-information">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-data-widget-td-source-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget-td-source/tabular-data-widget-td-source"> <dependent-module archiveName="tabular-data-widget-td-source-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget-td-source/tabular-data-widget-td-source">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
@ -19,9 +22,6 @@
<dependent-module archiveName="TDOpen-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-open/tabular-data-open"> <dependent-module archiveName="TDOpen-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-open/tabular-data-open">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="tabular-data-information-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-information/tabular-data-information">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="tabular-data-portlet"/> <property name="context-root" value="tabular-data-portlet"/>
</wb-module> </wb-module>

View File

@ -56,6 +56,13 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<!-- TD Information -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-information</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- LOGGING --> <!-- LOGGING -->
<dependency> <dependency>
<groupId>com.allen-sauer.gwt.log</groupId> <groupId>com.allen-sauer.gwt.log</groupId>

View File

@ -6,7 +6,6 @@ package org.gcube.portlets.user.td.client;
import org.gcube.portlets.user.sdmxexportwizardtd.client.SDMXExportWizardTD; import org.gcube.portlets.user.sdmxexportwizardtd.client.SDMXExportWizardTD;
import org.gcube.portlets.user.sdmximportwizardtd.client.SDMXImportWizardTD; import org.gcube.portlets.user.sdmximportwizardtd.client.SDMXImportWizardTD;
import org.gcube.portlets.user.sdmximportwizardtd.client.general.WizardListener; import org.gcube.portlets.user.sdmximportwizardtd.client.general.WizardListener;
import org.gcube.portlets.user.sdmximportwizardtd.shared.TRId;
import org.gcube.portlets.user.td.ciw.client.CSVImporterWidget; import org.gcube.portlets.user.td.ciw.client.CSVImporterWidget;
import org.gcube.portlets.user.td.client.event.CloseTabularResourceEvent; import org.gcube.portlets.user.td.client.event.CloseTabularResourceEvent;
import org.gcube.portlets.user.td.client.event.CloseTabularResourceType; import org.gcube.portlets.user.td.client.event.CloseTabularResourceType;
@ -20,63 +19,54 @@ import org.gcube.portlets.user.td.client.event.OpenTabularResourceEvent;
import org.gcube.portlets.user.td.client.event.OpenTabularResourceType; import org.gcube.portlets.user.td.client.event.OpenTabularResourceType;
import org.gcube.portlets.user.td.importer.client.TabularDataImporterListener; import org.gcube.portlets.user.td.importer.client.TabularDataImporterListener;
import org.gcube.portlets.user.td.information.client.TabularResourceProperties; import org.gcube.portlets.user.td.information.client.TabularResourceProperties;
import org.gcube.portlets.user.td.information.shared.TRId;
import org.gcube.portlets.user.td.open.client.TDOpen; import org.gcube.portlets.user.td.open.client.TDOpen;
import org.gcube.portlets.user.tdw.client.TabularData; import org.gcube.portlets.user.tdw.client.TabularData;
import org.gcube.portlets.user.tdw.shared.model.TableId; import org.gcube.portlets.user.tdw.shared.model.TableId;
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.event.ResizeEvent;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback; import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus; import com.google.web.bindery.event.shared.SimpleEventBus;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.ContentPanel; import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.TabItemConfig; import com.sencha.gxt.widget.core.client.TabItemConfig;
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.BorderLayoutData; import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;
import com.sencha.gxt.widget.core.client.event.BeforeCloseEvent; import com.sencha.gxt.widget.core.client.event.BeforeCloseEvent;
import com.sencha.gxt.widget.core.client.event.BeforeCloseEvent.BeforeCloseHandler; import com.sencha.gxt.widget.core.client.event.BeforeCloseEvent.BeforeCloseHandler;
import com.sencha.gxt.widget.core.client.info.Info; import com.sencha.gxt.widget.core.client.info.Info;
/** /**
* @author "Federico De Faveri defaveri@isti.cnr.it" * @author "Federico De Faveri defaveri@isti.cnr.it"
* *
*/ */
public class TabularDataController { public class TabularDataController {
//implements HasCloseHandlers<Long>, HasOpenHandlers<Long> { // implements HasCloseHandlers<Long>, HasOpenHandlers<Long> {
protected SimpleEventBus eventBus; protected SimpleEventBus eventBus;
protected TabularData tabularData; protected TabularData tabularData;
protected UIState uiState = UIState.START;
protected BorderLayoutContainer centerContainer; protected UIProperties uiProperties = UIProperties.CLOSED;
protected ContentPanel functionalityPanel; protected ContentPanel functionalityPanel;
protected TabPanel functionalityTab; protected TabPanel functionalityTab;
protected int indexFunctionalityTab = 0; protected int indexFunctionalityTab = 0;
protected boolean functionalityOpen; protected TabularResourceProperties trProperties;
protected Label propertiesLabel;
protected BorderLayoutData eastData; protected BorderLayoutData eastData;
/** /**
* Table Open * Tabular Resource Id
*/
protected boolean tableOpen=false;
/**
* Tabular Resource Id
*/ */
protected TRId trId; protected TRId trId;
/** /**
* Grid TableId * Grid TableId
*/ */
protected TableId tableOpening; protected TableId tableOpening;
public TabularDataController() { public TabularDataController() {
eventBus = new SimpleEventBus(); eventBus = new SimpleEventBus();
bindToEvents(); bindToEvents();
@ -88,22 +78,11 @@ public class TabularDataController {
public EventBus getEventBus() { public EventBus getEventBus() {
return eventBus; return eventBus;
} }
public void setTabularData(TabularData tabularData) {
public void setTabularData(TabularData tabularData){ this.tabularData = tabularData;
this.tabularData=tabularData;
}
public BorderLayoutContainer getCenterContainer() {
return centerContainer;
} }
public void setCenterContainer(BorderLayoutContainer centerContainer) {
this.centerContainer = centerContainer;
}
public ContentPanel getFunctionalityPanel() { public ContentPanel getFunctionalityPanel() {
return functionalityPanel; return functionalityPanel;
} }
@ -128,11 +107,6 @@ public class TabularDataController {
this.eastData = eastData; this.eastData = eastData;
} }
protected void bindToEvents() { protected void bindToEvents() {
eventBus.addHandler(ImportTableEvent.TYPE, eventBus.addHandler(ImportTableEvent.TYPE,
new ImportTableEvent.ImportTableHandler() { new ImportTableEvent.ImportTableHandler() {
@ -154,7 +128,8 @@ public class TabularDataController {
new OpenTabularResourceEvent.OpenTabularResourceHandler() { new OpenTabularResourceEvent.OpenTabularResourceHandler() {
@Override @Override
public void onOpenTabularResource(OpenTabularResourceEvent event) { public void onOpenTabularResource(
OpenTabularResourceEvent event) {
doOpenTabularResource(event.getOpenType()); doOpenTabularResource(event.getOpenType());
} }
}); });
@ -162,7 +137,8 @@ public class TabularDataController {
new CloseTabularResourceEvent.CloseTabularResourceHandler() { new CloseTabularResourceEvent.CloseTabularResourceHandler() {
@Override @Override
public void onCloseTabularResource(CloseTabularResourceEvent event) { public void onCloseTabularResource(
CloseTabularResourceEvent event) {
doCloseTabularResource(event.getCloseType()); doCloseTabularResource(event.getCloseType());
} }
}); });
@ -174,8 +150,7 @@ public class TabularDataController {
doOpenFunctionality(event.getOpenFunctionalityType()); doOpenFunctionality(event.getOpenFunctionalityType());
} }
}); });
} }
public void doImportTable(ImportTableType importType) { public void doImportTable(ImportTableType importType) {
@ -196,10 +171,11 @@ public class TabularDataController {
break; break;
} }
} catch (Exception e) { } catch (Exception e) {
Log.error("doImportTable Error : " + e.getLocalizedMessage()+ " \n "+e.getMessage()); Log.error("doImportTable Error : " + e.getLocalizedMessage()
+ " \n " + e.getMessage());
} }
} }
public void doExportTable(ExportTableType exportType) { public void doExportTable(ExportTableType exportType) {
Log.trace("doExportTable importType: " + exportType); Log.trace("doExportTable importType: " + exportType);
Info.display("Export Tabular Resource", "type: " + exportType); Info.display("Export Tabular Resource", "type: " + exportType);
@ -218,10 +194,10 @@ public class TabularDataController {
break; break;
} }
} catch (Exception e) { } catch (Exception e) {
Log.error("doImportTable Error : " + e.getLocalizedMessage()+ " \n "+e.getMessage()); Log.error("doImportTable Error : " + e.getLocalizedMessage()
+ " \n " + e.getMessage());
} }
} }
public void doOpenTabularResource(OpenTabularResourceType openType) { public void doOpenTabularResource(OpenTabularResourceType openType) {
Log.trace("doOpenTabularResource openType: " + openType); Log.trace("doOpenTabularResource openType: " + openType);
@ -235,11 +211,11 @@ public class TabularDataController {
break; break;
} }
} catch (Exception e) { } catch (Exception e) {
Log.error("doOpenTable Error : " + e.getLocalizedMessage()+ " \n "+e.getMessage()); Log.error("doOpenTable Error : " + e.getLocalizedMessage() + " \n "
+ e.getMessage());
} }
} }
public void doCloseTabularResource(CloseTabularResourceType closeType) { public void doCloseTabularResource(CloseTabularResourceType closeType) {
Log.trace("doCloseTabularResource closeType: " + closeType); Log.trace("doCloseTabularResource closeType: " + closeType);
Info.display("Close Tabular Resource", "close: " + closeType); Info.display("Close Tabular Resource", "close: " + closeType);
@ -252,13 +228,13 @@ public class TabularDataController {
break; break;
} }
} catch (Exception e) { } catch (Exception e) {
Log.error("doOpenTable Error : " + e.getLocalizedMessage()+ " \n "+e.getMessage()); Log.error("doOpenTable Error : " + e.getLocalizedMessage() + " \n "
+ e.getMessage());
} }
} }
public void doOpenFunctionality(OpenFunctionalityType openType) { public void doOpenFunctionality(OpenFunctionalityType openType) {
Log.trace("doOpenFunctionality openType: " + openType); Log.trace("doOpenFunctionality openType: " + openType);
Info.display("Open Functionality", "open: " + openType);
try { try {
switch (openType) { switch (openType) {
case PROPERTIES: case PROPERTIES:
@ -272,107 +248,111 @@ public class TabularDataController {
e.printStackTrace(); e.printStackTrace();
} }
} }
protected void openFunctionalityProperties(){
if(propertiesLabel==null){
propertiesLabel = new Label("Tabular Resources Properties");
propertiesLabel.addStyleName("pad-text");
TabItemConfig propertiesItemConf=new TabItemConfig("Properties", true);
org.gcube.portlets.user.td.information.shared.TRId trId=new org.gcube.portlets.user.td.information.shared.TRId("0","1");
TabularResourceProperties trProperties=new TabularResourceProperties("TRProperties",eventBus,trId);
trProperties.setHeaderVisible(false);
functionalityTab.add(trProperties, propertiesItemConf);
functionalityTab.addBeforeCloseHandler(new BeforeCloseHandler<Widget>(){
@Override protected void openFunctionalityProperties() {
public void onBeforeClose(BeforeCloseEvent<Widget> event) { if (uiState == UIState.TR_OPEN) {
if(functionalityTab.getWidgetCount()==1){ if (uiProperties == UIProperties.OPENED) {
functionalityPanel.disable(); functionalityPanel.collapse();
functionalityPanel.collapse(); functionalityPanel.disable();
functionalityOpen=false; uiProperties=UIProperties.CLOSED;
propertiesLabel=null; functionalityTab.remove(trProperties);
} Info.display("Properties", "Closed");
} else {
} TabItemConfig propertiesItemConf = new TabItemConfig(
"Properties", true);
} trProperties = new TabularResourceProperties(
); "TRProperties", eventBus, trId);
trProperties.setHeaderVisible(false);
Label taskLabel = new Label("Task Properties"); functionalityTab.add(trProperties, propertiesItemConf);
taskLabel.addStyleName("pad-text"); functionalityTab
functionalityTab.add(taskLabel, new TabItemConfig("Task", true)); .addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
@Override
//Last is functionalityTab.getWidgetCount() - 1) public void onBeforeClose(
functionalityTab.setActiveWidget(functionalityTab BeforeCloseEvent<Widget> event) {
.getWidget(0)); if (functionalityTab.getWidgetCount() == 1) {
functionalityPanel.disable();
centerContainer.onResize(); functionalityPanel.collapse();
} uiProperties=UIProperties.CLOSED;
functionalityTab.remove(trProperties);
if(functionalityOpen){ }
functionalityPanel.collapse();
functionalityOpen=false; }
});
/*Label taskLabel = new Label("Task Properties");
taskLabel.addStyleName("pad-text");
functionalityTab
.add(taskLabel, new TabItemConfig("Task", true));
*/
functionalityTab.setActiveWidget(functionalityTab.getWidget(0));
functionalityPanel.enable();
functionalityPanel.expand();
uiProperties=UIProperties.OPENED;
}
} else { } else {
functionalityPanel.enable(); Info.display("Properties", "No table open");
functionalityPanel.expand();
functionalityOpen=true;
} }
centerContainer.onResize();
}; };
protected void openSDMXImportWizard() { protected void openSDMXImportWizard() {
GWT.runAsync(new RunAsyncCallback() { GWT.runAsync(new RunAsyncCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
SDMXImportWizardTD importWizard= new SDMXImportWizardTD("SDMX Import"); SDMXImportWizardTD importWizard = new SDMXImportWizardTD(
"SDMX Import");
importWizard.addListener(new WizardListener(){ importWizard.addListener(new WizardListener() {
@Override @Override
public void completed(TRId tabularResourceId) { public void completed(TRId tabularResourceId) {
trId=tabularResourceId; trId = tabularResourceId;
tableOpening=new TableId(Constants.TD_DATASOURCE_FACTORY_ID,trId.getTableId()); tableOpening = new TableId(
tabularData.openTable(tableOpening); Constants.TD_DATASOURCE_FACTORY_ID, trId
tableOpen=true; .getTableId());
tabularData.openTable(tableOpening);
uiState = UIState.TR_OPEN;
} }
@Override @Override
public void aborted() { public void aborted() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void failed(Throwable throwable, String reason, public void failed(Throwable throwable, String reason,
String details) { String details) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
}); });
/* /*
importWizard.addWizardSelectionHandler(new WizardSelectionHandler<Dataset>() { * importWizard.addWizardSelectionHandler(new
* WizardSelectionHandler<Dataset>() {
*
* @Override public void onSelected(
* SDMXWizardSelectionEvent<Dataset> event) {
* doSDMXDatasetImport(event.getSelected()); }
*
* @Override public void onClosed(
* SDMXWizardSelectionEvent<Dataset> event) {
*
* } });
*/
@Override
public void onSelected(
SDMXWizardSelectionEvent<Dataset> event) {
doSDMXDatasetImport(event.getSelected());
}
@Override
public void onClosed(
SDMXWizardSelectionEvent<Dataset> event) {
}
});*/
importWizard.show(); importWizard.show();
} }
@ -381,40 +361,41 @@ public class TabularDataController {
asyncCodeLoadingFailed(reason); asyncCodeLoadingFailed(reason);
} }
}); });
} }
protected void openSDMXExportWizard() { protected void openSDMXExportWizard() {
GWT.runAsync(new RunAsyncCallback() { GWT.runAsync(new RunAsyncCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
SDMXExportWizardTD exportWizard= new SDMXExportWizardTD("SDMX Export"); SDMXExportWizardTD exportWizard = new SDMXExportWizardTD(
"SDMX Export");
exportWizard
.addListener(new org.gcube.portlets.user.sdmxexportwizardtd.client.general.WizardListener() {
@Override
public void failed(Throwable throwable,
String reason, String details) {
// TODO Auto-generated method stub
}
@Override
public void completed(TRId id) {
// TODO Auto-generated method stub
}
@Override
public void aborted() {
// TODO Auto-generated method stub
}
});
exportWizard.addListener(new org.gcube.portlets.user.sdmxexportwizardtd.client.general.WizardListener() {
@Override
public void failed(Throwable throwable, String reason, String details) {
// TODO Auto-generated method stub
}
@Override
public void completed(
org.gcube.portlets.user.sdmxexportwizardtd.shared.TRId id) {
// TODO Auto-generated method stub
}
@Override
public void aborted() {
// TODO Auto-generated method stub
}
});
exportWizard.show(); exportWizard.show();
} }
@ -423,58 +404,65 @@ public class TabularDataController {
asyncCodeLoadingFailed(reason); asyncCodeLoadingFailed(reason);
} }
}); });
} }
/** /**
* *
*/ */
protected void closeTabularResources(){ protected void closeTabularResources() {
if(tableOpen) tabularData.closeTable(); if (uiState == UIState.TR_OPEN) {
tabularData.closeTable();
uiState = UIState.START;
if(uiProperties==UIProperties.OPENED){
functionalityPanel.collapse();
functionalityPanel.disable();
uiProperties=UIProperties.CLOSED;
functionalityTab.remove(trProperties);
}
}
} }
/** /**
* *
*/ */
protected void openTabularResources() { protected void openTabularResources() {
Log.info("Open Tabular Resources"); Log.info("Open Tabular Resources");
GWT.runAsync(new RunAsyncCallback() { GWT.runAsync(new RunAsyncCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
TDOpen tdOpen= new TDOpen("Tabular Resources Open"); TDOpen tdOpen = new TDOpen("Tabular Resources Open");
tdOpen.addListener(new org.gcube.portlets.user.td.open.client.general.WizardListener(){ tdOpen.addListener(new org.gcube.portlets.user.td.open.client.general.WizardListener() {
@Override @Override
public void aborted() { public void aborted() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void failed(Throwable throwable, String reason, public void failed(Throwable throwable, String reason,
String details) { String details) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public void completed( public void completed(TRId tabularResourceId) {
org.gcube.portlets.user.td.open.shared.TRId tabularResourceId) { trId = new TRId(tabularResourceId.getId(),
trId= new TRId(tabularResourceId.getId(),tabularResourceId.getTableId()); tabularResourceId.getTableId());
tableOpening=new TableId(Constants.TD_DATASOURCE_FACTORY_ID,trId.getTableId()); tableOpening = new TableId(
tabularData.openTable(tableOpening); Constants.TD_DATASOURCE_FACTORY_ID, trId
tableOpen=true; .getTableId());
tabularData.openTable(tableOpening);
uiState = UIState.TR_OPEN;
} }
}); });
Log.info("TDOpen add Listener"); Log.info("TDOpen add Listener");
tdOpen.show(); tdOpen.show();
@ -485,20 +473,18 @@ public class TabularDataController {
asyncCodeLoadingFailed(reason); asyncCodeLoadingFailed(reason);
} }
}); });
}
/*
protected void doSDMXDatasetImport(List<Dataset> datasets) {
Log.info("doSDMXDatasetImport: " + datasets.size());
for (Dataset d : datasets) {
Log.info("Dataset: " + d.getId() + d.getName() + d.getAgencyId());
}
} }
*/
/*
* protected void doSDMXDatasetImport(List<Dataset> datasets) {
* Log.info("doSDMXDatasetImport: " + datasets.size()); for (Dataset d :
* datasets) { Log.info("Dataset: " + d.getId() + d.getName() +
* d.getAgencyId()); }
*
* }
*/
protected void openCSVImportWizard() { protected void openCSVImportWizard() {
/* /*
* GWT.runAsync(new RunAsyncCallback() { * GWT.runAsync(new RunAsyncCallback() {
@ -541,35 +527,25 @@ public class TabularDataController {
Info.display("Async code loading failed", Info.display("Async code loading failed",
"Please retry to lunch the operation"); "Please retry to lunch the operation");
} }
/**
* {@inheritDoc}
@Override
public HandlerRegistration addCloseHandler(CloseHandler<Long> handler) {
//return eventBus.addHandler(CloseEvent.getType(), handler);
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*
@Override * @Override public HandlerRegistration addCloseHandler(CloseHandler<Long>
public HandlerRegistration addOpenHandler(OpenHandler<Long> handler) { * handler) { //return eventBus.addHandler(CloseEvent.getType(),
//return eventBus.addHandler(OpenEvent.getType(), handler); * handler); }
} *
*/ * /** {@inheritDoc}
* @Override public HandlerRegistration addOpenHandler(OpenHandler<Long>
* handler) { //return eventBus.addHandler(OpenEvent.getType(),
* handler); }
*/
/** /**
* {@inheritDoc} * {@inheritDoc}
*
@Override * @Override public void fireEvent(GwtEvent<?> event) {
public void fireEvent(GwtEvent<?> event) { * eventBus.fireEvent(event); }
eventBus.fireEvent(event); */
}
*/
} }

View File

@ -55,7 +55,7 @@ public class TabularDataPortlet implements EntryPoint {
//Private TabularData //Private TabularData
private static TabularData tabularData; private static TabularData tabularData;
private static BorderLayoutContainer centerContainer;
private static ContentPanel functionalityPanel; private static ContentPanel functionalityPanel;
private static TabPanel functionalityTab; private static TabPanel functionalityTab;
private static BorderLayoutData eastData; private static BorderLayoutData eastData;
@ -115,55 +115,45 @@ public class TabularDataPortlet implements EntryPoint {
toolBarData.setSplit(false); toolBarData.setSplit(false);
mainPanelLayout.setNorthWidget(toolBarPanel, toolBarData); mainPanelLayout.setNorthWidget(toolBarPanel, toolBarData);
//Set Center Container
centerContainer = new BorderLayoutContainer();
centerContainer.setResize(true);
centerContainer.setBorders(false);
//Grid Panel //Grid Panel
final TabularDataGridPanel gridPanel = tabularData.getGridPanel(); final TabularDataGridPanel gridPanel = tabularData.getGridPanel();
gridPanel.setHeaderVisible(false); gridPanel.setHeaderVisible(false);
MarginData gridData = new MarginData(); MarginData gridData = new MarginData();
centerContainer.setCenterWidget(gridPanel,gridData); mainPanelLayout.setCenterWidget(gridPanel,gridData);
//Functionality Panel //Functionality Panel
functionalityPanel= new ContentPanel(); functionalityPanel= new ContentPanel();
functionalityPanel.setWidth(250);
functionalityPanel.setHeaderVisible(false); functionalityPanel.setHeaderVisible(false);
functionalityPanel.setResize(true); functionalityPanel.setResize(true);
functionalityTab=new TabPanel(); functionalityTab=new TabPanel();
//functionalityTab.setPixelSize(600, 250);
functionalityTab.setAnimScroll(true); functionalityTab.setAnimScroll(true);
functionalityTab.setTabScroll(true); functionalityTab.setTabScroll(true);
functionalityTab.setCloseContextMenu(true); functionalityTab.setCloseContextMenu(true);
eastData = new BorderLayoutData(200); functionalityPanel.add(functionalityTab);
eastData = new BorderLayoutData(250);
eastData.setCollapsible(true); eastData.setCollapsible(true);
eastData.setSplit(true); eastData.setSplit(false);
eastData.setFloatable(false); eastData.setFloatable(false);
eastData.setCollapseMini(true); eastData.setCollapseMini(true);
eastData.setMargins(new Margins(0, 5, 0, 5)); eastData.setMargins(new Margins(0, 5, 0, 5));
eastData.setCollapseHidden(true); eastData.setCollapseHidden(true);
//eastData.setCollapsed(true);
mainPanelLayout.setEastWidget(functionalityPanel,eastData);
functionalityPanel.add(functionalityTab);
//functionalityPanel.setVisible(false);
centerContainer.setEastWidget(functionalityPanel,eastData);
functionalityPanel.collapse(); functionalityPanel.collapse();
functionalityPanel.disable(); functionalityPanel.disable();
controller.setFunctionalityTab(functionalityTab); controller.setFunctionalityTab(functionalityTab);
controller.setFunctionalityPanel(functionalityPanel); controller.setFunctionalityPanel(functionalityPanel);
controller.setEastData(eastData);
//Set Center Container
mainPanelLayout.setCenterWidget(centerContainer, gridData);
controller.setCenterContainer(centerContainer);
//Main //Main
SimpleContainer mainPanel = new SimpleContainer(); SimpleContainer mainPanel = new SimpleContainer();

View File

@ -0,0 +1,6 @@
package org.gcube.portlets.user.td.client;
public enum UIProperties {
CLOSED,
OPENED;
}

View File

@ -0,0 +1,8 @@
package org.gcube.portlets.user.td.client;
public enum UIState {
START,
TR_OPEN,
TR_IMPORT,
TR_EXPORT
}

View File

@ -51,7 +51,6 @@ public class TabularDataRibbon {
ribbon.add(con, "Charts"); ribbon.add(con, "Charts");
} }
/** /**