Fixed error when tabular resource has not name
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-mainbox-widget@111408 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4abf4f5613
commit
8957f19d4c
|
@ -21,6 +21,8 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||||
|
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||||
|
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
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;
|
||||||
|
@ -213,6 +215,7 @@ public class MainBox extends TabPanel {
|
||||||
|
|
||||||
if (dataView instanceof TabularResourceDataView) {
|
if (dataView instanceof TabularResourceDataView) {
|
||||||
TabularResourceDataView tabularResourceDataView = (TabularResourceDataView) dataView;
|
TabularResourceDataView tabularResourceDataView = (TabularResourceDataView) dataView;
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
|
||||||
for (TDXPanel tdxPanel : tdxPanelList) {
|
for (TDXPanel tdxPanel : tdxPanelList) {
|
||||||
|
@ -226,7 +229,8 @@ public class MainBox extends TabPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
addTDXPanel(tabularResourceDataView);
|
retrieveTRName(tabularResourceDataView);
|
||||||
|
// addTDXPanel(tabularResourceDataView);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -255,9 +259,16 @@ public class MainBox extends TabPanel {
|
||||||
protected void addContentTDXPanel(
|
protected void addContentTDXPanel(
|
||||||
TabularResourceDataView tabularResourceDataView,
|
TabularResourceDataView tabularResourceDataView,
|
||||||
TabResource tabResource) {
|
TabResource tabResource) {
|
||||||
|
SafeHtml nameTR;
|
||||||
|
if(tabResource!=null && (tabResource.getName()==null
|
||||||
|
||tabResource.getName().isEmpty())){
|
||||||
|
nameTR=SafeHtmlUtils.fromString("NoName");
|
||||||
|
} else {
|
||||||
|
nameTR=SafeHtmlUtils.fromString(tabResource.getName());
|
||||||
|
}
|
||||||
|
|
||||||
TabItemConfig tdxPanelItemConf = new TabItemConfig(
|
TabItemConfig tdxPanelItemConf = new TabItemConfig(
|
||||||
tabResource.getName(), true);
|
nameTR.asString(), true);
|
||||||
tdxPanelItemConf.setIcon(MainboxResources.INSTANCE.tabularResource());
|
tdxPanelItemConf.setIcon(MainboxResources.INSTANCE.tabularResource());
|
||||||
final TDXPanel tdxPanel = new TDXPanel(eventBus);
|
final TDXPanel tdxPanel = new TDXPanel(eventBus);
|
||||||
tdxPanel.open(tabularResourceDataView);
|
tdxPanel.open(tabularResourceDataView);
|
||||||
|
@ -367,8 +378,8 @@ public class MainBox extends TabPanel {
|
||||||
Widget active = getActiveWidget();
|
Widget active = getActiveWidget();
|
||||||
if (active instanceof TDXPanel) {
|
if (active instanceof TDXPanel) {
|
||||||
TDXPanel tdxPanel = (TDXPanel) active;
|
TDXPanel tdxPanel = (TDXPanel) active;
|
||||||
columnName = tdxPanel.getTabularData()
|
columnName = tdxPanel.getTabularData().getColumnLocalId(
|
||||||
.getColumnLocalId(columnSelected);
|
columnSelected);
|
||||||
}
|
}
|
||||||
return columnName;
|
return columnName;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue