use of com.intellij.openapi.vcs.checkout.CheckoutStrategy in project intellij-community by JetBrains.
the class ChooseCheckoutMode method rebuildList.
private void rebuildList() {
final File selected = myCvsPaths.iterator().next();
setStepTitle(CvsBundle.message("dialog.title.check.out.to", selected));
myCheckoutModeModel.removeAllElements();
final boolean forFile = getWizard().getSelectedElements()[0] instanceof CvsFile;
final CheckoutStrategy[] strategies = CheckoutStrategy.createAllStrategies(mySelectedLocation, selected, forFile);
final Collection<File> results = new HashSet();
final List<CheckoutStrategy> resultModes = new ArrayList();
for (CheckoutStrategy strategy : strategies) {
final File resultFile = strategy.getResult();
if (resultFile != null && !results.contains(resultFile)) {
results.add(resultFile);
resultModes.add(strategy);
}
}
Collections.sort(resultModes);
for (CheckoutStrategy resultMode : resultModes) {
myCheckoutModeModel.addElement(resultMode);
}
myCheckoutModeList.setSelectedIndex(0);
}
use of com.intellij.openapi.vcs.checkout.CheckoutStrategy in project intellij-community by JetBrains.
the class CheckoutOptionsDialog method fillTargetList.
private void fillTargetList(final File target) {
final DefaultListModel listModel = new DefaultListModel();
final List<CheckoutStrategy> strategies = new ArrayList<>();
Collections.addAll(strategies, CheckoutStrategy.createAllStrategies(target, new File(myRelativePath), false));
strategies.add(new SvnTrunkCheckoutStrategy(target, new File(myRelativePath), false));
final List<File> targets = new ArrayList<>(5);
for (CheckoutStrategy strategy : strategies) {
final File result = strategy.getResult();
if (result != null && (!targets.contains(result))) {
targets.add(result);
}
}
Collections.sort(targets);
for (File file : targets) {
listModel.addElement(file);
}
myLocalTargetList.setModel(listModel);
myLocalTargetList.setVisibleRowCount(4);
myLocalTargetList.setPreferredSize(new Dimension(20, 80));
myLocalTargetList.setMinimumSize(new Dimension(20, 80));
myLocalTargetList.setSelectedValue(target, true);
if (myLocalTargetList.getSelectedValues() == null && (!targets.isEmpty())) {
myLocalTargetList.setSelectedIndex(0);
}
}
Aggregations