Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IJarEntryResource


            Plugin.error(e);
          }
        }
      }
      else if (obj instanceof IJarEntryResource && ((IJarEntryResource) obj).isFile()) {
        IJarEntryResource jef = (IJarEntryResource) obj;
        String namespace = jef.getName();
        int index = namespace.indexOf("."); //$NON-NLS-1$
        if (index >= 0) namespace = namespace.substring(0, index);
        InputDialog inputDialog = new InputDialog(
            shell, Messages.ConfigurationManager_TITLE_CHOOSE_NAMESPACE,
            MessageFormat.format(
                Messages.ConfigurationManager_CHOOSE_NAMESPACE_FOR, jef
                    .getName()),
            namespace, null);
        int rtn = inputDialog.open();
        if (rtn == IDialogConstants.OK_ID) {
          namespace = inputDialog.getValue();
          try {
            InputStream is = null;
            try {
              is = getProjectClassLoader().getResourceAsStream(
                  jef.getFullPath().toString());
              if (null != is) {
                this.macroLibrary.put(namespace,
                    new MacroLibrary(namespace, is, jef
                        .getFullPath().toString(),
                        MacroLibrary.TYPE_JAR_ENTRY));
              } else {
                // FIXME: add error dialog here
              }
View Full Code Here


        IPluginModel mod = (IPluginModel) sel;
        String installLocation = mod.getInstallLocation();
        return installLocation;
      }
      if(sel instanceof IJarEntryResource) {
        IJarEntryResource jar = (IJarEntryResource) sel;
         IPath fullPath = jar.getFullPath();
       
         return fullPath.makeAbsolute().toOSString();
      }
     
      if (sel instanceof IAdaptable) {
View Full Code Here

    private static IEditorInput findEditorInput(IPackageFragmentRoot packageFragmentRoot, IPackageFragment packageFragment, String searchedPackage, String searchedFileName) throws JavaModelException {
      if (packageFragment.exists()
          && packageFragment.getElementName().equals(searchedPackage)) {
        for (Object njr: packageFragment.isDefaultPackage() ? packageFragmentRoot.getNonJavaResources() : packageFragment.getNonJavaResources()) {
          if (njr instanceof IJarEntryResource) {
            IJarEntryResource jer = (IJarEntryResource) njr;
            if (jer.getName().equals(searchedFileName)) {
              return new JarEntryEditorInput(jer);
            }
          } else if (njr instanceof IFile) {
            IFile file = (IFile) njr;
            if (file.getName().equals(searchedFileName)) {
View Full Code Here

      return null;
   
    String filePath = doc.getFilePath();
    IPath path = new Path(filePath);
   
    IJarEntryResource res  = null;
    for(String segment: path.segments())
    {
      if( res == null )
        res = findJarEntry(jar, segment);
      else
        res = findJarEntry(res.getChildren(), segment);
    }
   
    return res;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IJarEntryResource

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.