当前位置: 首页>>代码示例>>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;未经允许,请勿转载。