/** * Tests whether a file or directory should receive the STATUS_NOTVERSIONED_NOTMANAGED status. * All files and folders that have a parent with CVS/Repository file are considered versioned. * * @param file a file or directory * @return false if the file should receive the STATUS_NOTVERSIONED_NOTMANAGED status, true otherwise */ public boolean isManaged(File file) { return VersioningSupport.getOwner(file) instanceof MercurialVCS && !HgUtils.isPartOfMercurialMetadata(file); }
private List<SharedItem> getInitialItems(Node [] nodes) { List<SharedItem> items = new ArrayList<SharedItem>(); for (Node node : nodes) { Project prj = node.getLookup().lookup(Project.class); if (prj != null) { File file = FileUtil.toFile(prj.getProjectDirectory()); if (VersioningSupport.getOwner(file) == null) { items.add(new SharedItem(file)); } } } return items; }
private void choose(JFileChooser chooser) { chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setMultiSelectionEnabled(true); int returnVal = chooser.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { File [] selFiles = chooser.getSelectedFiles(); outter: for (File file : selFiles) { for (SharedItem item : itemsToShare) { if (item.getRoot().equals(file)) { continue outter; } } if (VersioningSupport.getOwner(file) == null) { SharedItem item = new SharedItem(file); itemsToShare.add(item); } } itemsToShareModel.fireContentsChanged(); updateRepoPath(); } }
kenaiPopup.addSeparator(); VersioningSystem owner = VersioningSupport.getOwner(FileUtil.toFile(proj.getProjectDirectory())); if (owner == null) Logger.getLogger(KenaiPopupMenu.class.getName()).log(Level.INFO, "VersioningSupport.getOwner(" + proj.getProjectDirectory() + ") returned null");
public static void actionPerformed(Node[] e) { if (e != null) { for (Node node : e) { Project prj = node.getLookup().lookup(Project.class); if (prj != null) { File file = FileUtil.toFile(prj.getProjectDirectory()); if (VersioningSupport.getOwner(file) != null) { JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(ShareAction.class, "NameAndLicenseWizardPanelGUI.versioningNotSupported", ProjectUtils.getInformation(prj).getDisplayName())); return; } } } } if (Subversion.isClientAvailable(true)) { WizardDescriptor wizardDescriptor = new WizardDescriptor(new NewKenaiProjectWizardIterator(e,Utilities.getPreferredKenai())); // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName() wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N wizardDescriptor.setTitle(NbBundle.getMessage(NewKenaiProjectAction.class, "NewKenaiProjectAction.dialogTitle")); // NOI18N DialogDisplayer.getDefault().notify(wizardDescriptor); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { Set<CreatedProjectInfo> createdProjects = wizardDescriptor.getInstantiatedObjects(); showDashboard(createdProjects); } } }