setSpec(getSpec().setSource(sourceText.getText()));
}
});
// content assist for source
UIUtils.addRefContentProposalToText(sourceText, repo,
new IRefListProvider() {
public List<Ref> getRefList() {
return assistProvider.getRefsForContentAssist(true, pushMode);
}
});
// suggest remote tracking branch
if (!pushMode) {
final Button autoSuggest = new Button(main, SWT.CHECK);
GridDataFactory.fillDefaults().span(2, 1).applyTo(autoSuggest);
autoSuggest.setText(UIText.RefSpecDialog_AutoSuggestCheckbox);
autoSuggest.setSelection(true);
autoSuggest.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
autoSuggestDestination = autoSuggest.getSelection();
}
});
}
// destination
Label destinationLabel = new Label(main, SWT.NONE);
if (pushMode)
destinationLabel.setText(UIText.RefSpecDialog_DestinationPushLabel);
else
destinationLabel
.setText(UIText.RefSpecDialog_DestinationFetchLabel);
destinationText = new Text(main, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true,
false).applyTo(destinationText);
if (spec != null && spec.getDestination() != null)
destinationText.setText(spec.getDestination());
destinationText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (destinationText.isFocusControl())
setSpec(getSpec().setDestination(destinationText.getText()));
}
});
// content assist for destination
UIUtils.addRefContentProposalToText(destinationText, repo,
new IRefListProvider() {
public List<Ref> getRefList() {
return assistProvider.getRefsForContentAssist(false, pushMode);
}
});