Skip to content
Snippets Groups Projects
Commit 196b5313 authored by buczekp's avatar buczekp
Browse files

minor: change separator in breadcrumbs to >>, add it to dictionary for easy modifications

SVN: 21662
parent bf0b0579
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,8 @@ public abstract class Dict ...@@ -78,6 +78,8 @@ public abstract class Dict
public static final String ENTITY_OPERATIONS = "entity_operations"; public static final String ENTITY_OPERATIONS = "entity_operations";
public static final String BREADCRUMBS_SEPARATOR = "breadcrumbs_separator";
// //
// Table Modifications // Table Modifications
// //
......
...@@ -113,7 +113,7 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends ...@@ -113,7 +113,7 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends
toolBar = new ToolBar(); toolBar = new ToolBar();
setTopComponent(toolBar); setTopComponent(toolBar);
titleLabel = new LabelToolItem(title); titleLabel = new LabelToolItem(title);
toolBar.add(breadcrumbContainer = new BreadcrumbContainer()); toolBar.add(breadcrumbContainer = new BreadcrumbContainer(viewContext));
toolBar.add(new FillToolItem()); toolBar.add(new FillToolItem());
if (viewContext.isSimpleOrEmbeddedMode() == false) if (viewContext.isSimpleOrEmbeddedMode() == false)
{ {
...@@ -230,16 +230,9 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends ...@@ -230,16 +230,9 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends
breadcrumbContainer.removeAll(); breadcrumbContainer.removeAll();
List<Widget> widgets = new ArrayList<Widget>(); List<Widget> widgets = new ArrayList<Widget>();
fillBreadcrumbWidgets(widgets); fillBreadcrumbWidgets(widgets);
if (widgets.size() == 1) for (Widget widget : widgets)
{ {
// add raw widget without separator if there is just one widget breadcrumbContainer.addBreadcrumb(widget);
breadcrumbContainer.addWidget(widgets.get(0));
} else
{
for (Widget widget : widgets)
{
breadcrumbContainer.addBreadcrumb(widget);
}
} }
breadcrumbContainer.layout(); breadcrumbContainer.layout();
syncSize(); // fixes layout problems in simple view mode syncSize(); // fixes layout problems in simple view mode
...@@ -376,10 +369,11 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends ...@@ -376,10 +369,11 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends
private static class BreadcrumbContainer extends LayoutContainer private static class BreadcrumbContainer extends LayoutContainer
{ {
private final static String SEPARATOR = "/"; private final String separator;
public BreadcrumbContainer() public BreadcrumbContainer(IMessageProvider messageProvider)
{ {
this.separator = messageProvider.getMessage(Dict.BREADCRUMBS_SEPARATOR);
setLayout(createLayout()); setLayout(createLayout());
} }
...@@ -392,16 +386,16 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends ...@@ -392,16 +386,16 @@ public abstract class AbstractViewer<D extends IEntityInformationHolder> extends
return tableRowLayout; return tableRowLayout;
} }
/** adds the <var>widget</var> with a separator prefix to breadcrumbs */ /**
* Adds the <var>widget</var> to breadcrumbs. For every widget but the first one a separator
* will be added before the widget.
*/
public void addBreadcrumb(Widget widget) public void addBreadcrumb(Widget widget)
{ {
add(new Html(SEPARATOR)); if (getItemCount() > 0)
addWidget(widget); {
} add(new Html(separator));
}
/** adds the <var>widget</var> to breadcrumbs (without separator prefix) */
public void addWidget(Widget widget)
{
add(widget); add(widget);
} }
......
...@@ -57,8 +57,9 @@ var common = { ...@@ -57,8 +57,9 @@ var common = {
auto_resolve_label: "Smart View", auto_resolve_label: "Smart View",
data_report_label: "Report:", data_report_label: "Report:",
explore_label: "Explore:", explore_label: "Explore:",
add_unofficial_vocabulary_term_dialog_title: "Add Ad Hoc Term", add_unofficial_vocabulary_term_dialog_title: "Add Ad Hoc Term",
breadcrumbs_separator: "»",
// //
// Table Modifications // Table Modifications
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment