private void revalidate(RepositorySelection repoSelection, List<Ref> branches, Ref head) { if (repoSelection.equals(validatedRepoSelection) && branches.equals(validatedSelectedBranches) && head.equals(validatedHEAD)) { checkPage(); return; } if (!repoSelection.equals(validatedRepoSelection)) { validatedRepoSelection = repoSelection; // update repo-related selection only if it changed final String n = validatedRepoSelection.getURI().getHumanishName(); setDescription(NLS.bind(UIText.CloneDestinationPage_description, n)); directoryText.setText( new File(ResourcesPlugin.getWorkspace().getRoot().getRawLocation().toFile(), n) .getAbsolutePath()); } validatedSelectedBranches = branches; validatedHEAD = head; initialBranch.removeAll(); final Ref actHead = head; int newix = 0; for (final Ref r : branches) { String name = r.getName(); if (name.startsWith(Constants.R_HEADS)) name = name.substring((Constants.R_HEADS).length()); if (actHead != null && actHead.getName().equals(r.getName())) newix = initialBranch.getItemCount(); initialBranch.add(name); } initialBranch.select(newix); checkPage(); }
private void checkPreviousPagesSelections( RepositorySelection repositorySelection, List<Ref> branches, Ref head) { if (!repositorySelection.equals(validatedRepoSelection) || !branches.equals(validatedSelectedBranches) || !head.equals(validatedHEAD)) setPageComplete(false); else checkPage(); }