本文整理汇总了Java中com.google.gwt.core.client.JsArrayMixed.length方法的典型用法代码示例。如果您正苦于以下问题:Java JsArrayMixed.length方法的具体用法?Java JsArrayMixed.length怎么用?Java JsArrayMixed.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.core.client.JsArrayMixed
的用法示例。
在下文中一共展示了JsArrayMixed.length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAsMap
import com.google.gwt.core.client.JsArrayMixed; //导入方法依赖的package包/类
public List<Record> getAsMap() {
ArrayList<Record> res = new ArrayList<com.gbourquet.yaph.client.utils.Record>();
String[] columns = new String[columnsIdx.size()];
for (Entry<String, Integer> e : columnsIdx.entrySet())
columns[e.getValue()] = e.getKey();
for (int r = 0; r < size(); r++) {
HashMap<String, String> rowObject = new HashMap<String, String>();
JsArrayMixed row = rows.get(r);
for (int c = 0; c < row.length(); c++)
rowObject.put(columns[c], row.getString(c));
Record record = new Record();
record.setProperties(rowObject);
res.add(record);
}
return res;
}
示例2: showCompletionProposals
import com.google.gwt.core.client.JsArrayMixed; //导入方法依赖的package包/类
public void showCompletionProposals() {
if (! editorWidget.getEditorOverlay().hasShowHint()) {
// no support for hints
return;
}
final CMHintFunctionOverlay hintAuto = CMHintFunctionOverlay.createFromName(editorWidget.getCodeMirror(), "auto");
final CMHintResultsOverlay result = hintAuto.apply(editorWidget.getEditorOverlay());
if (result != null) {
final List<String> proposals = new ArrayList<>();
final JsArrayMixed list = result.getList();
int nonStrings = 0;
//jsarray aren't iterable
for (int i = 0; i < list.length(); i++) {
if (result.isString(i)) {
proposals.add(result.getCompletionItemAsString(i));
} else {
nonStrings++;
}
}
LOG.info("CM Completion returned " + list.length() + " items, of which " + nonStrings + " were not strings.");
showCompletionProposals(proposals, result.getFrom(), result.getTo());
}
}
示例3: toList
import com.google.gwt.core.client.JsArrayMixed; //导入方法依赖的package包/类
public List<Object> toList(JsArrayMixed args) {
List<Object> result = new ArrayList<Object>();
if (args != null) {
for (int i = 0; i < args.length(); i++) {
result.add(get(args, i));
}
}
return result;
}