Package com.intellij.openapi.project

Examples of com.intellij.openapi.project.Project


    public boolean displayTextInToolbar() {
        return true;
    }

    public void actionPerformed(final AnActionEvent pEvent) {
        final Project project = getProject(pEvent);
        final PomRepoManager mgr = PomRepoManager.getInstance(project);
        final String repoUrl = mgr.selectDestinationRepo(DLG_TITLE, DLG_LABEL);
        if (repoUrl == null)
            return;
View Full Code Here


                                                project);
    }

    @Override
    public void update(final AnActionEvent pEvent) {
        final Project project = getProject(pEvent);
        if (project == null)
            pEvent.getPresentation().setEnabled(false);
        else {
            final int selectedItemsCount = browser.getSelectedItemsCount();
            pEvent.getPresentation().setEnabled(selectedItemsCount > 0);
View Full Code Here

    private PsiProject createParent() {
        final VirtualFile parentFile = getParentFile();
        if (parentFile == null)
            return null;

        final Project project = xmlFile.getProject();
        return new DefaultPsiProject(PsiUtils.findXmlFile(project, parentFile));
    }
View Full Code Here

*/
public class ToggleAutoscrollToSourceAction extends ToggleAction
{
  public boolean isSelected(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project == null)
    {
      return false;
    }

View Full Code Here

    return revuWorkspaceSettings.isAutoScrollToSource();
  }

  public void setSelected(AnActionEvent e, boolean state)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project == null)
    {
      return;
    }

    RevuWorkspaceSettingsComponent settingsComponent = project.getComponent(RevuWorkspaceSettingsComponent.class);
    RevuWorkspaceSettings settings = settingsComponent.getState();

    settings.setAutoScrollToSource(!settings.isAutoScrollToSource());
    settingsComponent.loadState(settings);
  }
View Full Code Here

  public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)
  {
    Issue issue = (Issue) source;

    Project project = getProject(context);

    if (issue.getFile() != null)
    {
      String filePath = RevuVfsUtils.buildRelativePath(project, issue.getFile());
      writer.addAttribute("filePath", filePath);
View Full Code Here

    Review review = getReview(context);

    Issue issue = new Issue();
    issue.setReview(review);

    Project project = getProject(context);

    if (filePath != null)
    {
      VirtualFile file = RevuVfsUtils.findVFileFromRelativeFile(project, filePath);
      issue.setFile(file);
View Full Code Here

public class ExpandIssueTreeAction extends AnAction
{
  @Override
  public void actionPerformed(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project != null)
    {
      project.getComponent(RevuToolWindowManager.class).getSelectedReviewBrowsingForm().getIssueTree().expandAll();
    }
  }
View Full Code Here

public class StopReviewAction extends AnAction
{
  @Override
  public void update(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    if (project == null)
    {
      return;
    }
View Full Code Here

public class CreateIssueAction extends AbstractIssueAction
{
  @Override
  public void actionPerformed(AnActionEvent e)
  {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    Editor editor = e.getData(PlatformDataKeys.EDITOR);
    VirtualFile vFile = RevuUtils.getVirtualFile(e);

    if ((project == null) || (vFile == null))
    {
      return;
    }

    Issue issue = new Issue();
    issue.setFile(vFile);
    if (editor != null)
    {
      Document document = editor.getDocument();
      int lineStart = document.getLineNumber(editor.getSelectionModel().getSelectionStart());
      int lineEnd = document.getLineNumber(editor.getSelectionModel().getSelectionEnd());

      issue.setLineStart(lineStart);
      issue.setLineEnd(lineEnd);
      CharSequence fragment = document.getCharsSequence().subSequence(document.getLineStartOffset(lineStart),
        document.getLineEndOffset(lineEnd));
      issue.setHash(fragment.toString().hashCode());
    }
    issue.setStatus(IssueStatus.TO_RESOLVE);

    IssueDialog dialog = new IssueDialog(project, true);
    dialog.show(issue);
    if ((dialog.isOK()) && dialog.updateData(issue))
    {
      Review review = issue.getReview();

      assert (RevuUtils.getCurrentUserLogin() != null) : "Login should be set";

      issue.setHistory(RevuUtils.buildHistory(review));

      if (RevuVcsUtils.fileIsModifiedFromVcs(project, vFile))
      {
        issue.setLocalRev(String.valueOf(System.currentTimeMillis()));
      }

      if (issue.getFile() != null)
      {
        VcsRevisionNumber vcsRev = RevuVcsUtils.getVcsRevisionNumber(project, issue.getFile());
        if (vcsRev != null)
        {
          issue.setVcsRev(vcsRev.toString());
        }
      }

      review.addIssue(issue);

      ReviewManager reviewManager = project.getComponent(ReviewManager.class);
      reviewManager.saveSilently(review);
    }
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.project.Project

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.