Search in sources :

Example 21 with StringTokenizer

use of com.ibm.icu.util.StringTokenizer in project webtools.sourceediting by eclipse.

the class OpenFileHyperlinkTracker method computeStateMask.

private int computeStateMask(String modifiers) {
    if (modifiers == null)
        return -1;
    if (modifiers.length() == 0)
        return SWT.NONE;
    int stateMask = 0;
    // $NON-NLS-1$
    StringTokenizer modifierTokenizer = new StringTokenizer(modifiers, ",;.:+-* ");
    while (modifierTokenizer.hasMoreTokens()) {
        int modifier = EditorUtility.findLocalizedModifier(modifierTokenizer.nextToken());
        if (modifier == 0 || (stateMask & modifier) == modifier)
            return -1;
        stateMask = stateMask | modifier;
    }
    return stateMask;
}
Also used : StringTokenizer(com.ibm.icu.util.StringTokenizer) Point(org.eclipse.swt.graphics.Point)

Example 22 with StringTokenizer

use of com.ibm.icu.util.StringTokenizer in project webtools.sourceediting by eclipse.

the class BeanInfoProvider method getTypeQualifiedName.

/**
 * @param typeName
 * @return a Qualified name with the package as the qualifier, and class name as LocalName
 */
private QualifiedName getTypeQualifiedName(String typeName) {
    // $NON-NLS-1$
    StringTokenizer st = new StringTokenizer(typeName, ".", false);
    int length = st.countTokens();
    int count = 0;
    StringBuffer root = new StringBuffer();
    while (count++ < length - 1) {
        root.append(st.nextToken());
        if (count < length - 1)
            root.append('.');
    }
    return new QualifiedName(root.toString(), st.nextToken());
}
Also used : StringTokenizer(com.ibm.icu.util.StringTokenizer) QualifiedName(org.eclipse.core.runtime.QualifiedName)

Example 23 with StringTokenizer

use of com.ibm.icu.util.StringTokenizer in project webtools.sourceediting by eclipse.

the class Logger method _trace.

/**
 * Prints message to log if category matches /debug/tracefilter option.
 *
 * @param message
 *            text to print
 * @param category
 *            category of the message, to be compared with
 *            /debug/tracefilter
 */
protected static void _trace(String category, String message, Throwable exception) {
    if (!isDebugging())
        return;
    String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
    if (traceFilter != null) {
        // $NON-NLS-1$
        StringTokenizer tokenizer = new StringTokenizer(traceFilter, ",");
        while (tokenizer.hasMoreTokens()) {
            String cat = tokenizer.nextToken().trim();
            if (category.equals(cat)) {
                Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
                Bundle bundle = Platform.getBundle(PLUGIN_ID);
                if (bundle != null)
                    Platform.getLog(bundle).log(statusObj);
                return;
            }
        }
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) StringTokenizer(com.ibm.icu.util.StringTokenizer) Bundle(org.osgi.framework.Bundle)

Example 24 with StringTokenizer

use of com.ibm.icu.util.StringTokenizer in project webtools.sourceediting by eclipse.

the class Logger method _trace.

/**
 * Prints message to log if category matches /debug/tracefilter option.
 *
 * @param message
 *            text to print
 * @param category
 *            category of the message, to be compared with
 *            /debug/tracefilter
 */
protected static void _trace(String category, String message, Throwable exception) {
    if (!isDebugging())
        return;
    String traceFilter = Platform.getDebugOption(PLUGIN_ID + TRACEFILTER_LOCATION);
    if (traceFilter != null) {
        // $NON-NLS-1$
        StringTokenizer tokenizer = new StringTokenizer(traceFilter, ",");
        while (tokenizer.hasMoreTokens()) {
            String cat = tokenizer.nextToken().trim();
            if (category.equals(cat)) {
                Status statusObj = new Status(IStatus.OK, PLUGIN_ID, IStatus.OK, message, exception);
                Bundle bundle = Platform.getBundle(PLUGIN_ID);
                if (bundle != null)
                    Platform.getLog(bundle).log(statusObj);
                return;
            }
        }
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) StringTokenizer(com.ibm.icu.util.StringTokenizer) Bundle(org.osgi.framework.Bundle)

Example 25 with StringTokenizer

use of com.ibm.icu.util.StringTokenizer in project webtools.sourceediting by eclipse.

the class NamespaceAttributeVisitor method visitXSISchemaLocationAttribute.

public void visitXSISchemaLocationAttribute(Attr attr, String value) {
    StringTokenizer st = new StringTokenizer(value);
    while (true) {
        String nsURI = st.hasMoreTokens() ? st.nextToken() : null;
        String locationHint = st.hasMoreTokens() ? st.nextToken() : null;
        if (nsURI != null && locationHint != null) {
            visitXSISchemaLocationValuePair(nsURI, locationHint);
        } else {
            break;
        }
    }
}
Also used : StringTokenizer(com.ibm.icu.util.StringTokenizer)

Aggregations

StringTokenizer (com.ibm.icu.util.StringTokenizer)53 ArrayList (java.util.ArrayList)9 List (java.util.List)6 HashSet (java.util.HashSet)4 IDOMAttr (org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr)4 Attr (org.w3c.dom.Attr)4 Set (java.util.Set)3 Point (org.eclipse.swt.graphics.Point)3 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)3 InputStream (java.io.InputStream)2 Iterator (java.util.Iterator)2 Pattern (java.util.regex.Pattern)2 IFile (org.eclipse.core.resources.IFile)2 IProject (org.eclipse.core.resources.IProject)2 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)2 IDocument (org.eclipse.jface.text.IDocument)2