fSiteInput = new Text(composite, SWT.BORDER | SWT.SINGLE);
fSiteInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
fSiteInput.setText(URIUtils.HTTP);
fSiteInput.setSelection(URIUtils.HTTP.length());
fSiteInput.setFocus();
fSiteInput.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateOkButton();
}
});
/* Show UI Hint for extra information is available */
final Pair<SimpleContentProposalProvider, ContentProposalAdapter> pair = OwlUI.hookAutoComplete(fSiteInput, null, true, true);
/* Load proposals in the Background */
JobRunner.runInBackgroundThread(100, new Runnable() {
public void run() {
if (!fSiteInput.isDisposed()) {
Set<String> values = new TreeSet<String>(new Comparator<String>() {
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
});
values.addAll(CoreUtils.getFeedLinks());
/* Remember for Validation */
fFeedLinks = new HashSet<String>(values);
/* Apply Proposals */
if (!fSiteInput.isDisposed()) {
OwlUI.applyAutoCompleteProposals(values, pair.getFirst(), pair.getSecond());
pair.getSecond().setAutoActivationCharacters(new char[] { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '/', '.' });
}
}
}
});
/* Username */
Label usernameLabel = new Label(composite, SWT.None);
usernameLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
usernameLabel.setText(Messages.AddCredentialsDialog_USERNAME);
fUsernameInput = new Text(composite, SWT.BORDER | SWT.SINGLE);
fUsernameInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
fUsernameInput.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateOkButton();
}
});
/* Password */
Label passwordLabel = new Label(composite, SWT.None);
passwordLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
passwordLabel.setText(Messages.AddCredentialsDialog_PASSWORD);
fPasswordInput = new Text(composite, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
fPasswordInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
fPasswordInput.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateOkButton();
}
});