50 lines
1.5 KiB
Java
50 lines
1.5 KiB
Java
package org.gcube.portlets.user.geoportaldataviewer.client.ui.products;
|
|
|
|
import org.gcube.portlets.user.geoportaldataviewer.client.ui.util.CustomFlexTable;
|
|
import org.gcube.portlets.user.geoportaldataviewer.shared.products.model.RecordDV;
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
import com.google.gwt.uibinder.client.UiBinder;
|
|
import com.google.gwt.uibinder.client.UiField;
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
import com.google.gwt.user.client.ui.FlowPanel;
|
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
|
|
public class RecordView extends Composite {
|
|
|
|
private static RecordViewUiBinder uiBinder = GWT.create(RecordViewUiBinder.class);
|
|
|
|
interface RecordViewUiBinder extends UiBinder<Widget, RecordView> {
|
|
}
|
|
|
|
@UiField
|
|
HTMLPanel recordDVPanel;
|
|
|
|
private CustomFlexTable customTable = new CustomFlexTable();
|
|
|
|
public RecordView() {
|
|
initWidget(uiBinder.createAndBindUi(this));
|
|
}
|
|
|
|
public RecordView(RecordDV record) {
|
|
initWidget(uiBinder.createAndBindUi(this));
|
|
|
|
customTable.addNextKeyValue("Created", record.getCreationTime());
|
|
customTable.addNextKeyValue("Last Updated", record.getLastUpdateTime());
|
|
customTable.addNextKeyValue("Updated by", record.getLastUpdateUser());
|
|
recordDVPanel.add(customTable);
|
|
}
|
|
|
|
public void addLabel(FlowPanel w, String labelValue){
|
|
com.google.gwt.user.client.ui.Label label = new com.google.gwt.user.client.ui.Label(labelValue);
|
|
label.getElement().getStyle().setMarginRight(5, Unit.PX);
|
|
w.add(label);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|