Package com.google.gwt.core.client

Examples of com.google.gwt.core.client.JsArrayString


   }

   private void populateOutput(DataPreviewResult result)
   {
      JsArray<JsObject> output = result.getOutput();
      JsArrayString names = result.getOutputNames();

      int rows = output.length();
      int cols = names.length();
      Grid grid = new Grid(rows + 1, cols);
      grid.setCellPadding(0);
      grid.setCellSpacing(0);
      grid.getRowFormatter().addStyleName(0, styles_.header());
      for (int col = 0; col < cols; col++)
         grid.setText(0, col, names.get(col));

      for (int row = 0; row < rows; row++)
      {
         for (int col = 0; col < cols; col++)
         {
            String val = output.get(row).getString(names.get(col), true);
            if (val == null)
               val = "NA";
            grid.setText(row + 1, col, val);
         }
      }
View Full Code Here


   {
      RmdFrontMatterOutputOptions result = RmdFrontMatterOutputOptions.create();

      // loop over each option applicable to the new format; if it's
      // transferable, try to find it in one of the other formats
      JsArrayString options = template.getFormat(format).getOptions();
      for (int i = 0; i < options.length(); i++)
      {
         String optionName = options.get(i);
         RmdTemplateFormatOption option = template.getOption(optionName);
         if (!option.isTransferable())
            continue;
        
         // option is transferable, is it present in another front matter entry?
         JsArrayString formats = frontMatter.getFormatList();
         for (int j = 0; j < formats.length(); j++)
         {
            RmdFrontMatterOutputOptions outOptions =
                  frontMatter.getOutputOption(formats.get(j));
            if (outOptions == null)
               continue;
            String val = outOptions.getOptionValue(optionName);
            if (val != null)
               result.setOptionValue(option, val);
View Full Code Here

   
   public final boolean hasParameters()
   {
      if (getType() == FUNCTION)
      {
         JsArrayString textEntries = getText();
         for (int i = 0; i < textEntries.length(); i++)
         {
            String text = textEntries.get(i);
            if (!text.endsWith("()") && !text.endsWith("() const"))
               return true;
         }
      }
     
View Full Code Here

      // This can be pretty simple because Noweb doesn't allow = or , to appear
      // in names or values (i.e. no quotes or escaping to make parsing more
      // complicated).

      String token = null;
      JsArrayString completions = JsArrayString.createArray().cast();
      ArrayList<String> names = new ArrayList<String>();
      ArrayList<String> values = new ArrayList<String>();
      parseRnwChunkHeader(linePart, names, values);

      assert names.size() == values.size();

      String name = names.size() == 0
                    ? null : names.get(names.size()-1);
      String value = values.size() == 0
                     ? null : values.get(values.size()-1);

      if (value != null)
      {
         token = value;
         // If value is not null, we follow an equal sign; try to complete
         // based on value.
         completeValue(rnwWeave, name, value, completions);
      }
      else if (name != null)
      {
         token = name;
         for (String optionName : this.getOptions())
            if (optionName.startsWith(name))
               completions.push(optionName + "=");
      }

      RnwOptionCompletionResult result = new RnwOptionCompletionResult();
      result.token = token;
      result.completions = completions;
View Full Code Here

            stopAndClear();

            FileSystemItem searchPath =
                                      FileSystemItem.createDir(input.getPath());

            JsArrayString filePatterns = JsArrayString.createArray().cast();
            for (String pattern : input.getFilePatterns())
               filePatterns.push(pattern);

            server_.beginFind(input.getQuery(),
                              input.isRegex(),
                              !input.isCaseSensitive(),
                              searchPath,
View Full Code Here

            return VUnknownComponent.class;
        }
    }

    public void addComponentMappings(ValueMap valueMap, WidgetSet widgetSet) {
        JsArrayString keyArray = valueMap.getKeyArray();
        for (int i = 0; i < keyArray.length(); i++) {
            String key = keyArray.get(i).intern();
            int value = valueMap.getInt(key);
            classes[value] = widgetSet.getImplementationByClassName(key);
            if (classes[value] == VUnknownComponent.class) {
                if (unknownComponents == null) {
                    unknownComponents = new HashMap<String, String>();
View Full Code Here

      }
      return toReturn;
    }-*/;

    public void createStackTrace(JavaScriptException e) {
      JsArrayString stack = inferFrom(e.getException());

      StackTraceElement[] stackTrace = new StackTraceElement[stack.length()];
      for (int i = 0, j = stackTrace.length; i < j; i++) {
        stackTrace[i] = new StackTraceElement("Unknown", stack.get(i),
            "Unknown source", 0);
      }
      e.setStackTrace(stackTrace);
    }
View Full Code Here

      }
      e.setStackTrace(stackTrace);
    }

    public void fillInStackTrace(Throwable t) {
      JsArrayString stack = StackTraceCreator.createStackTrace();
      StackTraceElement[] stackTrace = new StackTraceElement[stack.length()];
      for (int i = 0, j = stackTrace.length; i < j; i++) {
        stackTrace[i] = new StackTraceElement("Unknown", stack.get(i),
            "Unknown source", 0);
      }
      t.setStackTrace(stackTrace);
    }
View Full Code Here

   */
  static class CollectorEmulated extends Collector {

    @Override
    public JsArrayString collect() {
      JsArrayString toReturn = JsArrayString.createArray().cast();
      JsArray<JavaScriptObject> stack = getStack();
      for (int i = 0, j = getStackDepth(); i < j; i++) {
        String name = stack.get(i) == null ? "anonymous"
            : extractName(stack.get(i).toString());
        // Reverse the order
        toReturn.set(j - i - 1, name);
      }

      return toReturn;
    }
View Full Code Here

    public void createStackTrace(JavaScriptException e) {
      // No-op, relying on initializer call to collect()
    }

    public void fillInStackTrace(Throwable t) {
      JsArrayString stack = collect();
      JsArrayString locations = getLocation();
      StackTraceElement[] stackTrace = new StackTraceElement[stack.length()];
      for (int i = 0, j = stackTrace.length; i < j; i++) {
        // Locations is also backwards
        String location = locations.get(j - i - 1);
        String fileName = "Unknown source";
        int lineNumber = 0;
        if (location != null) {
          int idx = location.indexOf(':');
          if (idx != -1) {
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.JsArrayString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.