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


Java JsArray.get方法代碼示例

本文整理匯總了Java中com.google.gwt.core.client.JsArray.get方法的典型用法代碼示例。如果您正苦於以下問題:Java JsArray.get方法的具體用法?Java JsArray.get怎麽用?Java JsArray.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.core.client.JsArray的用法示例。


在下文中一共展示了JsArray.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDeclarationsForSelectors

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
/**
 * Adds style properties to existing JSOModel. All style properties are converted to lowercase.
 */
public final Map<String, String> getDeclarationsForSelectors(List<String> selectors) {
    JsArray<JsCssRule> rules = getCssRules(styleSheet);
    Map<String, String> result = new HashMap<String, String>();
    int ln = rules.length();
    for (int i = 0; i < ln; i++) {
        JsCssRule rule = rules.get(i);
        if (rule.isStyleRule() && selectors.contains(rule.getSelector())) {
            JsArray<JsCssDeclaration> declarations = rule.getDeclarations();
            int dln = declarations.length();
            for (int j = 0; j < dln; j++) {
                JsCssDeclaration declaration = declarations.get(j);
                if (declaration.getProperty() != null && declaration.getValue() != null)
                    result.put(declaration.getProperty(), declaration.getValue());
            }
        }
    }
    return result;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:22,代碼來源:StyleSheet.java

示例2: findEditParentRevision

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
public static RevisionInfo findEditParentRevision(JsArray<RevisionInfo> list) {
  for (int i = 0; i < list.length(); i++) {
    // edit under revisions?
    RevisionInfo editInfo = list.get(i);
    if (editInfo.isEdit()) {
      String parentRevision = editInfo.editBase();
      // find parent
      for (int j = 0; j < list.length(); j++) {
        RevisionInfo parentInfo = list.get(j);
        String name = parentInfo.name();
        if (name.equals(parentRevision)) {
          // found parent pacth set number
          return parentInfo;
        }
      }
    }
  }
  return null;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:20,代碼來源:ChangeInfo.java

示例3: startElement

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
@Override
public void startElement(Element element) {
    elements.push(element);
    documentStringBuilder.append("<");
    documentStringBuilder.append(element.getTagName());
    JsArray<Node> attributes = DomUtil.getAttributes(element);
    for (int i = 0; i < attributes.length(); i++) {
        Node node = attributes.get(i);
        documentStringBuilder.append(" ");
        documentStringBuilder.append(node.getNodeName());
        documentStringBuilder.append("=\"");
        documentStringBuilder.append(node.getNodeValue());
        documentStringBuilder.append("\"");
    }
    documentStringBuilder.append(">");
}
 
開發者ID:chromium,項目名稱:dom-distiller,代碼行數:17,代碼來源:FakeWebDocumentBuilder.java

示例4: getEventPosition

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
@Override
        protected int getEventPosition(Event ev) {
            JsArray<Touch> touches = ev.getTouches();
            int retval;
            if (touches != null && touches.length() > 0) {
                Touch t = touches.get(0);
                retval = t.getPageX();
//            retval= t.getClientX() - getAbsoluteLeft();
//            GwtUtil.showDebugMsg("retval="+retval+ ", cx="+t.getClientX()+ ", al=" +getAbsoluteLeft());

            } else {
                retval = ev.getClientX() + Window.getScrollLeft();
            }
            return retval;
        }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:16,代碼來源:SplitLayoutPanelFirefly.java

示例5: getTouch

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private Touch getTouch(JsArray<Touch> touches, int identifier)
{
  if (touches != null && !isZoomed()) {
    if (identifier == -1) {
      if (touches.length() > 0) {
        return touches.get(0);
      }
    } else if (touches.length() == 1) {
      Touch touch = touches.get(0);
      if (touch.getIdentifier() == identifier) {
        return touch;
      }
    }
  }
  return null;
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:17,代碼來源:WgtScroll.java

示例6: commentlinks

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
final List<FindReplace> commentlinks() {
  JsArray<CommentLinkInfo> cls = commentlinks0().values();
  List<FindReplace> commentLinks = new ArrayList<>(cls.length());
  for (int i = 0; i < cls.length(); i++) {
    CommentLinkInfo cl = cls.get(i);
    if (!cl.enabled()) {
      continue;
    }
    if (cl.link() != null) {
      commentLinks.add(new LinkFindReplace(cl.match(), cl.link()));
    } else {
      try {
        FindReplace fr = new RawFindReplace(cl.match(), cl.html());
        commentLinks.add(fr);
      } catch (RuntimeException e) {
        int index = e.getMessage().indexOf("at Object");
        new ErrorDialog(
                "Invalid commentlink configuration: "
                    + (index == -1 ? e.getMessage() : e.getMessage().substring(0, index)))
            .center();
      }
    }
  }
  return commentLinks;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:26,代碼來源:ConfigInfo.java

示例7: textUnified

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
public final String textUnified() {
  StringBuilder s = new StringBuilder();
  JsArray<Region> c = content();
  for (int i = 0; i < c.length(); i++) {
    Region r = c.get(i);
    if (r.ab() != null) {
      append(s, r.ab());
    } else {
      if (r.a() != null) {
        append(s, r.a());
      }
      if (r.b() != null) {
        append(s, r.b());
      }
    }
    // TODO skip may need to be handled
  }
  return s.toString();
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:20,代碼來源:DiffInfo.java

示例8: filterForRevision

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private static NativeMap<JsArray<CommentInfo>> filterForRevision(
    NativeMap<JsArray<CommentInfo>> comments, int id) {
  NativeMap<JsArray<CommentInfo>> filtered = NativeMap.create();
  for (String k : comments.keySet()) {
    JsArray<CommentInfo> allRevisions = comments.get(k);
    JsArray<CommentInfo> thisRevision = JsArray.createArray().cast();
    for (int i = 0; i < allRevisions.length(); i++) {
      CommentInfo c = allRevisions.get(i);
      if (c.patchSet() == id) {
        thisRevision.push(c);
      }
    }
    filtered.put(k, thisRevision);
  }
  return filtered;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:17,代碼來源:ChangeScreen.java

示例9: resolveRevisionToDisplay

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private RevisionInfo resolveRevisionToDisplay(ChangeInfo info) {
  RevisionInfo rev = resolveRevisionOrPatchSetId(info, revision, info.currentRevision());
  if (rev != null) {
    revision = rev.name();
    return rev;
  }

  // the revision is not visible to the calling user (maybe it is a draft?)
  // or the change is corrupt, take the last revision that was returned,
  // if no revision was returned display an error
  JsArray<RevisionInfo> revisions = info.revisions().values();
  if (revisions.length() > 0) {
    RevisionInfo.sortRevisionInfoByNumber(revisions);
    rev = revisions.get(revisions.length() - 1);
    revision = rev.name();
    return rev;
  }
  new ErrorDialog(Resources.M.changeWithNoRevisions(info.legacyId().get())).center();
  throw new IllegalStateException("no revision, cannot proceed");
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:21,代碼來源:ChangeScreen.java

示例10: resolveRevisionOrPatchSetId

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
/**
 * Resolve a revision or patch set id string to RevisionInfo. When this view is created from the
 * changes table, revision is passed as a real revision. When this view is created from side by
 * side (by closing it with 'u') patch set id is passed.
 *
 * @param info change info
 * @param revOrId revision or patch set id
 * @param defaultValue value returned when revOrId is null
 * @return resolved revision or default value
 */
private RevisionInfo resolveRevisionOrPatchSetId(
    ChangeInfo info, String revOrId, String defaultValue) {
  int parentNum;
  if (revOrId == null) {
    revOrId = defaultValue;
  } else if ((parentNum = toParentNum(revOrId)) > 0) {
    CommitInfo commitInfo = info.revision(revision).commit();
    JsArray<CommitInfo> parents = commitInfo.parents();
    if (parents.length() >= parentNum) {
      return RevisionInfo.forParent(-parentNum, parents.get(parentNum - 1));
    }
  } else if (!info.revisions().containsKey(revOrId)) {
    JsArray<RevisionInfo> list = info.revisions().values();
    for (int i = 0; i < list.length(); i++) {
      RevisionInfo r = list.get(i);
      if (revOrId.equals(String.valueOf(r._number()))) {
        revOrId = r.name();
        break;
      }
    }
  }
  return revOrId != null ? info.revision(revOrId) : null;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:34,代碼來源:ChangeScreen.java

示例11: getProgresses

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private static List<ProgressConfig> getProgresses(ProgressBonusConfigJs configJs) {
    List<ProgressConfig> progresses = Lists.newArrayList();
    JsArray<ProgressConfigJs> jsProgresses = configJs.getProgresses();

    for (int i = 0; i < jsProgresses.length(); i++) {
        ProgressConfigJs progressConfigJs = jsProgresses.get(i);
        ProgressConfig progress = ProgressConfig.fromJs(progressConfigJs);
        progresses.add(progress);
    }
    return progresses;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:12,代碼來源:ProgressBonusConfig.java

示例12: getAssets

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private static List<ProgressAssetConfig> getAssets(JsArray<ProgressAssetConfigJs> progresses) {
    List<ProgressAssetConfig> assets = Lists.newArrayList();

    for (int i = 0; i < progresses.length(); i++) {
        ProgressAssetConfigJs configJs = progresses.get(i);
        ProgressAssetConfig asset = ProgressAssetConfig.fromJs(configJs);
        assets.add(asset);
    }
    return assets;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:11,代碼來源:ProgressConfig.java

示例13: getActions

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private static List<BonusAction> getActions(BonusConfigJs bonusConfigJs) {
    List<BonusAction> actions = Lists.newArrayList();
    JsArray<BonusActionJs> jsActions = bonusConfigJs.getActions();

    for (int i = 0; i < jsActions.length(); i++) {
        BonusActionJs jsAction = jsActions.get(i);
        BonusAction action = BonusAction.fromJs(jsAction);
        actions.add(action);
    }

    return actions;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:13,代碼來源:BonusConfig.java

示例14: getBonuses

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private static List<BonusResource> getBonuses(JsArray<BonusResourceJs> jsBonuses) {
    List<BonusResource> bonuses = Lists.newArrayList();

    for (int i = 0; i < jsBonuses.length(); i++) {
        BonusResourceJs jsBonus = jsBonuses.get(i);
        BonusResource bonus = BonusResource.fromJs(jsBonus);
        bonuses.add(bonus);
    }

    return bonuses;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:12,代碼來源:BonusAction.java

示例15: getTouch

import com.google.gwt.core.client.JsArray; //導入方法依賴的package包/類
private Touch getTouch(NativeEvent event) {
    JsArray<Touch> touches = event.getChangedTouches();
    Touch touch = null;
    if (touches != null && touches.length() == 1) {
        touch = touches.get(0);
    }
    return touch;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:9,代碼來源:PositionHelper.java


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