Fixed another wrong label

git-svn-id: https://svn.libreccm.org/ccm/trunk@2880 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-09-26 10:15:50 +00:00
parent 33a0ee169b
commit 18c47d2f9f
1 changed files with 71 additions and 68 deletions

View File

@ -18,6 +18,7 @@
*/ */
package com.arsdigita.cms.contenttypes.ui; package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.Completable;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.ControlLink; import com.arsdigita.bebop.ControlLink;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
@ -63,7 +64,8 @@ public class PublicationSeriesTable
super(); super();
m_itemModel = itemModel; m_itemModel = itemModel;
setEmptyView(new Label(PublicationGlobalizationUtil.globalize("publications.ui.series.none"))); setEmptyView(
new Label(PublicationGlobalizationUtil.globalize("publications.ui.series.none")));
final TableColumnModel colModel = getColumnModel(); final TableColumnModel colModel = getColumnModel();
colModel.add(new TableColumn( colModel.add(new TableColumn(
@ -181,8 +183,7 @@ public class PublicationSeriesTable
Object key, Object key,
int row, int row,
int col) { int col) {
SecurityManager securityManager = SecurityManager securityManager = Utilities.getSecurityManager(state);
Utilities.getSecurityManager(state);
Publication publication = (Publication) m_itemModel. Publication publication = (Publication) m_itemModel.
getSelectedObject(state); getSelectedObject(state);
@ -204,8 +205,7 @@ public class PublicationSeriesTable
ContentSection section = series.getContentSection();//CMS.getContext().getContentSection(); ContentSection section = series.getContentSection();//CMS.getContext().getContentSection();
ItemResolver resolver = section.getItemResolver(); ItemResolver resolver = section.getItemResolver();
Link link = Link link = new Link(String.format("%s (%s)",
new Link(String.format("%s (%s)",
value.toString(), value.toString(),
series.getLanguage()), series.getLanguage()),
resolver.generateItemURL(state, resolver.generateItemURL(state,
@ -231,6 +231,7 @@ public class PublicationSeriesTable
return label; return label;
} }
} }
} }
private class NumberCellRenderer extends LockableImpl implements TableCellRenderer { private class NumberCellRenderer extends LockableImpl implements TableCellRenderer {
@ -249,7 +250,7 @@ public class PublicationSeriesTable
final SeriesCollection seriesCol = publication.getSeries(); final SeriesCollection seriesCol = publication.getSeries();
String volumeOfSeries = null; String volumeOfSeries = null;
while(seriesCol.next()) { while (seriesCol.next()) {
if (seriesId.equals(seriesCol.getSeries().getID())) { if (seriesId.equals(seriesCol.getSeries().getID())) {
volumeOfSeries = seriesCol.getVolumeOfSeries(); volumeOfSeries = seriesCol.getVolumeOfSeries();
break; break;
@ -278,8 +279,7 @@ public class PublicationSeriesTable
Object key, Object key,
int row, int row,
int col) { int col) {
SecurityManager securityManager = SecurityManager securityManager = Utilities.getSecurityManager(state);
Utilities.getSecurityManager(state);
Publication publication = (Publication) m_itemModel. Publication publication = (Publication) m_itemModel.
getSelectedObject(state); getSelectedObject(state);
@ -294,10 +294,14 @@ public class PublicationSeriesTable
"publications.ui.series.confirm_remove")); "publications.ui.series.confirm_remove"));
return link; return link;
} else { } else {
Label label = new Label(value.toString()); if (value instanceof Component) {
return (Component) value;
} else {
final Label label = new Label(value.toString());
return label; return label;
} }
} }
}
} }
@ -307,8 +311,7 @@ public class PublicationSeriesTable
LOGGER.info("cellSelected!"); LOGGER.info("cellSelected!");
Series series = Series series = new Series(new BigDecimal(event.getRowKey().
new Series(new BigDecimal(event.getRowKey().
toString())); toString()));
Publication publication = (Publication) m_itemModel.getSelectedObject( Publication publication = (Publication) m_itemModel.getSelectedObject(