Package com.intellij.openapi.vfs

Examples of com.intellij.openapi.vfs.VirtualFile


    }

    public void reset() {
        final MavenManager mavenMgr = MavenManager.getInstance();

        final VirtualFile mavenHome = mavenMgr.getMavenHome();
        ui.mavenHomeField.setText(mavenHome == null ? null : mavenHome.getPresentableUrl());
        ui.mavenOptionsField.setText(mavenMgr.getMavenOptions());
        ui.offlineCheckBox.setSelected(mavenMgr.isOffline());
    }
View Full Code Here


                    FileChooserDescriptorFactory.createSingleFolderDescriptor());


            guessMavenHomeButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    final VirtualFile home = MavenManager.getInstance().guessMavenHome();
                    if (home != null && home.isValid() && home.isDirectory() && FileUtils.exists(
                            home))
                        mavenHomeField.setText(home.getPresentableUrl());
                }
            });

            //layout components
            final String cols = "right:min, 2dlu, fill:min:grow, 2dlu, fill:min";
View Full Code Here

        final Artifact[] pomLibs = PomUtils.getPomClassPathArtifacts(pModule.getProject(), pPomUrl);
        final VirtualFile[] ideaLibs = ModuleUtils.getModuleClasspath(pModule);

        final PomRepoManager repoMgr = PomRepoManager.getInstance(pModule.getProject());
        for (Artifact artifact : pomLibs) {
            final VirtualFile file = repoMgr.findFile(pPomUrl, artifact);
            if (file == null || !file.isValid() || !FileUtils.exists(file))
                continue;

            boolean found = false;
            for (VirtualFile ideaFile : ideaLibs)
                if (ideaFile.isValid() && ideaFile.equals(file) && FileUtils.exists(ideaFile)) {
View Full Code Here

        public boolean isValid() {
            if (!PomUtils.isArtifactDeclared(getProject(), pomUrl, artifact))
                return false;

            final PomRepoManager repoMgr = PomRepoManager.getInstance(getProject());
            final VirtualFile file = repoMgr.findFile(pomUrl, artifact);
            if (file == null || !file.isValid() || !FileUtils.exists(file))
                return false;

            return !ModuleUtils.isFileInClasspath(module, file);
        }
View Full Code Here

            //find the local repository - if the file is not under the
            //local repo, we cannot derive the group and artifact ids,
            //and therefor we cannot fix the problem (return empty array)
            //
            final PomRepoManager pomMgr = PomRepoManager.getInstance(module.getProject());
            final VirtualFile localRepo = pomMgr.getLocalRepositoryDirectory(pPomUrl);
            if (localRepo != null && VfsUtil.isAncestor(localRepo, libraryFile, true)) {
                addFixAction(new AddLibraryToPomAction(this, module));
                addFixAction(new RemoveLibraryFromModuleAction(this, module));
            }
        }
View Full Code Here

    /**
     * @todo would be nice to show a dialog to let the user verify the new dependency details
     */
    public void actionPerformed(AnActionEvent e) {
        final VirtualFile typeDir = problem.getFile().getParent();
        if (typeDir == null)
            return;

        final VirtualFile groupDir = typeDir.getParent();
        if (groupDir == null)
            return;

        final String groupId = groupDir.getName();
        final String artifactId;
        final String version;

        String type = typeDir.getName();
        if (type.endsWith("s"))
View Full Code Here

                            text = name;
                    }
                }
                else {
                    label.setForeground(Color.RED);
                    final VirtualFile projectFile = project.getProjectFile();
                    if (projectFile != null) {
                        final VirtualFile projectDir = projectFile.getParent();
                        if (projectDir != null) {
                            final String projectPath = projectDir.getPresentableUrl();
                            if (url.toLowerCase().startsWith(projectPath.toLowerCase()))
                                text = url.substring(projectPath.length());
                        }
                    }
                }
View Full Code Here

     * Returns the document (not the xml document).
     *
     * @return idea document
     */
    public final Document getDocument() {
        final VirtualFile virtualFile = file.getVirtualFile();
        final FileDocumentManager fileMgr = FileDocumentManager.getInstance();
        return fileMgr.getDocument(virtualFile);
    }
View Full Code Here

    }

    private void navigateToSource(final PomNode pPomNode) {
        final PomManager pomMgr = PomManager.getInstance(project);
        final String url = pPomNode.getUserObject();
        final VirtualFile pomFile = pomMgr.getFile(url);
        if (pomFile == null || !pomFile.isValid() || pomFile.isDirectory() || !FileUtils.exists(
                pomFile))
            return;

        final OpenFileDescriptor desc = new OpenFileDescriptor(project, pomFile);
        if (desc.canNavigateToSource())
View Full Code Here

        if (desc.canNavigateToSource())
            desc.navigate(true);
    }

    public void navigateToSource(final PluginNode pNode) {
        final VirtualFile script = getGoalContainerFile(pNode);
        if (script == null || !script.isValid() || !FileUtils.exists(script))
            return;

        final OpenFileDescriptor desc = new OpenFileDescriptor(project, script);
        if (desc.canNavigateToSource())
            desc.navigate(true);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vfs.VirtualFile

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.