@Override protected boolean approximatelyHasRoots(final VcsContext dataContext) { final FilePath[] paths = dataContext.getSelectedFilePaths(); if (paths.length == 0) return false; final FileStatusManager fsm = FileStatusManager.getInstance(dataContext.getProject()); for (final FilePath path : paths) { VirtualFile file = path.getVirtualFile(); if (file == null) { continue; } FileStatus status = fsm.getStatus(file); if (isApplicableRoot(file, status, dataContext)) { return true; } } return false; }
private String getCheckinActionName(final VcsContext dataContext) { final Project project = dataContext.getProject(); if (project == null) return VcsBundle.message("vcs.command.name.checkin"); final AbstractVcs vcs = getCommonVcsFor(getRoots(dataContext), project); if (vcs == null) { return VcsBundle.message("vcs.command.name.checkin"); } else { final CheckinEnvironment checkinEnvironment = vcs.getCheckinEnvironment(); if (checkinEnvironment == null) { return VcsBundle.message("vcs.command.name.checkin"); } return checkinEnvironment.getCheckinOperationName(); } }
@Override protected FilePath[] getRoots(final VcsContext context) { return context.getSelectedFilePaths(); }