209: TDM - Show the resources through a ListView widget
Task-Url: https://support.d4science.org/issues/209 Added Resources to Main git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-mainbox-widget@115230 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
16582f749b
commit
e4c04497aa
19
pom.xml
19
pom.xml
|
@ -166,7 +166,15 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tabular-data-wizard-widget -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-wizard-widget</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- TDX Source -->
|
<!-- TDX Source -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
@ -174,6 +182,15 @@
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tabular-data-resources-widget -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>tabular-data-resources-widget</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- LOGGING -->
|
<!-- LOGGING -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -13,11 +13,13 @@
|
||||||
<!-- otherwise eclipse complains (Google plugin bug?) -->
|
<!-- otherwise eclipse complains (Google plugin bug?) -->
|
||||||
<inherits name='com.google.gwt.junit.JUnit' />
|
<inherits name='com.google.gwt.junit.JUnit' />
|
||||||
|
|
||||||
<inherits name="org.gcube.portlets.user.tdwx.TabularDataWidgetX" />
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
|
name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
|
||||||
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
||||||
|
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
||||||
|
<inherits name="org.gcube.portlets.user.tdwx.TabularDataWidgetX" />
|
||||||
|
<inherits name='org.gcube.portlets.user.td.resourceswidget.ResourcesWidget' />
|
||||||
|
|
||||||
<!-- <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.resourceswidget.ResourcesWidget'
|
<!-- <inherits name='org.gcube.portlets.user.td.resourceswidget.ResourcesWidget'
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class MainBox extends TabPanel {
|
||||||
private static final int TAB_WIDTH = 160;
|
private static final int TAB_WIDTH = 160;
|
||||||
|
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
|
|
||||||
private ArrayList<TDXPanel> tdxPanelList;
|
private ArrayList<TDXPanel> tdxPanelList;
|
||||||
|
|
||||||
public MainBox(String name, EventBus eventBus, MainBoxPanel mainBoxPanel) {
|
public MainBox(String name, EventBus eventBus, MainBoxPanel mainBoxPanel) {
|
||||||
|
@ -258,62 +258,70 @@ public class MainBox extends TabPanel {
|
||||||
protected void addContentTDXPanel(
|
protected void addContentTDXPanel(
|
||||||
TabularResourceDataView tabularResourceDataView,
|
TabularResourceDataView tabularResourceDataView,
|
||||||
TabResource tabResource) {
|
TabResource tabResource) {
|
||||||
SafeHtml nameTR;
|
try {
|
||||||
if(tabResource!=null && (tabResource.getName()==null
|
SafeHtml nameTR;
|
||||||
||tabResource.getName().isEmpty())){
|
if (tabResource != null
|
||||||
nameTR=SafeHtmlUtils.fromString("NoName");
|
&& (tabResource.getName() == null || tabResource.getName()
|
||||||
} else {
|
.isEmpty())) {
|
||||||
nameTR=SafeHtmlUtils.fromString(tabResource.getName());
|
nameTR = SafeHtmlUtils.fromString("NoName");
|
||||||
}
|
} else {
|
||||||
|
nameTR = SafeHtmlUtils.fromString(tabResource.getName());
|
||||||
TabItemConfig tdxPanelItemConf = new TabItemConfig(
|
}
|
||||||
nameTR.asString(), true);
|
|
||||||
tdxPanelItemConf.setIcon(MainboxResources.INSTANCE.tabularResource());
|
|
||||||
final TDXPanel tdxPanel = new TDXPanel(eventBus);
|
|
||||||
tdxPanel.open(tabularResourceDataView);
|
|
||||||
tdxPanelList.add(tdxPanel);
|
|
||||||
|
|
||||||
add(tdxPanel, tdxPanelItemConf);
|
TabItemConfig tdxPanelItemConf = new TabItemConfig(
|
||||||
|
nameTR.asString(), true);
|
||||||
|
tdxPanelItemConf.setIcon(MainboxResources.INSTANCE
|
||||||
|
.tabularResource());
|
||||||
|
final TDXPanel tdxPanel = new TDXPanel(eventBus);
|
||||||
|
tdxPanel.open(tabularResourceDataView);
|
||||||
|
tdxPanelList.add(tdxPanel);
|
||||||
|
|
||||||
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
|
add(tdxPanel, tdxPanelItemConf);
|
||||||
|
|
||||||
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
|
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
|
||||||
if (tdxPanel == event.getItem()) {
|
|
||||||
|
|
||||||
remove(tdxPanel);
|
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
|
||||||
tdxPanelList.remove(tdxPanel);
|
if (tdxPanel == event.getItem()) {
|
||||||
TabularResourceDataView oldDataView = tdxPanel
|
|
||||||
.getTabularResourceDataView();
|
remove(tdxPanel);
|
||||||
Widget active = getActiveWidget();
|
tdxPanelList.remove(tdxPanel);
|
||||||
if (active != null) {
|
TabularResourceDataView oldDataView = tdxPanel
|
||||||
if (active instanceof TDXPanel) {
|
.getTabularResourceDataView();
|
||||||
TDXPanel tdxPanelActive = (TDXPanel) active;
|
Widget active = getActiveWidget();
|
||||||
TabularResourceDataView newDataView = tdxPanelActive
|
if (active != null) {
|
||||||
.getTabularResourceDataView();
|
if (active instanceof TDXPanel) {
|
||||||
|
TDXPanel tdxPanelActive = (TDXPanel) active;
|
||||||
|
TabularResourceDataView newDataView = tdxPanelActive
|
||||||
|
.getTabularResourceDataView();
|
||||||
|
DataViewActiveEvent dataViewActiveEvent = new DataViewActiveEvent();
|
||||||
|
dataViewActiveEvent.setDataView(newDataView);
|
||||||
|
dataViewActiveEvent.setOldDataView(oldDataView);
|
||||||
|
dataViewActiveEvent
|
||||||
|
.setDataViewActiveType(DataViewActiveType.ACTIVEAFTERCLOSE);
|
||||||
|
eventBus.fireEvent(dataViewActiveEvent);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
DataViewActiveEvent dataViewActiveEvent = new DataViewActiveEvent();
|
DataViewActiveEvent dataViewActiveEvent = new DataViewActiveEvent();
|
||||||
dataViewActiveEvent.setDataView(newDataView);
|
|
||||||
dataViewActiveEvent.setOldDataView(oldDataView);
|
dataViewActiveEvent.setOldDataView(oldDataView);
|
||||||
dataViewActiveEvent
|
dataViewActiveEvent
|
||||||
.setDataViewActiveType(DataViewActiveType.ACTIVEAFTERCLOSE);
|
.setDataViewActiveType(DataViewActiveType.CLOSE);
|
||||||
eventBus.fireEvent(dataViewActiveEvent);
|
eventBus.fireEvent(dataViewActiveEvent);
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
DataViewActiveEvent dataViewActiveEvent = new DataViewActiveEvent();
|
|
||||||
dataViewActiveEvent.setOldDataView(oldDataView);
|
|
||||||
dataViewActiveEvent
|
|
||||||
.setDataViewActiveType(DataViewActiveType.CLOSE);
|
|
||||||
eventBus.fireEvent(dataViewActiveEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
});
|
||||||
|
setActiveWidget(tdxPanel);
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
});
|
} catch (Throwable e) {
|
||||||
setActiveWidget(tdxPanel);
|
Log.error("Error adding TDXPanel: " + e.getLocalizedMessage());
|
||||||
forceLayout();
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addWelcomeTab() {
|
protected void addWelcomeTab() {
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
package org.gcube.portlets.user.td.mainboxwidget.client.tdx;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.mainboxwidget.client.grid.GridContextMenu;
|
||||||
|
import org.gcube.portlets.user.td.mainboxwidget.client.grid.GridHeaderColumnMenu;
|
||||||
|
import org.gcube.portlets.user.td.mainboxwidget.client.utils.Constants;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
||||||
|
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.FailureEvent.FailureEventHandler;
|
||||||
|
import org.gcube.portlets.user.tdwx.shared.model.TableId;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
|
import com.sencha.gxt.core.client.Style.SelectionMode;
|
||||||
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.MarginData;
|
||||||
|
import com.sencha.gxt.widget.core.client.info.Info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo email: <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TDXGridPanel extends FramedPanel {
|
||||||
|
|
||||||
|
// private static final String HEIGHT = "600px";
|
||||||
|
private EventBus eventBus;
|
||||||
|
private TabularResourceDataView tabularResourceDataView;
|
||||||
|
private TabularDataX tabularData;
|
||||||
|
|
||||||
|
public TDXGridPanel(EventBus eventBus) {
|
||||||
|
super();
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
init();
|
||||||
|
addGrid();
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void init() {
|
||||||
|
// setWidth(WIDTH);
|
||||||
|
// setHeight(HEIGHT);
|
||||||
|
setHeaderVisible(false);
|
||||||
|
setBodyBorder(false);
|
||||||
|
setBorders(false);
|
||||||
|
setResize(true);
|
||||||
|
forceLayoutOnResize = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addGrid() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
tabularData = new TabularDataX(Constants.TDX_DATASOURCE_FACTORY_ID);
|
||||||
|
tabularData.addFailureHandler(new FailureEventHandler() {
|
||||||
|
|
||||||
|
public void onFailure(FailureEvent event) {
|
||||||
|
Throwable e = event.getCaught();
|
||||||
|
Info.display("Error: " + event.getMessage(),
|
||||||
|
e.getLocalizedMessage());
|
||||||
|
Log.error("Error: " + e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Grid Panel
|
||||||
|
TabularDataXGridPanel gridPanel = tabularData.getGridPanel();
|
||||||
|
|
||||||
|
GridHeaderColumnMenu columnHeaderMenu = new GridHeaderColumnMenu();
|
||||||
|
gridPanel.addGridHeaderContextMenuItems(columnHeaderMenu.getMenu(),
|
||||||
|
eventBus);
|
||||||
|
|
||||||
|
GridContextMenu gridContextMenu = new GridContextMenu(gridPanel,
|
||||||
|
eventBus);
|
||||||
|
gridPanel.setGridContextMenu(gridContextMenu.getMenu());
|
||||||
|
|
||||||
|
gridPanel.setSelectionModel(SelectionMode.MULTI);
|
||||||
|
|
||||||
|
add(gridPanel, new MarginData());
|
||||||
|
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void open(TabularResourceDataView dataView) {
|
||||||
|
tabularResourceDataView = dataView;
|
||||||
|
TableId tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
||||||
|
tabularResourceDataView.getTrId().getTableId());
|
||||||
|
tabularData.openTable(tableOpening);
|
||||||
|
//forceLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(TabularResourceDataView dataView) {
|
||||||
|
if (isValidDataViewRequest(dataView)) {
|
||||||
|
tabularResourceDataView = dataView;
|
||||||
|
TableId tableOpening = new TableId(
|
||||||
|
Constants.TDX_DATASOURCE_FACTORY_ID,
|
||||||
|
tabularResourceDataView.getTrId().getTableId());
|
||||||
|
tabularData.openTable(tableOpening);
|
||||||
|
//forceLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValidDataViewRequest(TabularResourceDataView dataViewRequest) {
|
||||||
|
if (dataViewRequest != null
|
||||||
|
&& dataViewRequest.getTrId() != null
|
||||||
|
&& dataViewRequest.getTrId().getId().compareTo(tabularResourceDataView
|
||||||
|
.getTrId().getId())==0) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public TabularDataX getTabularData() {
|
||||||
|
return tabularData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TabularResourceDataView getTabularResourceDataView() {
|
||||||
|
return tabularResourceDataView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,21 +1,10 @@
|
||||||
package org.gcube.portlets.user.td.mainboxwidget.client.tdx;
|
package org.gcube.portlets.user.td.mainboxwidget.client.tdx;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.mainboxwidget.client.grid.GridContextMenu;
|
|
||||||
import org.gcube.portlets.user.td.mainboxwidget.client.grid.GridHeaderColumnMenu;
|
|
||||||
import org.gcube.portlets.user.td.mainboxwidget.client.utils.Constants;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
||||||
import org.gcube.portlets.user.tdwx.client.TabularDataX;
|
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.FailureEvent.FailureEventHandler;
|
|
||||||
import org.gcube.portlets.user.tdwx.shared.model.TableId;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
|
||||||
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.widget.core.client.FramedPanel;
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
import com.sencha.gxt.widget.core.client.container.MarginData;
|
|
||||||
import com.sencha.gxt.widget.core.client.info.Info;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -26,15 +15,14 @@ import com.sencha.gxt.widget.core.client.info.Info;
|
||||||
public class TDXPanel extends FramedPanel {
|
public class TDXPanel extends FramedPanel {
|
||||||
|
|
||||||
// private static final String HEIGHT = "600px";
|
// private static final String HEIGHT = "600px";
|
||||||
protected EventBus eventBus;
|
private TDXTabPanel tdxTabPanel;
|
||||||
protected TabularResourceDataView tabularResourceDataView;
|
private EventBus eventBus;
|
||||||
protected TabularDataX tabularData;
|
|
||||||
|
|
||||||
public TDXPanel(EventBus eventBus) {
|
public TDXPanel(EventBus eventBus) {
|
||||||
super();
|
super();
|
||||||
this.eventBus = eventBus;
|
this.eventBus = eventBus;
|
||||||
init();
|
init();
|
||||||
addGrid();
|
addTDXTabPanel();
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,81 +36,30 @@ public class TDXPanel extends FramedPanel {
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addGrid() {
|
protected void addTDXTabPanel() {
|
||||||
|
tdxTabPanel=new TDXTabPanel(eventBus);
|
||||||
try {
|
add(tdxTabPanel);
|
||||||
tabularData = new TabularDataX(Constants.TDX_DATASOURCE_FACTORY_ID);
|
|
||||||
tabularData.addFailureHandler(new FailureEventHandler() {
|
|
||||||
|
|
||||||
public void onFailure(FailureEvent event) {
|
|
||||||
Throwable e = event.getCaught();
|
|
||||||
Info.display("Error: " + event.getMessage(),
|
|
||||||
e.getLocalizedMessage());
|
|
||||||
Log.error("Error: " + e.getLocalizedMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Grid Panel
|
|
||||||
TabularDataXGridPanel gridPanel = tabularData.getGridPanel();
|
|
||||||
|
|
||||||
GridHeaderColumnMenu columnHeaderMenu = new GridHeaderColumnMenu();
|
|
||||||
gridPanel.addGridHeaderContextMenuItems(columnHeaderMenu.getMenu(),
|
|
||||||
eventBus);
|
|
||||||
|
|
||||||
GridContextMenu gridContextMenu = new GridContextMenu(gridPanel,
|
|
||||||
eventBus);
|
|
||||||
gridPanel.setGridContextMenu(gridContextMenu.getMenu());
|
|
||||||
|
|
||||||
gridPanel.setSelectionModel(SelectionMode.MULTI);
|
|
||||||
|
|
||||||
add(gridPanel, new MarginData());
|
|
||||||
|
|
||||||
} catch (Throwable e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void open(TabularResourceDataView dataView) {
|
public void open(TabularResourceDataView dataView) {
|
||||||
tabularResourceDataView = dataView;
|
tdxTabPanel.open(dataView);
|
||||||
TableId tableOpening = new TableId(Constants.TDX_DATASOURCE_FACTORY_ID,
|
|
||||||
tabularResourceDataView.getTrId().getTableId());
|
|
||||||
tabularData.openTable(tableOpening);
|
|
||||||
//forceLayout();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(TabularResourceDataView dataView) {
|
public void update(TabularResourceDataView dataView) {
|
||||||
if (isValidDataViewRequest(dataView)) {
|
tdxTabPanel.update(dataView);
|
||||||
tabularResourceDataView = dataView;
|
|
||||||
TableId tableOpening = new TableId(
|
|
||||||
Constants.TDX_DATASOURCE_FACTORY_ID,
|
|
||||||
tabularResourceDataView.getTrId().getTableId());
|
|
||||||
tabularData.openTable(tableOpening);
|
|
||||||
//forceLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValidDataViewRequest(TabularResourceDataView dataViewRequest) {
|
public boolean isValidDataViewRequest(TabularResourceDataView dataViewRequest) {
|
||||||
if (dataViewRequest != null
|
return tdxTabPanel.isValidDataViewRequest(dataViewRequest);
|
||||||
&& dataViewRequest.getTrId() != null
|
|
||||||
&& dataViewRequest.getTrId().getId().compareTo(tabularResourceDataView
|
|
||||||
.getTrId().getId())==0) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TabularDataX getTabularData() {
|
public TabularDataX getTabularData() {
|
||||||
return tabularData;
|
return tdxTabPanel.getTabularData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TabularResourceDataView getTabularResourceDataView() {
|
public TabularResourceDataView getTabularResourceDataView() {
|
||||||
return tabularResourceDataView;
|
return tdxTabPanel.getTabularResourceDataView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
package org.gcube.portlets.user.td.mainboxwidget.client.tdx;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.resourceswidget.client.ResourcesListViewPanel;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
||||||
|
import org.gcube.portlets.user.tdwx.client.TabularDataX;
|
||||||
|
|
||||||
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
|
import com.sencha.gxt.core.client.dom.XElement;
|
||||||
|
import com.sencha.gxt.widget.core.client.TabItemConfig;
|
||||||
|
import com.sencha.gxt.widget.core.client.TabPanel;
|
||||||
|
|
||||||
|
public class TDXTabPanel extends TabPanel {
|
||||||
|
private static final int TAB_WIDTH = 96;
|
||||||
|
|
||||||
|
private EventBus eventBus;
|
||||||
|
private TDXGridPanel gridPanel;
|
||||||
|
private ResourcesListViewPanel resourcesPanel;
|
||||||
|
|
||||||
|
public TDXTabPanel(EventBus eventBus) {
|
||||||
|
super();
|
||||||
|
// GWT.<TabPanelAppearance> create(BlueTabPanelAppearance.class));
|
||||||
|
Log.debug("Create TDXTabPanel");
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
init();
|
||||||
|
create();
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void init() {
|
||||||
|
setBodyBorder(false);
|
||||||
|
setBorders(false);
|
||||||
|
setAnimScroll(false);
|
||||||
|
setTabScroll(false);
|
||||||
|
setCloseContextMenu(false);
|
||||||
|
setResizeTabs(true);
|
||||||
|
setTabWidth(TAB_WIDTH);
|
||||||
|
|
||||||
|
XElement barElement=getAppearance().getBar(getElement());
|
||||||
|
XElement bodyElement=getAppearance().getBody(getElement());
|
||||||
|
|
||||||
|
|
||||||
|
barElement.getStyle().setFloat(com.google.gwt.dom.client.Style.Float.RIGHT);
|
||||||
|
bodyElement.getStyle().setFloat(com.google.gwt.dom.client.Style.Float.LEFT);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
addStyleName(ThemeStyles.get().style().);
|
||||||
|
|
||||||
|
getElement().getStyle().setFloat(Float.R);setBackgroundColor("white");
|
||||||
|
|
||||||
|
.x-tab {
|
||||||
|
position:initial !important;
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void create() {
|
||||||
|
TabItemConfig gridItemConf = new TabItemConfig("Grid", false);
|
||||||
|
|
||||||
|
gridPanel = new TDXGridPanel(eventBus);
|
||||||
|
|
||||||
|
add(gridPanel, gridItemConf);
|
||||||
|
|
||||||
|
TabItemConfig resourcesItemConf = new TabItemConfig("Resources", false);
|
||||||
|
|
||||||
|
resourcesPanel = new ResourcesListViewPanel(eventBus);
|
||||||
|
|
||||||
|
add(resourcesPanel, resourcesItemConf);
|
||||||
|
|
||||||
|
setActiveWidget(gridPanel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void open(TabularResourceDataView dataView) {
|
||||||
|
gridPanel.open(dataView);
|
||||||
|
resourcesPanel.open(dataView.getTrId());
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(TabularResourceDataView dataView) {
|
||||||
|
gridPanel.update(dataView);
|
||||||
|
resourcesPanel.open(dataView.getTrId());
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValidDataViewRequest(
|
||||||
|
TabularResourceDataView dataViewRequest) {
|
||||||
|
return gridPanel.isValidDataViewRequest(dataViewRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TabularDataX getTabularData() {
|
||||||
|
return gridPanel.getTabularData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public TabularResourceDataView getTabularResourceDataView() {
|
||||||
|
return gridPanel.getTabularResourceDataView();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package org.gcube.portlets.user.td.mainboxwidget.client.tdx;
|
||||||
|
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.dataview.TabularResourceDataView;
|
||||||
|
|
||||||
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
|
import com.sencha.gxt.widget.core.client.Window;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||||
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete Column Dialog
|
||||||
|
*
|
||||||
|
* @author "Giancarlo Panichi" <a
|
||||||
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TDXTabPanelDialog extends Window {
|
||||||
|
private static final String WIDTH = "640px";
|
||||||
|
private static final String HEIGHT = "480px";
|
||||||
|
private TDXPanel tdxPanel;
|
||||||
|
|
||||||
|
|
||||||
|
public TDXTabPanelDialog(EventBus eventBus) {
|
||||||
|
initWindow();
|
||||||
|
tdxPanel=new TDXPanel(eventBus);
|
||||||
|
add(tdxPanel);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initWindow() {
|
||||||
|
setWidth(WIDTH);
|
||||||
|
setHeight(HEIGHT);
|
||||||
|
setBodyBorder(false);
|
||||||
|
setResizable(false);
|
||||||
|
setHeadingText("TDXPanel Test");
|
||||||
|
// getHeader().setIcon(Resources.IMAGES.side_list());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void open(TRId trId){;
|
||||||
|
TabularResourceDataView trDV=new TabularResourceDataView(trId);
|
||||||
|
tdxPanel.open(trDV);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void initTools() {
|
||||||
|
super.initTools();
|
||||||
|
|
||||||
|
closeBtn.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
|
public void onSelect(SelectEvent event) {
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void close() {
|
||||||
|
hide();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -14,11 +14,13 @@
|
||||||
<inherits name='com.google.gwt.junit.JUnit' />
|
<inherits name='com.google.gwt.junit.JUnit' />
|
||||||
|
|
||||||
|
|
||||||
<inherits name="org.gcube.portlets.user.tdwx.TabularDataWidgetX" />
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
|
name='org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEvent' />
|
||||||
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
<inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' />
|
||||||
|
<inherits name='org.gcube.portlets.user.td.wizardwidget.Wizard' />
|
||||||
|
<inherits name="org.gcube.portlets.user.tdwx.TabularDataWidgetX" />
|
||||||
|
<inherits name='org.gcube.portlets.user.td.resourceswidget.ResourcesWidget' />
|
||||||
|
|
||||||
|
|
||||||
<!-- <inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD'
|
<!-- <inherits name='org.gcube.portlets.user.td.monitorwidget.MonitorWidgetTD'
|
||||||
/> -->
|
/> -->
|
||||||
|
|
Loading…
Reference in New Issue