use of com.google.gerrit.client.rpc.NativeMap in project gerrit by GerritCodeReview.
the class ReplyBox method onLoad.
@Override
protected void onLoad() {
commentsPanel.setVisible(false);
post.setEnabled(false);
if (lc.hasReplyComment()) {
message.setText(lc.getReplyComment());
lc.removeReplyComment();
}
ChangeApi.drafts(psId.getParentKey().get()).get(new AsyncCallback<NativeMap<JsArray<CommentInfo>>>() {
@Override
public void onSuccess(NativeMap<JsArray<CommentInfo>> result) {
displayComments(result);
post.setEnabled(true);
}
@Override
public void onFailure(Throwable caught) {
post.setEnabled(true);
}
});
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
message.setFocus(true);
}
});
Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
@Override
public boolean execute() {
String t = message.getText();
if (t != null) {
message.setCursorPos(t.length());
}
return false;
}
}, 0);
}
Aggregations