use of org.jboss.tools.openshift.internal.common.ui.SelectProjectComponentBuilder in project jbosstools-openshift by jbosstools.
the class ApplicationSourceListPage method createEclipseProjectControls.
private IObservableValue createEclipseProjectControls(Composite parent, DataBindingContext dbc) {
IObservableValue eclipseProjectObservable = BeanProperties.value(IApplicationSourceListPageModel.PROPERTY_ECLIPSE_PROJECT).observe(model);
SelectProjectComponentBuilder builder = new SelectProjectComponentBuilder();
builder.setTextLabel("Use existing workspace project:").setRequired(false).setEclipseProjectObservable(eclipseProjectObservable).setSelectionListener(onBrowseProjects()).setButtonIndent(0).build(parent, dbc);
Link gitLabel = new Link(parent, SWT.NONE);
gitLabel.setText("The project needs to be <a>shared with Git</a> and have a remote repository accessible by OpenShift");
gitLabel.addSelectionListener(onClickEGitLink());
GridDataFactory.fillDefaults().span(3, 1).applyTo(gitLabel);
DataBindingUtils.addDisposableValueChangeListener(new IValueChangeListener() {
@Override
public void handleValueChange(ValueChangeEvent event) {
org.eclipse.core.resources.IProject p = (org.eclipse.core.resources.IProject) event.getObservableValue().getValue();
toggleEgitLink(gitLabel, p);
}
}, eclipseProjectObservable, gitLabel);
toggleEgitLink(gitLabel, model.getEclipseProject());
return builder.getProjectNameTextObservable();
}
use of org.jboss.tools.openshift.internal.common.ui.SelectProjectComponentBuilder in project jbosstools-openshift by jbosstools.
the class ServerSettingsWizardPage method createProjectControls.
private void createProjectControls(Composite parent, ServerSettingsWizardPageModel model, DataBindingContext dbc) {
@SuppressWarnings("unchecked") IObservableValue<IProject> eclipseProjectObservable = BeanProperties.value(ServerSettingsWizardPageModel.PROPERTY_DEPLOYPROJECT).observe(model);
new SelectProjectComponentBuilder().setTextLabel("Eclipse Project: ").setEclipseProjectObservable(eclipseProjectObservable).setSelectionListener(onBrowseProjects(model, parent.getShell())).build(parent, dbc);
Button importButton = new Button(parent, SWT.PUSH);
importButton.setText(OpenShiftCommonUIMessages.ImportButtonLabel);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(importButton);
UIUtils.setDefaultButtonWidth(importButton);
importButton.addSelectionListener(onImportProject(model, parent.getShell()));
}
Aggregations