mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
use new open/close buttons and put them to the right of the header cell
This commit is contained in:
1 parent
55109d76aa
commit
b719858f88
4 files changed
+20
-20
No files matched your search
+1
-1
@@ -28,7 +28,7 @@ public class ExpandCollapseButtonCell extends AbstractCell<SafeHtml> {
|
||||
this.column = column;
|
||||
this.delegate = delegate;
|
||||
this.html = new SafeHtmlBuilder().appendHtmlConstant(
|
||||
"<input class=\"valignMiddle\" type=\"image\" src=\"/images/"+(column.isExpanded()?"minus":"plus")+".png\" />").toSafeHtml();
|
||||
"<input class=\"valignMiddle\" type=\"image\" src=\"/images/"+(column.isExpanded()?"close":"open")+".png\" />").toSafeHtml();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+19
-19
@@ -48,25 +48,6 @@ public class SortableExpandableColumnHeader extends Header<SafeHtml> {
|
||||
private static <T> Cell<SafeHtml> constructCell(final String title, final String iconURL, boolean isExpansionEnabled,
|
||||
final LeaderboardPanel leaderboardPanel, final ExpandableSortableColumn<?> column, final StringConstants stringConstants) {
|
||||
final List<HasCell<SafeHtml, ?>> cells = new ArrayList<HasCell<SafeHtml, ?>>(3);
|
||||
// add the cell rendering the expand/collapse button:
|
||||
if (isExpansionEnabled) {
|
||||
cells.add(new HasCell<SafeHtml, SafeHtml>() {
|
||||
@Override
|
||||
public Cell<SafeHtml> getCell() {
|
||||
return new ExpandCollapseButtonCell(column, new ExpandCollapseButtonAction(column));
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldUpdater<SafeHtml, SafeHtml> getFieldUpdater() {
|
||||
return null; // no updates possible in a header cell
|
||||
}
|
||||
|
||||
@Override
|
||||
public SafeHtml getValue(SafeHtml object) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
// if it's a medal race, add the cell rendering the medal image
|
||||
if (iconURL != null) {
|
||||
cells.add(new HasCell<SafeHtml, String>() {
|
||||
@@ -101,6 +82,25 @@ public class SortableExpandableColumnHeader extends Header<SafeHtml> {
|
||||
return new SafeHtmlBuilder().appendHtmlConstant(" ").appendEscaped(title).toSafeHtml();
|
||||
}
|
||||
});
|
||||
// add the cell rendering the expand/collapse button:
|
||||
if (isExpansionEnabled) {
|
||||
cells.add(new HasCell<SafeHtml, SafeHtml>() {
|
||||
@Override
|
||||
public Cell<SafeHtml> getCell() {
|
||||
return new ExpandCollapseButtonCell(column, new ExpandCollapseButtonAction(column));
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldUpdater<SafeHtml, SafeHtml> getFieldUpdater() {
|
||||
return null; // no updates possible in a header cell
|
||||
}
|
||||
|
||||
@Override
|
||||
public SafeHtml getValue(SafeHtml object) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
return new CompositeCell<SafeHtml>(cells) {
|
||||
/**
|
||||
* Redefining this method because when a table column is sorted, GWT wraps a div element
|
||||
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in new issue
Block a user