本文整理汇总了Java中com.google.gwt.core.client.JsArray.length方法的典型用法代码示例。如果您正苦于以下问题:Java JsArray.length方法的具体用法?Java JsArray.length怎么用?Java JsArray.length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.core.client.JsArray
的用法示例。
在下文中一共展示了JsArray.length方法的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: buildParts
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
private void buildParts(final PanelDefinition panel,
final JsArray<JSPartDefinition> parts) {
if (parts != null) {
for (int i = 0; i < parts.length(); i++) {
final JSPartDefinition part = parts.get(i);
final PlaceRequest placeRequest = new DefaultPlaceRequest(part.getPlaceName());
if (part.getParameters() != null) {
final JSONObject json = new JSONObject(part.getParameters());
for (final String key : json.keySet()) {
placeRequest.addParameter(key,
json.get(key).isString().stringValue());
}
}
final PartDefinition partDefinition = new PartDefinitionImpl(placeRequest);
partDefinition.setContextDisplayMode(JSNativePerspective.this.getContextDisplayMode(part.getContextDisplayModeAsString(),
ContextDisplayMode.SHOW));
if (part.getContextId() != null) {
partDefinition.setContextDefinition(new ContextDefinitionImpl(new DefaultPlaceRequest(part.getContextId())));
}
panel.addPart(partDefinition);
}
}
}
示例3: getHotKeys
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
@Override
public List<HotKeyItem> getHotKeys() {
OrionTextViewOverlay orionTextViewOverlay = editorOverlay.getTextView();
List<HotKeyItem> hotKeyItems = new ArrayList<>();
JsArray<OrionKeyBindingsRelationOverlay> keyBindings =
OrionKeyModeOverlay.getKeyBindings_(orionTextViewOverlay);
for (int i = 0; i < keyBindings.length(); i++) {
OrionKeyBindingsRelationOverlay key = keyBindings.get(i);
String actionId = key.getActionId();
String actionDescription = orionTextViewOverlay.getActionDescription(actionId);
String hotKey = UiUtilsOverlay.getUserKeyString(uiUtilsOverlay, key.getKeyBindings());
if (actionDescription != null) {
hotKeyItems.add(new HotKeyItem(actionDescription, hotKey));
}
}
return hotKeyItems;
}
示例4: gwtSetUp
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
protected void gwtSetUp() throws Exception {
mRoot = Document.get().getDocumentElement();
JsArray<Node> attrs = DomUtil.getAttributes(mRoot);
String[] attrNames = new String[attrs.length()];
for (int i = 0; i < attrs.length(); i++) {
attrNames[i] = attrs.get(i).getNodeName();
}
for (int i = 0; i < attrNames.length; i++) {
mRoot.removeAttribute(attrNames[i]);
}
assertEquals(0, DomUtil.getAttributes(mRoot).length());
NodeList<Node> children = mRoot.getChildNodes();
for (int i = children.getLength() - 1; i >= 0; i--) {
children.getItem(i).removeFromParent();
}
assertEquals(0, mRoot.getChildNodes().getLength());
mHead = Document.get().createElement("head");
mRoot.appendChild(mHead);
mBody = Document.get().createElement("body");
mRoot.appendChild(mBody);
// With this, the width of chrome window won't affect the layout.
mRoot.getStyle().setProperty("width", "800px");
}
示例5: display
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
public void display(JsArray<DocInfo> docList) {
int sz = docList != null ? docList.length() : 0;
boolean hadData = rows > 0;
if (hadData) {
while (sz < rows) {
table.removeRow(dataBeginRow);
rows--;
}
} else {
table.removeRow(dataBeginRow);
}
if (sz == 0) {
insertNoneRow(dataBeginRow);
return;
}
while (rows < sz) {
insertDocRow(dataBeginRow + rows);
rows++;
}
for (int i = 0; i < sz; i++) {
populateDocRow(dataBeginRow + i, docList.get(i));
}
}
示例6: getPersonas
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
public List<TutorPersonaProperties> getPersonas() {
JsArray<TutorJs> tutors = tutorConfigJs.getTutors();
List<TutorPersonaProperties> personas = new ArrayList<TutorPersonaProperties>();
for (int i = 0; i < tutors.length(); i++) {
TutorPersonaProperties persona = fromJs(tutors.get(i), i);
personas.add(persona);
}
return personas;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: drawPieChart
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
/**
* Updates the pue chart with new data
* @param sentimentSummary
*/
private static void drawPieChart(JsArray<SentimentSummary> sentimentSummary) {
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Sentiment");
data.addColumn(ColumnType.NUMBER, "Count");
data.addRows(sentimentSummary.length());
int j = sentimentSummary.length();
for (int i = 0; i < j; i++) {
data.setValue(i, 0, sentimentSummary.get(i).getId());
data.setValue(i, 1, sentimentSummary.get(i).getValue());
}
Legend legend = Legend.create();
legend.setPosition(LegendPosition.NONE);
PieChartOptions options = PieChartOptions.create();
options.setWidth(500);
options.setHeight(400);
ChartArea area = ChartArea.create();
area.setTop(50);
area.setLeft(25);
options.setChartArea(area);
options.setLegend(legend);
options.setColors("BDBDBD", "26A69A", "FF6E40");
pieChart.draw(data, options);
}
示例13: drawPieChart
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
/**
* Updates the pue chart with new data
* @param sourcesSummary
*/
private static void drawPieChart(JsArray<SourceSummary> sourcesSummary) {
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Client");
data.addColumn(ColumnType.NUMBER, "Count");
data.addRows(sourcesSummary.length());
int j = sourcesSummary.length();
for (int i = 0; i < j; i++) {
data.setValue(i, 0, sourcesSummary.get(i).getId());
data.setValue(i, 1, sourcesSummary.get(i).getValue());
}
Legend legend = Legend.create();
legend.setPosition(LegendPosition.NONE);
PieChartOptions options = PieChartOptions.create();
options.setWidth(500);
options.setHeight(400);
ChartArea area = ChartArea.create();
area.setTop(50);
area.setLeft(25);
options.setChartArea(area);
options.setLegend(legend);
options.setColors("00796b", "00897b", "009688", "26a69a", "4db6ac", "80cbc4", "b2dfdb");
pieChart.draw(data, options);
}
示例14: removeTask
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
private void removeTask(int index) {
JsArray<Task> tasks = Dao.getTasks();
JsArrayIterable<Task> newTasks = JavaScriptObject.createArray().cast();
// Copy the tasks but for the current
for (int i = 0; i < tasks.length(); i++) {
if (i != index) {
newTasks.push(tasks.get(i));
}
}
Dao.setTasks(newTasks);
setItems(newTasks);
}
示例15: hasSkip
import com.google.gwt.core.client.JsArray; //导入方法依赖的package包/类
public final boolean hasSkip() {
JsArray<Region> c = content();
for (int i = 0; i < c.length(); i++) {
if (c.get(i).skip() != 0) {
return true;
}
}
return false;
}