use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class ChangeUserAccessResponse method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("user")) {
JsonElement jsonUser = jsonObject.get("user");
if (jsonUser != null) {
user = new User();
user.fromJson(jsonUser.getAsJsonObject());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class ChangeUserDetailsRequest method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("user")) {
JsonElement jsonUser = jsonObject.get("user");
if (jsonUser != null) {
user = new User();
user.fromJson(jsonUser.getAsJsonObject());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class GetUsersRequest method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("pager")) {
JsonElement jsonPager = jsonObject.get("pager");
if (jsonPager != null) {
pager = new Pager();
pager.fromJson(jsonPager.getAsJsonObject());
}
}
if (jsonObject.has("query")) {
JsonElement jsonQuery = jsonObject.get("query");
if (jsonQuery != null) {
query = jsonQuery.getAsString();
}
}
if (jsonObject.has("user")) {
JsonElement jsonUser = jsonObject.get("user");
if (jsonUser != null) {
user = new User();
user.fromJson(jsonUser.getAsJsonObject());
}
}
if (jsonObject.has("relationshipType")) {
JsonElement jsonRelationshipType = jsonObject.get("relationshipType");
if (jsonRelationshipType != null) {
relationshipType = RelationshipTypeType.fromString(jsonRelationshipType.getAsString());
}
}
if (jsonObject.has("userIsOther")) {
JsonElement jsonUserIsOther = jsonObject.get("userIsOther");
if (jsonUserIsOther != null) {
userIsOther = Boolean.valueOf(jsonUserIsOther.getAsBoolean());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class RegisterUserResponse method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("user")) {
JsonElement jsonUser = jsonObject.get("user");
if (jsonUser != null) {
user = new User();
user.fromJson(jsonUser.getAsJsonObject());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class ChangeDetailsPage method onAttach.
/* (non-Javadoc)
*
* @see com.google.gwt.user.client.ui.Composite#onAttach() */
@Override
protected void onAttach() {
super.onAttach();
AccountTabsPart.get().removeFromParent();
register(DefaultEventBus.get().addHandlerToSource(NavigationChangedEventHandler.TYPE, NavigationController.get(), (p, c) -> {
reset();
boolean addTabs = true;
if (PageType.ChangeDetailsPageType.equals(c.getPage())) {
if (c.getAction() == null) {
show(user = SessionController.get().user());
lnkChangePassword.setTargetHistoryToken(PageType.ChangePasswordPageType.asTargetHistoryToken());
AccountTabsPart.get().setUser(null);
lnkChangePassword.setVisible(true);
pnlPassword.setVisible(false);
} else if ("id".equals(c.getAction()) && c.getParameterCount() > 0) {
Long id = Long.valueOf(c.getParameter(0));
User user = new User();
user.id(id);
AccountTabsPart.get().setUser(user);
UserController.get().getUser(user);
lnkChangePassword.setVisible(false);
pnlPassword.setVisible(false);
} else if ("new".equals(c.getAction())) {
elDates.setInnerText("Enter user details");
lnkChangePassword.setVisible(false);
pnlPassword.setVisible(true);
if (SessionController.get().isAdmin()) {
actionText = CREATE_ACTION_TEXT;
}
addTabs = false;
}
} else if (PageType.RegisterPageType.equals(c.getPage())) {
elDates.setInnerText("Enter user details");
lnkChangePassword.setVisible(false);
pnlPassword.setVisible(true);
actionText = REGISTER_ACTION_TEXT;
addTabs = false;
}
elHeading.setInnerText(getHeadingText());
elGravatar.setInnerSafeHtml(getGravatarSafeHtml());
if (addTabs) {
pnlTabs.add(AccountTabsPart.get());
AccountTabsPart.get().navigationChanged(p, c);
} else {
AccountTabsPart.get().removeFromParent();
}
ready();
refreshTitle();
}));
register(DefaultEventBus.get().addHandlerToSource(GetUserDetailsEventHandler.TYPE, UserController.get(), this));
register(DefaultEventBus.get().addHandlerToSource(ChangeUserDetailsEventHandler.TYPE, UserController.get(), this));
register(DefaultEventBus.get().addHandlerToSource(GetEmailAvatarEventHandler.TYPE, UserController.get(), this));
register(DefaultEventBus.get().addHandlerToSource(RegisterUserEventHandler.TYPE, UserController.get(), this));
}
Aggregations