本文整理汇总了Java中com.google.gwt.user.client.ui.Image.setResource方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setResource方法的具体用法?Java Image.setResource怎么用?Java Image.setResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Image
的用法示例。
在下文中一共展示了Image.setResource方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GalleryAppBox
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Creates new Gallery app box.
*/
private GalleryAppBox() {
gContainer = new FlowPanel();
final HorizontalPanel container = new HorizontalPanel();
container.setWidth("100%");
container.setSpacing(0);
container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
HorizontalPanel panel = new HorizontalPanel();
Image image = new Image();
image.setResource(Ode.getImageBundle().waitingIcon());
panel.add(image);
Label label = new Label();
label.setText(Ode.getMessages().defaultRpcMessage());
panel.add(label);
gContainer.add(panel);
this.add(gContainer);
}
示例2: populateState
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
protected void populateState(int row, ProjectInfo k) {
Image state = new Image();
switch (k.state()) {
case HIDDEN:
state.setResource(Gerrit.RESOURCES.redNot());
state.setTitle(com.google.gerrit.client.admin.Util.toLongString(k.state()));
table.setWidget(row, ProjectsTable.C_STATE, state);
break;
case READ_ONLY:
state.setResource(Gerrit.RESOURCES.readOnly());
state.setTitle(com.google.gerrit.client.admin.Util.toLongString(k.state()));
table.setWidget(row, ProjectsTable.C_STATE, state);
break;
case ACTIVE:
default:
// Intentionally left blank, do not show an icon when active.
break;
}
}
示例3: setDetailsVisible
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void setDetailsVisible(Long recordId, boolean show) {
if (!hasDetails()) return;
for (int i = 0; i < iTable.getRowCount(); i++) {
Record r = iTable.getData(i);
if (r == null) continue;
if (r.getUniqueId().equals(recordId)) {
Image details = (Image)((MyCell)iTable.getWidget(i, 0)).getInnerWidget();
details.setResource(show ? RESOURCES.treeOpen() : RESOURCES.treeClosed());
r.setField(0, show ? "-" : "+");
} else if (String.valueOf(recordId).equals(r.getField(0))) {
iTable.getRowFormatter().setVisible(i, show);
}
}
saveOrder();
}
示例4: renderPushCertificate
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private void renderPushCertificate(RevisionInfo revInfo, FlowPanel panel) {
if (!enableSignedPush()) {
return;
}
Image status = new Image();
panel.add(status);
status.setStyleName(style.pushCertStatus());
if (!revInfo.hasPushCertificate() || revInfo.pushCertificate().key() == null) {
status.setResource(Gerrit.RESOURCES.question());
status.setTitle(Util.C.pushCertMissing());
return;
}
PushCertificateInfo certInfo = revInfo.pushCertificate();
GpgKeyInfo.Status s = certInfo.key().status();
switch (s) {
case BAD:
status.setResource(Gerrit.RESOURCES.redNot());
status.setTitle(problems(Util.C.pushCertBad(), certInfo));
break;
case OK:
status.setResource(Gerrit.RESOURCES.warning());
status.setTitle(problems(Util.C.pushCertOk(), certInfo));
break;
case TRUSTED:
status.setResource(Gerrit.RESOURCES.greenCheck());
status.setTitle(Util.C.pushCertTrusted());
break;
}
}
示例5: createLoadingWidget
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private Widget createLoadingWidget(final int pending) {
final HorizontalPanel container = new HorizontalPanel();
container.setWidth("100%");
container.setSpacing(0);
container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
HorizontalPanel panel = new HorizontalPanel();
Image image = new Image();
image.setResource(IMAGES.waitingIcon());
panel.add(image);
Label label = new Label();
label.setText(MESSAGES.defaultRpcMessage());
panel.add(label);
container.add(panel);
GalleryClient.getInstance().addListener(new GalleryRequestListener() {
volatile int count = pending;
private void hideLoadingWidget() {
if (container.getParent() != null) {
container.clear();
container.removeFromParent();
}
}
@Override
public boolean onAppListRequestCompleted(GalleryAppListResult appsResult, int requestID, boolean refreshable) {
if ((--count) <= 0) {
hideLoadingWidget();
return true;
}
return false;
}
@Override
public boolean onCommentsRequestCompleted(List<GalleryComment> comments) {
if ((--count) <= 0) {
hideLoadingWidget();
return true;
}
return false;
}
@Override
public boolean onSourceLoadCompleted(UserProject projectInfo) {
if ((--count) <= 0) {
hideLoadingWidget();
return true;
}
return false;
}
});
return container;
}