Add status bar to views
(MGNLUI-75)
|
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | design |
| Affects Version/s: | None |
| Fix Version/s: | 5.0 |
| Type: | Sub-task | Priority: | Neutral |
| Reporter: | Mikaël Geljić | Assignee: | Mikaël Geljić |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | statusbar | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Date of First Response: | |
| Sprint: | Iteration 2013-13, Iteration 2013-14, Iteration 2013-15, Iteration 2013-16, Iteration 2013-17 |
| Description |
|
As specified in concept http://wiki.magnolia-cms.com/display/DEV/Concept+-+Status+bar+in+subapps
|
| Comments |
| Comment by Daniel Lipp [ 17/Apr/13 ] |
|
StatusBarViewImpl would be more DRY when combining addComponent with getFirstAvailableRightIndex and getFirstAvailableLeftIndex to something like:
public void addComponent(Component c, Alignment align) {
int index = 0;
Iterator<Component> it = getComponentIterator();
while (it.hasNext()) {
Alignment nextAlignment = getComponentAlignment(it.next());
if (align.isLeft() ? nextAlignment.isLeft() : nextAlignment.isRight()) {
index++;
}
}
addComponent(c, index);
setComponentAlignment(c, align);
}
A UnitTest would be handy to verify refactoring doesn't break anything. |
| Comment by Mikaël Geljić [ 17/Apr/13 ] |
|
#addComponent(Component, Alignment) is specified in the concept such that first added is first aligned. For right-aligned components, that means we stack components starting from the right. Concretely though, in the end it extends the HorizontalLayout so it's just one series of indices, and we have to insert components at the right position in that series. For left alignment: we iterate as long as next component is left-aligned. New insertion position is after last left-aligned component. (LTR) I actually have the test already and that was omitted in the commit, so it's easy to test the proposal but I doubt it works, when these two methods make it more legible. Then I will at least add javadoc in impl to give those missing details. |
| Comment by Daniel Lipp [ 18/Apr/13 ] |
|
I like the new imp |