Skip to content

Commit 6b44dfe

Browse files
committed
WIP- new UI for AsyncTableCell
1 parent 5e57dba commit 6b44dfe

File tree

11 files changed

+380
-92
lines changed

11 files changed

+380
-92
lines changed

roda-ui/roda-wui/src/main/java/config/i18n/client/ClientMessages.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,10 @@ SafeHtml representationInformationAssociatedWithDescription(String field, String
19531953

19541954
String dateRangeFieldTo();
19551955

1956+
String genericRangeFieldFrom();
1957+
1958+
String genericRangeFieldTo();
1959+
19561960
String inputStorageSizeList();
19571961

19581962
String removableTextBox();

roda-ui/roda-wui/src/main/java/org/roda/wui/client/common/lists/utils/AsyncTableCell.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ protected void fireChangeEvent(IndexResult<T> result) {
238238

239239
dataProvider.addDataDisplay(display);
240240

241-
resultsPager = new AccessibleSimplePager(AccessibleSimplePager.TextLocation.LEFT,
241+
resultsPager = new AccessibleSimplePager(AccessibleSimplePager.TextLocation.CENTER,
242242
GWT.create(SimplePager.Resources.class), false, initialPageSize, false, false,
243243
GWT.create(SimplePager.ImageButtonsConstants.class));
244244
resultsPager.setDisplay(display);
@@ -247,7 +247,7 @@ protected void fireChangeEvent(IndexResult<T> result) {
247247
pageSizePager.setDisplay(display);
248248

249249
Button csvDownloadButton = new Button(messages.tableDownloadCSV());
250-
csvDownloadButton.addStyleName("btn btn-link csvDownloadButton");
250+
csvDownloadButton.addStyleName("btn btn-link btn-download csvDownloadButton");
251251
csvDownloadButton.setVisible(options.isCsvDownloadButtonVisibility());
252252

253253
sidePanel = new FlowPanel();
@@ -1082,19 +1082,24 @@ private boolean createAndBindFacets(FlowPanel facetsPanel) {
10821082
boolean facetIsSelected = facetResult.getSelectedValues().contains(value);
10831083
StringBuilder checkboxLabel = new StringBuilder();
10841084
checkboxLabel.append(label);
1085-
if (count > 0 || facetResult.getSelectedValues().isEmpty() || facetIsSelected) {
1086-
checkboxLabel.append(" (").append(count).append(")");
1087-
}
10881085

10891086
CheckBox facetValuePanel = new CheckBox(checkboxLabel.toString());
10901087
facetValuePanel.setTitle(checkboxLabel.toString());
1091-
facetValuePanel.addStyleName("sidebar-facet-label");
1092-
facetValuePanel.addStyleName("fade-out");
1088+
facetValuePanel.addStyleName("sidebar-facet-label fade-out");
1089+
1090+
FlowPanel facetValueRow = new FlowPanel();
1091+
facetValueRow.addStyleName("sidebar-facet-row");
1092+
facetValueRow.add(facetValuePanel);
1093+
if (count > 0 || facetResult.getSelectedValues().isEmpty() || facetIsSelected) {
1094+
Label countLabel = new Label(String.valueOf(count));
1095+
countLabel.addStyleName("sidebar-facet-count");
1096+
facetValueRow.add(countLabel);
1097+
}
10931098

10941099
boolean enabled = count > 0 || !facetResult.getSelectedValues().isEmpty();
10951100
facetValuePanel.setEnabled(enabled);
10961101

1097-
facetPanel.add(facetValuePanel);
1102+
facetPanel.add(facetValueRow);
10981103
facetValuePanel.setValue(facetIsSelected);
10991104

11001105
facetValuePanel.addValueChangeHandler(facetValueChangedEvent -> {
@@ -1246,6 +1251,10 @@ protected void onAttach() {
12461251
}
12471252
}
12481253

1254+
public FlowPanel getSidePanel() {
1255+
return this.sidePanel;
1256+
}
1257+
12491258
enum AutoUpdateState {
12501259
AUTO_UPDATE_OFF, AUTO_UPDATE_ON, AUTO_UPDATE_ERROR, AUTO_UPDATE_PAUSED, AUTO_UPDATE_WORKING
12511260
}

roda-ui/roda-wui/src/main/java/org/roda/wui/client/common/lists/utils/AsyncTableCellOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.util.Collections;
1212
import java.util.List;
1313

14+
import com.google.gwt.user.client.ui.FlowPanel;
1415
import org.roda.core.data.common.RodaConstants;
1516
import org.roda.core.data.v2.index.IndexResult;
1617
import org.roda.core.data.v2.index.IsIndexed;
@@ -19,14 +20,15 @@
1920
import org.roda.wui.client.common.actions.Actionable;
2021
import org.roda.wui.client.common.search.SearchFilters;
2122
import org.roda.wui.common.client.tools.ConfigurationManager;
23+
import org.roda.wui.common.client.tools.ConfigurationManager.ColumnOptionsFactory;
24+
import org.roda.wui.common.client.tools.ConfigurationManager.FacetFactory;
2225

2326
import com.google.gwt.event.logical.shared.ValueChangeHandler;
2427
import com.google.gwt.user.cellview.client.AbstractHasData.RedrawEvent;
2528
import com.google.gwt.user.client.rpc.AsyncCallback;
2629
import com.google.gwt.user.client.ui.DialogBox;
30+
import com.google.gwt.user.client.ui.SimplePanel;
2731
import com.google.gwt.view.client.SelectionChangeEvent;
28-
import org.roda.wui.common.client.tools.ConfigurationManager.ColumnOptionsFactory;
29-
import org.roda.wui.common.client.tools.ConfigurationManager.FacetFactory;
3032

3133
public class AsyncTableCellOptions<T extends IsIndexed> {
3234
private final Class<T> classToReturn;

0 commit comments

Comments
 (0)