本文整理汇总了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;
}
示例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;
}
示例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(">");
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}