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


Java JsArrayString.length方法代碼示例

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


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

示例1: getStrings

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
/**
 * Returns a multi line label at a specific index. An array of strings is returned. 
 * @param index index of label
 * @return an array of strings
 */
public final String[] getStrings(int index){
	// checks range
	if (checkRange(index)){
		// gets multi line array
		JsArrayString multiValues = getObject(index);
		// if consistent
		if (multiValues != null){
			// creates an string array
			String[] result = new String[multiValues.length()];
			// scans all values
			for (int i=0; i<multiValues.length(); i++){
				// adds to java array
				result[i] = multiValues.get(i);
			}
			// returns array
			return result;
		} else {
			// returns an empty array
			return new String[0];
		}
	}
	// returns an empty array
	return new String[0];
}
 
開發者ID:pepstock-org,項目名稱:Charba,代碼行數:30,代碼來源:Labels.java

示例2: fromJSON

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
@Override
public Object fromJSON(JsonSerializationHelper helper, JavaScriptObject obj) throws JaxmppException {
	String type = JsonSerializationHelper.getStringFromObject(obj, "type");
	if (!getJsonType().equals(type)) {
		return null;
	}
	
	JavaScriptObject presences = JsonSerializationHelper.getObjectFromObject(obj, "items");
	JsArrayString jids = JsonSerializationHelper.getKeysFromObject(presences);
	for (int i=0; i<jids.length(); i++) {
		String key = jids.get(i);
		JID jid = JID.jidInstance(key);
		JavaScriptObject jsPresence = JsonSerializationHelper.getObjectFromObject(presences, key);
		Element el = (Element) helper.fromJSON(jsPresence);
		Presence presence = (Presence) Stanza.create(el);
		update(presence);
	}
	
	return this;
}
 
開發者ID:horsefaced,項目名稱:jaxmpp-android,代碼行數:21,代碼來源:GWTPresenceStore.java

示例3: getUrl

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
private static String getUrl(JavaScriptException e) {
  String baseUrl = baseUrl();
  JsArrayString stack = getStack(e);
  for (int i = stack.length() - 1; i >= 0; i--) {
    String frame = stack.get(i);
    int at = frame.indexOf(baseUrl);
    if (at >= 0) {
      int end = frame.indexOf(':', at + baseUrl.length());
      if (end < 0) {
        end = frame.length();
      }
      return frame.substring(at, end);
    }
  }
  return UNKNOWN;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:17,代碼來源:PluginName.java

示例4: ensureDependenciesAreLoaded

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
private void ensureDependenciesAreLoaded(String mode) {
  JsArrayString deps = getDependencies(mode);
  for (int i = 0; i < deps.length(); i++) {
    String d = deps.get(i);
    if (loading.contains(d) || isModeLoaded(d)) {
      continue;
    }

    if (!canLoad(d)) {
      Logger.getLogger("net.codemirror")
          .log(Level.SEVERE, "CodeMirror mode " + d + " needs " + d);
      continue;
    }

    loading.add(d);
    beginLoading(d);
  }
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:19,代碼來源:ModeInjector.java

示例5: getProj4jsProjections

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
private static List<String> getProj4jsProjections() {
	List<String> projections = new ArrayList<String>(); 
				
	JsArrayString projDefs = getProjDefs();

	for (int i = 0; i < projDefs.length(); i++) {
		projections.add(projDefs.get(i).trim());
	}

	return projections;
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:12,代碼來源:Projections.java

示例6: getMatches

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
@Override
public List<String> getMatches(String test) {
  JsArrayString matches = matches(regExp, test);
  if (matches != null && matches.length() > 0) {
    List<String> result = new ArrayList<String>(matches.length());
    for (int i = 0; i < matches.length(); ++i) {
      result.add(matches.get(i));
    }
    return result;
  }
  return new ArrayList<String>();
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:13,代碼來源:JsRegExp.java

示例7: getScopes

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
private final String[] getScopes() {
  JsArrayString jsa = getScopesNative();
  String[] arr = new String[jsa.length()];
  for (int i = 0; i < jsa.length(); i++) {
    arr[i] = jsa.get(i);
  }
  return arr;
}
 
開發者ID:chetsmartboy,項目名稱:gwt-oauth2,代碼行數:9,代碼來源:Auth.java

示例8: indexes

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
public final int[] indexes() {
    checkNull();
    JsArrayString a = keysImpl();
    int[] ret = new int[a.length()];
    for (int i = 0; i < a.length(); i++) {
        try {
            ret[i] = Integer.valueOf(a.get(i));
        } catch (Exception e) {
            ret[i] = i;
        }
    }
    return ret;
}
 
開發者ID:liraz,項目名稱:gwt-backbone,代碼行數:14,代碼來源:JsObject.java

示例9: keys

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
public final String[] keys() {
    checkNull();
    JsArrayString a = keysImpl();
    String[] ret = new String[a.length()];
    for (int i = 0; i < a.length(); i++) {
        ret[i] = a.get(i);
    }
    return ret;
}
 
開發者ID:liraz,項目名稱:gwt-backbone,代碼行數:10,代碼來源:JsObject.java

示例10: toList

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
public static List<String> toList(JsArrayString array) {
    List<String> list = new ArrayList<>();
    if(array != null) {
        for (int i = 0; i < array.length(); i++) {
            list.add(array.get(i));
        }
    }
    return list;
}
 
開發者ID:BenDol,項目名稱:gwt-jui,代碼行數:10,代碼來源:JsArrayUtil.java

示例11: registerFileType

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
public void registerFileType(
    final OrionContentTypeOverlay contentType,
    final OrionHighlightingConfigurationOverlay config) {
  // register content type and configure orion
  JsArrayString extensions = contentType.getExtensions();
  for (int i = 0; i < extensions.length(); i++) {
    String extension = extensions.get(i);
    fileTypeIdentifier.registerNewExtension(extension, newArrayList(contentType.getId()));
  }
  editorModule
      .getInitializerPromise()
      .then(
          new Operation<Void>() {
            @Override
            public void apply(Void arg) throws OperationException {
              OrionServiceRegistryOverlay serviceRegistry =
                  codeEditWidgetProvider.get().getServiceRegistry();
              serviceRegistry.doRegisterService(
                  "orion.core.contenttype",
                  JavaScriptObject.createObject(),
                  contentType.toServiceObject());
              if (config.getPatterns() != null && config.getPatterns().length() != 0) {
                serviceRegistry.doRegisterService(
                    "orion.edit.highlighter", JavaScriptObject.createObject(), config);
              }
            }
          });
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:29,代碼來源:OrionContentTypeRegistrant.java

示例12: split

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
@Override
public List<String> split(String string, String separator) {
  JsArrayString jsArrayString = nativeSplit(string, separator);

  List<String> result = new ArrayList<>();
  for (int i = 0; i < jsArrayString.length(); i++) {
    result.add(jsArrayString.get(i));
  }
  return result;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:11,代碼來源:StringUtils.java

示例13: toArray

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
/**
 * From JSArrays implementation https://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/jscollections/client/JsArrays.java
 *
 * @param values
 * @return
 */
static String[] toArray(JsArrayString values) {
    if (GWT.isScript()) {
        return reinterpretCast(values);
    } else {
        int length = values.length();
        String[] ret = new String[length];
        for (int i = 0, l = length; i < l; i++) {
            ret[i] = values.get(i);
        }
        return ret;
    }
}
 
開發者ID:Shuky,項目名稱:gwt-localforage,代碼行數:19,代碼來源:LocalForage.java

示例14: fromJSON

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
@Override
public Object fromJSON(JsonSerializationHelper helper, JavaScriptObject obj) throws JaxmppException {
	String type = JsonSerializationHelper.getStringFromObject(obj, "type");
	if (!getJsonType().equals(type)) {
		return null;
	}
	
	JavaScriptObject items = JsonSerializationHelper.getObjectFromObject(obj, "items");
	JsArrayString jids = JsonSerializationHelper.getKeysFromObject(items);
	for (int i=0; i<jids.length(); i++) {
		String key = jids.get(i);
		BareJID jid = BareJID.bareJIDInstance(key);
		JavaScriptObject item = JsonSerializationHelper.getObjectFromObject(items, key);
		RosterItem ri = new RosterItem(jid, helper.getSessionObject());
		JsArrayString propNames = JsonSerializationHelper.getKeysFromObject(item);
		for (int j=0; j<propNames.length(); j++) {
			String prop = propNames.get(j);
			if ("name".equals(prop)) {
				ri.setName(JsonSerializationHelper.getStringFromObject(item, prop));
			} else if ("sub".equals(prop)) {
				ri.setSubscription(Subscription.valueOf(JsonSerializationHelper.getStringFromObject(item, prop)));
			} else if ("ask".equals(prop)) {
				ri.setAsk(true);
			} else if ("groups".equals(prop)) {
				JsArrayString groups = (JsArrayString) JsonSerializationHelper.getObjectFromObject(item, prop);
				for (int k=0; k<groups.length(); k++) {
					String group = groups.get(k);
					ri.getGroups().add(group);
				}
			}
			this.addItem(ri);
		}
	}
	
	return this;
}
 
開發者ID:horsefaced,項目名稱:jaxmpp-android,代碼行數:37,代碼來源:GwtRosterStore.java

示例15: set

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
void set(
    DiffPreferences prefs,
    JsArray<RevisionInfo> list,
    int parents,
    DiffInfo info,
    boolean editExists,
    boolean current,
    boolean open,
    boolean binary) {
  this.changeType = info.changeType();
  patchSetSelectBoxA.setUpPatchSetNav(
      list, parents, info.metaA(), editExists, current, open, binary);
  patchSetSelectBoxB.setUpPatchSetNav(
      list, parents, info.metaB(), editExists, current, open, binary);

  JsArrayString hdr = info.diffHeader();
  if (hdr != null) {
    StringBuilder b = new StringBuilder();
    for (int i = 1; i < hdr.length(); i++) {
      String s = hdr.get(i);
      if (!info.binary()
          && (s.startsWith("diff --git ")
              || s.startsWith("index ")
              || s.startsWith("+++ ")
              || s.startsWith("--- "))) {
        continue;
      }
      b.append(s).append('\n');
    }

    String hdrTxt = b.toString().trim();
    header = !hdrTxt.isEmpty();
    diffHeaderText.setInnerText(hdrTxt);
    UIObject.setVisible(diffHeaderRow, header);
  } else {
    header = false;
    UIObject.setVisible(diffHeaderRow, false);
  }
  setHideEmptyPane(prefs.hideEmptyPane());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:41,代碼來源:DiffTable.java


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