Fixed Tab Name update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-mainbox-widget@100792 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-17 16:41:00 +00:00 committed by Giancarlo Panichi
parent 5245f0d7c9
commit a6b40e33ee
3 changed files with 76 additions and 8 deletions

View File

@ -62,3 +62,35 @@ Compiling...
Compilation completed in 0.00 seconds Compilation completed in 0.00 seconds
Removing invalidated units Removing invalidated units
Finding entry point classes Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
40% complete (ETR: 8 seconds)
40% complete (ETR: 8 seconds)
40% complete (ETR: 7 seconds)
50% complete (ETR: 6 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 19.61 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -175,6 +175,36 @@ public class MainBox extends TabPanel {
forceLayout(); forceLayout();
} }
//
public void updateTabName(DataView dataView) {
if (dataView instanceof TabularResourceDataView) {
TabularResourceDataView tabularResourceDataView = (TabularResourceDataView) dataView;
if (tabularResourceDataView.getTabName() != null
&& !tabularResourceDataView.getTabName().isEmpty()) {
if (tdxPanelList != null) {
TDXPanel tdxPanelFound = null;
for (TDXPanel tdxPanel : tdxPanelList) {
if (tdxPanel
.isValidDataViewRequest(tabularResourceDataView)) {
tdxPanelFound = tdxPanel;
break;
}
}
if (tdxPanelFound != null) {
TabItemConfig tdxPanelItemConf = getConfig(tdxPanelFound);
tdxPanelItemConf.setText(tabularResourceDataView
.getTabName());
update(tdxPanelFound, tdxPanelItemConf);
forceLayout();
}
}
}
}
}
// //
public void updateTabs(DataView dataView) { public void updateTabs(DataView dataView) {
@ -223,14 +253,17 @@ public class MainBox extends TabPanel {
protected void addContentTDXPanel( protected void addContentTDXPanel(
TabularResourceDataView tabularResourceDataView, TabularResourceDataView tabularResourceDataView,
TabResource tabResource) { TabResource tabResource) {
/*TabItemConfig tdxPanelItemConf = new TabItemConfig(); /*
tdxPanelItemConf.setClosable(true); * TabItemConfig tdxPanelItemConf = new TabItemConfig();
SafeHtmlBuilder safeHtmlBuilder = new SafeHtmlBuilder(); * tdxPanelItemConf.setClosable(true); SafeHtmlBuilder safeHtmlBuilder =
safeHtmlBuilder.appendHtmlConstant("<span title='") * new SafeHtmlBuilder();
.appendEscaped(tabResource.getName()).appendHtmlConstant("'>") * safeHtmlBuilder.appendHtmlConstant("<span title='")
.appendEscaped(tabResource.getName()).appendHtmlConstant("</span>"); * .appendEscaped(tabResource.getName()).appendHtmlConstant("'>")
tdxPanelItemConf.setHTML(safeHtmlBuilder.toSafeHtml());*/ * .appendEscaped(tabResource.getName()).appendHtmlConstant("</span>");
TabItemConfig tdxPanelItemConf=new TabItemConfig(tabResource.getName(), true); * tdxPanelItemConf.setHTML(safeHtmlBuilder.toSafeHtml());
*/
TabItemConfig tdxPanelItemConf = new TabItemConfig(
tabResource.getName(), 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);

View File

@ -142,6 +142,9 @@ public class MainBoxPanel extends ContentPanel {
Log.debug("MainBoxPanel No tabular resource open"); Log.debug("MainBoxPanel No tabular resource open");
} }
break; break;
case UPDATE_TAB_NAME:
mainBox.updateTabName(event.getDataView());
break;
default: default:
break; break;