当前位置: 首页>>代码示例>>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;未经允许,请勿转载。