in org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistRepositoryQueryPage.java [64:112]
public void createControl(Composite parent) {
Composite displayArea = new Composite(parent, SWT.NONE);
initializeDialogUnits(displayArea);
GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false)
.applyTo(displayArea);
GridDataFactory.fillDefaults().grab(true, true).applyTo(displayArea);
ModifyListener completeListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setPageComplete(isPageComplete());
}
};
if (!inSearchContainer()) {
new Label(displayArea, SWT.NONE)
.setText(Messages.GistRepositoryQueryPage_LabelTitle);
titleText = new Text(displayArea, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().grab(true, false).applyTo(titleText);
titleText.addModifyListener(completeListener);
titleText.setFocus();
}
new Label(displayArea, SWT.NONE)
.setText(Messages.GistRepositoryQueryPage_LabelUser);
userText = new Text(displayArea, SWT.SINGLE | SWT.BORDER);
GridDataFactory.fillDefaults().grab(true, false).applyTo(userText);
userText.addModifyListener(completeListener);
IRepositoryQuery query = getQuery();
if (query != null) {
if (titleText != null && query.getSummary() != null)
titleText.setText(query.getSummary());
if (query.getAttribute(IGistQueryConstants.USER) != null)
userText.setText(query.getAttribute(IGistQueryConstants.USER));
} else if (!inSearchContainer() && !hasQueries()) {
titleText.setText(Messages.GistRepositoryQueryPage_TitleDefault);
AuthenticationCredentials credentials = getTaskRepository()
.getCredentials(AuthenticationType.REPOSITORY);
if (credentials != null)
userText.setText(credentials.getUserName());
}
Dialog.applyDialogFont(displayArea);
setControl(displayArea);
setPageComplete(isPageComplete());
}