use of com.google.gwt.resources.client.ResourceCallback in project domino-ui-demo by DominoKit.
the class ProfileViewImpl method init.
@Override
protected HTMLDivElement init() {
profile = Card.createProfile("Vegegoku", "vegegoku@bo3.com");
profile.style().addCss("profile-card").addCss("classy-card").addCss("bg-theme");
profile.setHeaderBackground(Color.TRANSPARENT);
profile.setBodyBackground(Color.TRANSPARENT);
profile.getHeader().style().removeCss("bg-theme");
profile.setBodyPadding("10px");
profile.getBody().styler(style -> style.removeCss("bg-theme"));
profile.getHeaderTitle().setAttribute("id", "demo-profile");
profile.appendChild(Elements.img(GWT.getModuleBaseURL() + "/images/user.png").style("border-radius:50%;"));
HeaderAction headerAction = HeaderAction.create(Icons.ALL.more_vert().clickable());
DropDownMenu dropDownMenu = DropDownMenu.create(headerAction).setPosition(DropDownPosition.BOTTOM).appendChild(DropdownAction.create("Action 1").addSelectionHandler(value -> Notification.createInfo(value).show())).appendChild(DropdownAction.create("Action 2").addSelectionHandler(value -> Notification.createInfo(value).show()));
headerAction.addClickListener(evt -> {
dropDownMenu.open();
evt.stopPropagation();
});
profile.addHeaderAction(headerAction);
Style.of(profile).setHeight("186px");
profile.element().appendChild(div().css("bg-classy").element());
try {
CodeResource.INSTANCE.build().getText(new ResourceCallback<TextResource>() {
@Override
public void onError(ResourceException e) {
DomGlobal.console.error("failed ", e);
}
@Override
public void onSuccess(TextResource resource) {
profile.getHeaderTitle().appendChild(small().textContent(resource.getText()).element());
DomGlobal.console.info(resource.getText());
}
});
} catch (Exception e) {
DomGlobal.console.error("Failed to load build time : ", e);
}
return profile.element();
}
Aggregations