當前位置: 首頁>>代碼示例>>Java>>正文


Java Image.setResource方法代碼示例

本文整理匯總了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);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:20,代碼來源:GalleryAppBox.java

示例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;
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:20,代碼來源:ProjectsTable.java

示例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();
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:16,代碼來源:SimpleEditPage.java

示例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;
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:30,代碼來源:ChangeScreen.java

示例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;
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:49,代碼來源:Ode.java


注:本文中的com.google.gwt.user.client.ui.Image.setResource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。