Package com.ibm.icu.util

Examples of com.ibm.icu.util.StringTokenizer


    if (!isDebugging())
      return false;

    String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
    if (traceFilter != null) {
      StringTokenizer tokenizer = new StringTokenizer(traceFilter, ","); //$NON-NLS-1$
      while (tokenizer.hasMoreTokens()) {
        String cat = tokenizer.nextToken().trim();
        if (category.equals(cat)) {
          return true;
        }
      }
    }
View Full Code Here


              IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();

              for (int i = 1; i < lines && !fBuildPathIsDirty; i++) {
                line = doc.getLineInformation(i);
                lineText = doc.get(line.getOffset(), line.getLength());
                StringTokenizer toker = new StringTokenizer(lineText, "|"); //$NON-NLS-1$
                if (toker.hasMoreTokens()) {
                  String tokenType = toker.nextToken();
                  if ("JAR".equalsIgnoreCase(tokenType)) { //$NON-NLS-1$ //$NON-NLS-2$
                    boolean has11TLD = Boolean.valueOf(toker.nextToken()).booleanValue();
                    boolean exported = Boolean.valueOf(toker.nextToken()).booleanValue();
                    // make the rest the libraryLocation
                    String libraryLocation = toker.nextToken();
                    while (toker.hasMoreTokens()) {
                      libraryLocation = libraryLocation + "|" + toker.nextToken(); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    libraryLocation = libraryLocation.trim();
                    if (libraryRecord != null && notifyOnRestoration) {
                      TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, libraryRecord, ITaglibIndexDelta.ADDED));
                    }
                    // Create a new JarRecord
                    libraryRecord = createJARRecord(libraryLocation);
                    libraryRecord.has11TLD = has11TLD;
                    libraryRecord.isExported = exported;

                    // Add a URLRecord for the 1.1 TLD
                    if (has11TLD) {
                      InputStream contents = JarUtilities.getInputStream(libraryLocation, JarUtilities.JSP11_TAGLIB);
                      if (contents != null) {
                        TaglibInfo info = extractInfo(libraryLocation, contents);

                        if (info != null && info.uri != null && info.uri.length() > 0) {
                          URLRecord urlRecord = new URLRecord();
                          urlRecord.info = info;
                          urlRecord.isExported = exported;
                          urlRecord.baseLocation = libraryLocation;
                          try {
                            urlRecord.url = new URL("jar:file:" + libraryLocation + "!/" + JarUtilities.JSP11_TAGLIB); //$NON-NLS-1$ //$NON-NLS-2$
                            libraryRecord.urlRecords.add(urlRecord);
                            fClasspathReferences.put(urlRecord.getURI(), urlRecord);
                            if (_debugIndexCreation)
                              Logger.log(Logger.INFO, "created record for " + urlRecord.getURI() + "@" + urlRecord.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
                          }
                          catch (MalformedURLException e) {
                            /*
                             * don't record this
                             * URI
                             */
                            Logger.logException(e);
                          }
                        }
                        try {
                          contents.close();
                        }
                        catch (IOException e) {
                          Logger.log(Logger.ERROR_DEBUG, null, e);
                        }
                      }
                    }

                    fClasspathJars.put(libraryLocation, libraryRecord);
                  }
                  else if ("URL".equalsIgnoreCase(tokenType) && libraryRecord != null) { //$NON-NLS-1$
                    // relies on a previously declared JAR record
                    boolean exported = Boolean.valueOf(toker.nextToken()).booleanValue();
                    // make the rest the URL
                    String urlString = toker.nextToken();
                    while (toker.hasMoreTokens()) {
                      urlString = urlString + "|" + toker.nextToken(); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                    urlString = urlString.trim();
                    // Append a URLrecord
                    URLRecord urlRecord = new URLRecord();
                    urlRecord.url = new URL(urlString);
                    urlRecord.isExported = exported;
                    urlRecord.baseLocation = libraryRecord.location.toString();

                    InputStream tldStream = JarUtilities.getInputStream(urlRecord.url);
                    if(tldStream != null) {
                      TaglibInfo info = extractInfo(urlRecord.url.toString(), tldStream);
                      if (info != null) {
                        urlRecord.info = info;
                      }
                      libraryRecord.urlRecords.add(urlRecord);
                      try {
                        tldStream.close();
                      }
                      catch (IOException e) {
                        Logger.log(Logger.ERROR_DEBUG, null, e);
                      }
                      if (urlRecord.getURI() != null && urlRecord.getURI().length() > 0) {
                        fClasspathReferences.put(urlRecord.getURI(), urlRecord);
                      }
                    }
                  }
                  else if (BUILDPATH_PROJECT.equalsIgnoreCase(tokenType)) {
                    String projectName = toker.nextToken();
                    if (Path.ROOT.isValidSegment(projectName)) {
                      IProject project = workspaceRoot.getProject(projectName);
                      /* do not check if "open" here */
                      if (project != null) {
                        fClasspathProjects.add(project);
                      }
                    }
                  }
                  // last since they occur once
                  else if (BUILDPATH_DIRTY.equalsIgnoreCase(tokenType)) {
                    fBuildPathIsDirty = Boolean.valueOf(toker.nextToken()).booleanValue();
                  }
                  else if (BUILDPATH_ENTRIES.equalsIgnoreCase(tokenType)) {
                    fBuildPathEntryCount = Integer.valueOf(toker.nextToken()).intValue();
                  }
                }
                if (libraryRecord != null && notifyOnRestoration) {
                  TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, libraryRecord, ITaglibIndexDelta.ADDED));
                }
View Full Code Here

    // get indent after 2nd line break
    StringBuffer textAfter = new StringBuffer();
    // will this work on mac?
    textBefore = textBefore.replaceAll("\r", ""); //$NON-NLS-1$ //$NON-NLS-2$
    StringTokenizer st = new StringTokenizer(textBefore, "\n", true); //$NON-NLS-1$
    while (st.hasMoreTokens()) {
      String tok = st.nextToken();
      if (tok.equals("\n")) { //$NON-NLS-1$
        textAfter.append(delim);
      }
      else {
        // prepend each line w/ specified indent
View Full Code Here

    if (modifiers.length() == 0)
      return SWT.NONE;

    int stateMask = 0;
    StringTokenizer modifierTokenizer = new StringTokenizer(modifiers, ",;.:+-* "); //$NON-NLS-1$
    while (modifierTokenizer.hasMoreTokens()) {
      int modifier = EditorUtility.findLocalizedModifier(modifierTokenizer.nextToken());
      if (modifier == 0 || (stateMask & modifier) == modifier)
        return -1;
      stateMask = stateMask | modifier;
    }
    return stateMask;
View Full Code Here

  public static String getUnescapedText(String test) {
    initLookup();
    StringBuffer buffer = new StringBuffer();
    if (test != null) {
      StringTokenizer st = new StringTokenizer(test, "&;", true); //$NON-NLS-1$
      String tok1, tok2, tok3, transString;
      while (st.hasMoreTokens()) {
        tok1 = tok2 = tok3 = transString = ""; //$NON-NLS-1$
        tok1 = st.nextToken();
        if (tok1.equals("&") && st.hasMoreTokens()) //$NON-NLS-1$
        {
          tok2 = st.nextToken();
          if (st.hasMoreTokens()) {
            tok3 = st.nextToken();
          }
        }
        if (!(transString = fXMLtoJavaLookup.getProperty(tok1 + tok2 + tok3, "")).equals("")) //$NON-NLS-2$ //$NON-NLS-1$
        {
          buffer.append(transString);
View Full Code Here

   * @return An array of the default element names considered to be "inline"
   */
  public static Object[] getDefaultInlineElements() {
    String inline = HTMLCorePlugin.getDefault().getPluginPreferences().getDefaultString(HTMLCorePreferenceNames.INLINE_ELEMENTS);
    Set defaults = new HashSet();
    StringTokenizer tokenizer = new StringTokenizer(inline, ",");
    while (tokenizer.hasMoreTokens()) {
      defaults.add(tokenizer.nextToken());
    }
    return defaults.toArray();
  }
View Full Code Here

  }

  private static Set getInlineSet() {
    String inline = HTMLCorePlugin.getDefault().getPluginPreferences().getString(HTMLCorePreferenceNames.INLINE_ELEMENTS);
    Set elements = new HashSet();
    StringTokenizer tokenizer = new StringTokenizer(inline, ",");
    while (tokenizer.hasMoreTokens()) {
      elements.add(tokenizer.nextToken());
    }
    return elements;
  }
View Full Code Here

   */
  private String getMimeTypeFromContentTypeValue(String contentTypeValue) {
    if (contentTypeValue == null)
      return null;
    String cleanContentTypeValue = StringUtils.stripNonLetterDigits(contentTypeValue);
    StringTokenizer tokenizer = new StringTokenizer(cleanContentTypeValue, ";= \t\n\r\f"); //$NON-NLS-1$
    int tLen = tokenizer.countTokens();
    // if contains encoding should have three tokens, the mimetype, the
    // word 'charset', and the encoding value
    String[] tokens = new String[tLen];
    int j = 0;
    while (tokenizer.hasMoreTokens()) {
      tokens[j] = tokenizer.nextToken();
      j++;
    }
    //
    // Following is the common form for target expression
    // <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
View Full Code Here

   */
  protected void addImports(String value, boolean addToMap) {
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=81687
    // added the "addToMap" parameter to exclude imports originating
    // from included JSP files to be added to the jsp<->java mapping
    StringTokenizer st = new StringTokenizer(value, ",", false); //$NON-NLS-1$
    String tok = ""; //$NON-NLS-1$
    // String appendage = ""; //$NON-NLS-1$
    while (st.hasMoreTokens()) {
      tok = st.nextToken();
      appendImportToBuffer(tok, fCurrentNode, addToMap);
    }
  }
View Full Code Here

          // may
          // be a
          // custom
          // tag
        }
        StringTokenizer st = new StringTokenizer(fullTagName, ":.", false); //$NON-NLS-1$
        if (st.hasMoreTokens() && st.nextToken().equals("jsp")) //$NON-NLS-1$
        {
          if (st.hasMoreTokens()) {
            String jspTagName = st.nextToken();

            if (jspTagName.equals("scriptlet")) //$NON-NLS-1$
            {
              translateXMLJSPContent(SCRIPTLET);
            }
            else if (jspTagName.equals("expression")) //$NON-NLS-1$
            {
              translateXMLJSPContent(EXPRESSION);
            }
            else if (jspTagName.equals("declaration")) //$NON-NLS-1$
            {
              translateXMLJSPContent(DECLARATION);
            }
            else if (jspTagName.equals("directive")) //$NON-NLS-1$
            {
              if (st.hasMoreTokens()) {
                String directiveName = st.nextToken();
                if (directiveName.equals("taglib")) { //$NON-NLS-1$
                  while (r != null && regions.hasNext() && !r.getType().equals(DOMRegionContext.XML_TAG_ATTRIBUTE_NAME)) {
                    r = (ITextRegion) regions.next();
                    if (container.getText(r).equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
                      String prefix = getAttributeValue(r, regions);
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.StringTokenizer

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.