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


Java JsArrayString.get方法代碼示例

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


在下文中一共展示了JsArrayString.get方法的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: changeHtmlStyle

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
/** Method called to toggle the style in HTML-Mode **/
private void changeHtmlStyle(String startTag, String stopTag) {
	JsArrayString tx = getSelection(styleText.getElement());
	String txbuffer = styleText.getText();
	Integer startpos = Integer.parseInt(tx.get(1));
	String selectedText = tx.get(0);
	styleText.setText(txbuffer.substring(0, startpos) + startTag + selectedText + stopTag + txbuffer.substring(startpos + selectedText.length()));
}
 
開發者ID:openkm,項目名稱:document-management-system,代碼行數:9,代碼來源:RichTextToolbar.java

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: getLanguages

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
@Override
public final List<String> getLanguages() {
	JsArrayString langs = getLanguages0();
	if(langs == null || langs.length() == 0) {
		return Collections.emptyList();
	}
	
	List<String> ls = new ArrayList<>();
	for(int i = 0; i < langs.length(); i++) {
		String l = langs.get(i);
		ls.add(l);
	}
	
	return ls;
}
 
開發者ID:metteo,項目名稱:gwt-worker,代碼行數:16,代碼來源:WorkerNavigatorJsoImpl.java

示例13: createHeadersMap

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
/**
 * Inspects the headers object of the given JS object and constructs a
 * {@link Map} of its keys and values.
 */
private static Map<String, HeaderValue> createHeadersMap(DynamicJso data) {
  DynamicJso headers = data.get("headers");
  JsArrayString keys = headers.keys();
  Map<String, HeaderValue> headersMap = Maps.newHashMapWithExpectedSize(keys.length());

  for (int i = 0; i < keys.length(); i++) {
    String key = keys.get(i);
    String value = "";
    switch (headers.typeofKey(key)) {
      case STRING:
        value = headers.getString(key);
        break;

      case BOOLEAN:
        value = String.valueOf(headers.getBoolean(key));
        break;

      case NUMBER:
        value = String.valueOf(headers.getInteger(key));
        break;

      case INTEGER:
        value = String.valueOf(headers.getDouble(key));
        break;
    }
    headersMap.put(key.toLowerCase(), new HeaderValue(key, value));

  }
  return headersMap;
}
 
開發者ID:showlowtech,項目名稱:google-apis-explorer,代碼行數:35,代碼來源:ApiResponse.java

示例14: asEvent

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
public final StatisticsEvent asEvent() {
  return new StatisticsEvent() {
    //@Override
    public String getModuleName() {
      return GwtStatisticsEvent.this.getModuleName();
    }
    //@Override
    public String getSubSystem() {
      return GwtStatisticsEvent.this.getSubSystem();
    }
    //@Override
    public String getEventGroupKey() {
      return GwtStatisticsEvent.this.getEventGroupKey();
    }
    //@Override
    public double getMillis() {
      return GwtStatisticsEvent.this.getMillis();
    }
    //@Override
    public Iterator<String> getExtraParameterNames() {
      final JsArrayString names = getExtraParameterNames0();
      return new Iterator<String>() {
        private int idx = 0;

        //@Override
        public boolean hasNext() {
          return idx < names.length();
        }

        //@Override
        public String next() {
          return names.get(idx++);
        }

        //@Override
        public void remove() {
          throw new RuntimeException("parameter names are read-only");
        }
      };
    }
    //@Override
    public Object getExtraParameter(String name) {
      return GwtStatisticsEvent.this.getExtraParameter(name);
    }
  };
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:47,代碼來源:GwtStatisticsEvent.java

示例15: convertItem

import com.google.gwt.core.client.JsArrayString; //導入方法依賴的package包/類
public static WebPlotResult convertItem(PlotResultOverlay res) {
        WebPlotResult  retval;
        if (res.isSuccess()) {
            retval= new WebPlotResult();
            String stateStr= res.getResult(WebPlotResult.PLOT_STATE);
            if (stateStr!=null) {
                PlotState state= PlotState.parse(stateStr);
                retval.putResult(WebPlotResult.PLOT_STATE, state);
            }
            String imagesStr= res.getResult(WebPlotResult.PLOT_IMAGES);
            if (imagesStr!=null) {
                PlotImages images= PlotImages.parse(imagesStr);
                retval.putResult(WebPlotResult.PLOT_IMAGES, images);
            }

            String wpInitStr= res.getResult(WebPlotResult.INSERT_BAND_INIT);
            if (wpInitStr!=null) {
                InsertBandInitializer ibInit= InsertBandInitializer.parse(wpInitStr);
                retval.putResult(WebPlotResult.INSERT_BAND_INIT, ibInit);
            }

            JsArrayString creatorAry= res.getStringArrayResult(WebPlotResult.PLOT_CREATE);
//            String wpCreateStr= res.getResult(WebPlotResult.PLOT_CREATE);
            if (creatorAry!=null) {
                    String ary[]= new String[creatorAry.length()];
                    for(int i= 0; (i<ary.length); i++) ary[i]= creatorAry.get(i);
                    List<WebPlotInitializer> wpInitList= new ArrayList<WebPlotInitializer>(ary.length);
                    for(String s : ary) {
                        WebPlotInitializer wpInit= WebPlotInitializer.parse(s);
                        if (wpInit!=null) wpInitList.add(wpInit);
                    }
                    CreatorResults cr= new CreatorResults(wpInitList.toArray(new WebPlotInitializer[wpInitList.size()]));
                    retval.putResult(WebPlotResult.PLOT_CREATE, cr);
            }

            checkForStringResult(WebPlotResult.STRING,retval,res);
            checkForStringResult(WebPlotResult.DATA_HIST_IMAGE_URL,retval,res);
            checkForStringResult(WebPlotResult.CBAR_IMAGE_URL,retval,res);
            checkForStringResult(WebPlotResult.IMAGE_FILE_NAME,retval,res);
            checkForStringResult(WebPlotResult.REGION_FILE_NAME,retval,res);
            checkForStringResult(WebPlotResult.REGION_DATA,retval,res);
            checkForStringResult(WebPlotResult.REGION_ERRORS,retval,res);
            checkForStringResult(WebPlotResult.TITLE,retval,res);
            checkForIntAryResult(WebPlotResult.DATA_HISTOGRAM, retval, res);
            checkForDoubleAryResult(WebPlotResult.DATA_BIN_MEAN_ARRAY, retval, res);


            String biStr= res.getResult(WebPlotResult.BAND_INFO);
            if (biStr!=null) {
                BandInfo bi= BandInfo.parse(biStr);
                retval.putResult(WebPlotResult.BAND_INFO, bi);
            }
        }
        else {
            retval= WebPlotResult.makeFail(res.getBriefFailReason(),
                                           res.getUserFailReason(),
                                           res.getDetailFailReason(),
                                           res.getProgressKey());

        }
        return retval;
    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:63,代碼來源:WebPlotResultParser.java


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