use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.
the class ToggleOfflineAction method isSelected.
public boolean isSelected(AnActionEvent e) {
CvsContext cvsContext = CvsContextWrapper.createInstance(e);
if (!cvsContext.cvsIsActive())
return false;
VirtualFile root = cvsContext.getSelectedFile();
if (root == null)
return false;
final VirtualFile firstDirInChain = root.isDirectory() ? root : root.getParent();
if (firstDirInChain == null)
return false;
CvsConnectionSettings settings = CvsEntriesManager.getInstance().getCvsConnectionSettingsFor(firstDirInChain);
if (settings == null)
return false;
return settings.isOffline();
}
use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.
the class ToggleOfflineAction method update.
@Override
public void update(final AnActionEvent e) {
super.update(e);
CvsContext cvsContext = CvsContextWrapper.createInstance(e);
final VirtualFile[] files = cvsContext.getSelectedFiles();
e.getPresentation().setVisible(files != null && files.length > 0 && cvsContext.cvsIsActive());
}
use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.
the class CheckoutFileAction method getCvsHandler.
protected CvsHandler getCvsHandler(CvsContext context) {
if (myModifiedFiles != null) {
if (!myModifiedFiles.isEmpty()) {
if (!new ReplaceFileConfirmationDialog(context.getProject(), CvsBundle.getCheckoutOperationName()).requestConfirmation(myModifiedFiles)) {
return CvsHandler.NULL;
}
}
}
myModifiedFiles = null;
Project project = context.getProject();
FilePath[] filesArray = context.getSelectedFilePaths();
List<FilePath> files = Arrays.asList(filesArray);
if (CvsVcs2.getInstance(project).getCheckoutOptions().getValue() || OptionsDialog.shiftIsPressed(context.getModifiers())) {
CheckoutFileDialog checkoutFileDialog = new CheckoutFileDialog(project, files);
if (!checkoutFileDialog.showAndGet()) {
return CvsHandler.NULL;
}
}
return CommandCvsHandler.createCheckoutFileHandler(filesArray, CvsConfiguration.getInstance(project), VcsConfiguration.getInstance(project).getCheckoutOption());
}
use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.
the class CreateTagAction method getCvsHandler.
protected CvsHandler getCvsHandler(CvsContext context) {
final FilePath[] selectedFiles = context.getSelectedFilePaths();
final Project project = context.getProject();
final CreateTagDialog dialog = new CreateTagDialog(selectedFiles, project, true);
if (!dialog.showAndGet()) {
return CvsHandler.NULL;
}
final boolean makeNewFilesReadOnly = CvsConfiguration.getInstance(project).MAKE_NEW_FILES_READONLY;
return CommandCvsHandler.createTagHandler(selectedFiles, dialog.getTagName(), dialog.switchToThisBranch(), dialog.getOverrideExisting(), makeNewFilesReadOnly, project);
}
use of com.intellij.cvsSupport2.actions.cvsContext.CvsContext in project intellij-community by JetBrains.
the class DeleteTagAction method getCvsHandler.
protected CvsHandler getCvsHandler(CvsContext context) {
final FilePath[] selectedFiles = context.getSelectedFilePaths();
final DeleteTagDialog deleteTagDialog = new DeleteTagDialog(selectedFiles, context.getProject());
if (!deleteTagDialog.showAndGet()) {
return CvsHandler.NULL;
}
return CommandCvsHandler.createRemoveTagAction(selectedFiles, deleteTagDialog.getTagName());
}
Aggregations