use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class AbstractAuthenticator method getWithActive.
protected boolean getWithActive(SvnAuthenticationManager active) throws SVNException {
MessageBusConnection connection = null;
try {
final Project project = myVcs.getProject();
connection = project.getMessageBus().connect(project);
connection.subscribe(SvnAuthenticationManager.AUTHENTICATION_PROVIDER_LISTENER, new MyAuthenticationProviderListener());
makeAuthCall(active);
} finally {
if (connection != null) {
connection.disconnect();
}
}
return afterAuthCall();
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class ShareWholeProject method actionPerformed.
public void actionPerformed(AnActionEvent e) {
final MyChecker checker = new MyChecker();
checker.execute(e);
if (!checker.isEnabled())
return;
final Project project = checker.getProject();
final VirtualFile baseDir = project.getBaseDir();
if (baseDir == null)
return;
boolean success = false;
boolean excThrown = false;
try {
success = ShareProjectAction.share(project, baseDir);
} catch (VcsException exc) {
AbstractVcsHelper.getInstance(project).showError(exc, "Failed to Share Project");
excThrown = true;
} finally {
// if success = false -> either action was cancelled or exception was thrown, so also check for exception
if (success || excThrown) {
baseDir.refresh(true, true, () -> ApplicationManager.getApplication().invokeLater(() -> {
VcsDirtyScopeManager.getInstance(project).dirDirtyRecursively(project.getBaseDir());
if (checker.isHadNoMappings() && SvnUtil.seemsLikeVersionedDir(baseDir)) {
final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
vcsManager.setDirectoryMappings(Arrays.asList(new VcsDirectoryMapping("", SvnVcs.VCS_NAME)));
}
}, ModalityState.NON_MODAL, project.getDisposed()));
}
}
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class ConfigureBranchesAction method update.
public void update(final AnActionEvent e) {
final Project project = e.getProject();
final Presentation presentation = e.getPresentation();
if (project == null) {
presentation.setEnabled(false);
presentation.setVisible(false);
return;
}
presentation.setText(SvnBundle.message("configure.branches.item"));
presentation.setDescription(SvnBundle.message("configure.branches.item"));
presentation.setIcon(SvnIcons.ConfigureBranches);
presentation.setVisible(true);
final ChangeList[] cls = e.getData(VcsDataKeys.CHANGE_LISTS);
presentation.setEnabled((cls != null) && (cls.length > 0) && (SvnVcs.getInstance(project).getName().equals(((CommittedChangeList) cls[0]).getVcs().getName())) && (((SvnChangeList) cls[0]).getRoot() != null));
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class ConfigureBranchesAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final Project project = e.getProject();
final ChangeList[] cls = e.getData(VcsDataKeys.CHANGE_LISTS);
if ((cls == null) || (cls.length == 0) || (!SvnVcs.getInstance(project).getName().equals(((CommittedChangeList) cls[0]).getVcs().getName())) || (((SvnChangeList) cls[0]).getRoot() == null)) {
return;
}
final SvnChangeList svnList = (SvnChangeList) cls[0];
BranchConfigurationDialog.configureBranches(project, svnList.getRoot());
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class TestNGUtil method inheritsITestListener.
public static boolean inheritsITestListener(@NotNull PsiClass psiClass) {
final Project project = psiClass.getProject();
final PsiClass aListenerClass = JavaPsiFacade.getInstance(project).findClass(ITestNGListener.class.getName(), GlobalSearchScope.allScope(project));
return aListenerClass != null && psiClass.isInheritor(aListenerClass, true);
}
Aggregations