Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IPath.toFile()


      throws CoreException {

    if( element instanceof IPathEditorInput ) {
      IPathEditorInput pei = ( IPathEditorInput )element;
      IPath path = pei.getPath();
      File file = path.toFile();

      try {
        file.createNewFile();

        if( file.exists() ) {
View Full Code Here


      location = location.removeFirstSegments(2);
      String path = location.toString();
      if (!path.startsWith("/"))
        path += "/" + path;
      try {
        ImageIcon icon = new ImageIcon(location.toFile()
            .toURI().toURL());
        final ResourceIcon srcIcon = new ResourceIcon(icon, path);
        SwingUtilities.invokeLater(new Runnable(){
         
          public void run() {
View Full Code Here

        createExternalFoldersProject(project, monitor);
      } else {
        // .project or folder on disk have been deleted, recreate them
        IPath stateLocation = JavaCore.getPlugin().getStateLocation();
        IPath projectPath = stateLocation.append(EXTERNAL_PROJECT_NAME);
        projectPath.toFile().mkdirs();
        try {
            FileOutputStream output = new FileOutputStream(projectPath.append(".project").toOSString()); //$NON-NLS-1$
            try {
                output.write((
                    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + //$NON-NLS-1$
View Full Code Here

          if (type.equals(LOOK_AND_FEEL_EXT)) {
            IPath path = LookAndFeelLib.getLafLibDir();
            if (count > 2) {
              String libDir = containerPath.segment(2);
              path = path.append(libDir);
              File folder = path.toFile();
              if (folder.exists()) {
                return LookAndFeelLib.getLnfLib(libDir);
              }
            }
          }
View Full Code Here

      String propertyName, Object data) throws CoreException {
    initLafLibs();   
  }
  private void initLafLibs() {
    IPath path = LookAndFeelLib.getLafLibDir();
    File folder = path.toFile();
    if (folder.exists()) {
      File[] folders = folder.listFiles(new FileFilter() {
        public boolean accept(File pathname) {
          return pathname.isDirectory();
        }
View Full Code Here

    path = path.append(LookAndFeelLibrary.LOOK_AND_FEEL_LIB_DIR);
    return path;
  }
  private void initLaf(IPath path) {
    IPath laf_path = path.append(LAF_FILE);
    File laf_file = laf_path.toFile();
    if (laf_file.exists()) {
      try {
        DocumentBuilderFactory factory = DocumentBuilderFactory
            .newInstance();
        DocumentBuilder newDocumentBuilder = factory
View Full Code Here

    PrintWriter pw = null;
    try {
      IPath path = LookAndFeelLib.getLafLibDir();
      String hintID = translateDir(lafName);
      path = path.append(hintID);
      File folder = path.toFile();
      if (!folder.exists())
        folder.mkdirs();
      File lafFile = new File(folder, "laf.xml");       //$NON-NLS-1$
      pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(lafFile),"UTF-8")); //$NON-NLS-1$
      pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
View Full Code Here

    IPath path = Platform.getLocation();
    path = path.append(".metadata"); //$NON-NLS-1$
    path = path.append(".plugins"); //$NON-NLS-1$
    path = path.append(VisualSwingPlugin.getPluginID());
    path = path.append("layoutext");     //$NON-NLS-1$
    File folder = path.toFile();
    if (!folder.exists())
      folder.mkdirs();   
    File jar = new File(folder, "grouplayout.jar"); //$NON-NLS-1$
    File src = new File(folder, "grouplayout.zip"); //$NON-NLS-1$
    if (!jar.exists()) {
View Full Code Here

        }
        IPath outputRoot = outLocations.get(srcRoot);
        int firstSegments = path.matchingFirstSegments(srcRoot);
        // add relative path to the output path
        IPath out = outputRoot.append(path.removeFirstSegments(firstSegments));
        File directory = out.toFile();
        return fbProject.addFile(directory.getAbsolutePath());
        // TODO child directories too. Should add preference???
    }

    private void addClassesForFile(IFile file, Map<IPath, IPath> outLocations, Project fbProject) {
View Full Code Here

    public boolean isFromArchive() {
        IPath path = getPath();
        if (path == null) {
            return false;
        }
        File file = path.toFile();
        if (file.isDirectory()) {
            return false;
        }
        return Archive.isArchiveFileName(file.getName());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.