use of com.google.gwt.i18n.client.DateTimeFormat in project pentaho-platform by pentaho.
the class GeneralPanel method init.
/**
*/
public void init() {
nameLabel.setText(fileSummary.getTitle());
typeLabel.setText(fileSummary.isFolder() ? Messages.getString("folder") : // $NON-NLS-1$//$NON-NLS-2$
fileSummary.getName().substring(fileSummary.getName().lastIndexOf(".")));
// $NON-NLS-1$//$NON-NLS-2$
sourceLabel.setText(isInTrash ? Messages.getString("recycleBin") : fileSummary.getPath());
locationLabel.setText(isInTrash ? Messages.getString("recycleBin") : // $NON-NLS-1$//$NON-NLS-2$
fileSummary.getPath().substring(0, fileSummary.getPath().lastIndexOf("/")));
sizeLabel.setText(NumberFormat.getDecimalFormat().format(fileSummary.getFileSize() / 1000.00) + " " + // $NON-NLS-1$ //$NON-NLS-2$\
Messages.getString("kiloBytes"));
DateTimeFormat df = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_FULL);
createdLabel.setText(df.format(fileSummary.getCreatedDate()));
lastModifiedDateLabel.setText(fileSummary.getLastModifiedDate() == null ? df.format(fileSummary.getCreatedDate()) : df.format(fileSummary.getLastModifiedDate()));
// $NON-NLS-1$
deletedDateLabel.setText(fileSummary.getDeletedDate() == null ? "" : fileSummary.getDeletedDate().toString());
originalLocationLabel.setText(fileSummary.getOriginalParentFolderPath());
}
use of com.google.gwt.i18n.client.DateTimeFormat in project ovirt-engine by oVirt.
the class MainSessionView method initTable.
void initTable() {
getTable().enableColumnResizing();
AbstractTextColumn<UserSession> sessionDbIdColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return Long.toString(session.getId());
}
};
sessionDbIdColumn.makeSortable(SessionConditionFieldAutoCompleter.SESSION_DB_ID);
// $NON-NLS-1$
getTable().addColumn(sessionDbIdColumn, constants.sessionDbId(), "100px");
AbstractTextColumn<UserSession> userNameColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getUserName();
}
};
userNameColumn.makeSortable(SessionConditionFieldAutoCompleter.USER_NAME);
// $NON-NLS-1$
getTable().addColumn(userNameColumn, constants.userNameUser(), "200px");
AbstractTextColumn<UserSession> authzNameColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getAuthzName();
}
};
authzNameColumn.makeSortable(SessionConditionFieldAutoCompleter.AUTHZ_NAME);
// $NON-NLS-1$
getTable().addColumn(authzNameColumn, constants.authorizationProvider(), "300px");
AbstractTextColumn<UserSession> userIdColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getUserId().toString();
}
};
userIdColumn.makeSortable(SessionConditionFieldAutoCompleter.USER_ID);
// $NON-NLS-1$
getTable().addColumn(userIdColumn, constants.userId(), "200px");
AbstractTextColumn<UserSession> sourceIpColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getSourceIp();
}
};
sourceIpColumn.makeSortable(SessionConditionFieldAutoCompleter.SOURCE_IP);
// $NON-NLS-1$
getTable().addColumn(sourceIpColumn, constants.sourceIp(), "200px");
final DateTimeFormat dateFormat = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM);
AbstractTextColumn<UserSession> sessionStartColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getSessionStartTime() == null ? // $NON-NLS-1$
"" : dateFormat.format(session.getSessionStartTime());
}
};
sessionStartColumn.makeSortable(Comparator.comparing(UserSession::getSessionStartTime));
// $NON-NLS-1$
getTable().addColumn(sessionStartColumn, constants.sessionStartTime(), "200px");
AbstractTextColumn<UserSession> sessionLastActiveColumn = new AbstractTextColumn<UserSession>() {
@Override
public String getValue(UserSession session) {
return session.getSessionLastActiveTime() == null ? // $NON-NLS-1$
"" : dateFormat.format(session.getSessionLastActiveTime());
}
};
sessionLastActiveColumn.makeSortable(Comparator.comparing(UserSession::getSessionLastActiveTime));
// $NON-NLS-1$
getTable().addColumn(sessionLastActiveColumn, constants.sessionLastActiveTime(), "200px");
}
Aggregations