Example usage for org.eclipse.jdt.core.search IJavaSearchScope JAR_FILE_ENTRY_SEPARATOR

List of usage examples for org.eclipse.jdt.core.search IJavaSearchScope JAR_FILE_ENTRY_SEPARATOR

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.search IJavaSearchScope JAR_FILE_ENTRY_SEPARATOR.

Prototype

String JAR_FILE_ENTRY_SEPARATOR

To view the source code for org.eclipse.jdt.core.search IJavaSearchScope JAR_FILE_ENTRY_SEPARATOR.

Click Source Link

Document

This constant defines the separator of the resourcePath string of the encloses(String) method.

Usage

From source file:de.loskutov.anyedit.jdt.TypeFactory.java

License:Open Source License

/**
 * Will be called at most two times if the return value was not null.
 * @param searchScope//  w w w  .j a v  a 2  s . c  om
 * @param found true if we do not really need a second type, if second exists, we could just
 * return any non-null value.
 */
public IType create(char[] packageName, char[] simpleTypeName1, char[][] enclosingName, int modifiers,
        String path, IJavaSearchScope searchScope, boolean found) {
    this.enclosingNames = enclosingName;
    this.simpleTypeName = new String(simpleTypeName1);
    String pn = new String(packageName);

    int index = path.indexOf(IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR.charAt(0));
    IType result = null;
    if (index != -1) {
        result = createJarFileEntryTypeInfo(pn, simpleTypeName, enclosingName, modifiers, path, index,
                searchScope);
    } else {
        String project = getProject(path);
        if (project != null) {
            result = createIFileTypeInfo(pn, simpleTypeName, enclosingName, modifiers, path, project,
                    searchScope);
        }
    }
    return result;
}

From source file:de.loskutov.bco.ui.TypeFactory.java

License:Open Source License

/**
 * Will be called at most two times if the return value was not null.
 * @param searchScope/*from  w  ww  .ja  v a 2 s  .c o m*/
 * return any non-null value.
 */
public IType create(char[] packageName, char[] simpleTypeName1, char[][] enclosingName, int modifiers,
        String path, IJavaSearchScope searchScope) {
    this.enclosingNames = enclosingName;
    this.simpleTypeName = new String(simpleTypeName1);
    String pn = new String(packageName);

    int index = path.indexOf(IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR);
    IType result = null;
    if (index != -1) {
        result = createJarFileEntryTypeInfo(pn, simpleTypeName, enclosingName, modifiers, path, index,
                searchScope);
    } else {
        String project = getProject(path);
        if (project != null) {
            result = createIFileTypeInfo(pn, simpleTypeName, enclosingName, modifiers, path, project,
                    searchScope);
        }
    }
    return result;
}

From source file:org.eclipse.stardust.modeling.validation.util.TypeRequestor.java

License:Open Source License

public synchronized void acceptType(int modifiers, char[] packageName, char[] simpleTypeName,
        char[][] enclosingTypeNames, String path) {
    if (!stopped) {
        if (matches(modifiers, simpleTypeName, enclosingTypeNames)) {
            StringBuffer qualifiedName = new StringBuffer();
            for (int i = 0; i < enclosingTypeNames.length; i++) {
                qualifiedName.append(enclosingTypeNames[i]).append('.');
            }/*ww  w .j av  a2s.com*/
            qualifiedName.append(simpleTypeName);
            IType result = null;
            IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot());
            int index = path.indexOf(IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR);
            try {
                if (index != -1) {
                    result = getJarIType(model, packageName, qualifiedName.toString(), path, index);
                } else {
                    result = getFileIType(model, packageName, qualifiedName.toString(), path);
                }
            } catch (JavaModelException e) {
            }
            if (result != null) {
                listener.typeFound(result);
            }
        }
    }
}

From source file:repast.simphony.agents.designer.ui.editors.JarEntryEditorInput.java

License:Open Source License

public JarEntryEditorInput(String pathStr) {
    int jarSepPos = pathStr.indexOf(IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR);
    String archiveName = pathStr.substring(0, jarSepPos);
    String entryName = pathStr.substring(jarSepPos + 1);

    jarEntry = new JarEntry(archiveName, entryName);
}