use of org.jboss.tools.openshift.internal.ui.webhooks.WebHooksDialog in project jbosstools-openshift by jbosstools.
the class ShowWebHooksHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
ISelection selection = UIUtils.getCurrentSelection(event);
IBuildConfig buildConfig = UIUtils.getFirstElement(selection, IBuildConfig.class);
if (buildConfig == null) {
return Status.OK_STATUS;
}
WebHooksDialog dialog = new WebHooksDialog(HandlerUtil.getActiveShell(event), buildConfig);
dialog.open();
return Status.OK_STATUS;
}
use of org.jboss.tools.openshift.internal.ui.webhooks.WebHooksDialog in project jbosstools-openshift by jbosstools.
the class NewApplicationSummaryFromTemplateDialog method createAreaAfterResourceSummary.
@Override
protected void createAreaAfterResourceSummary(Composite parent) {
Composite area = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(area);
GridLayoutFactory.fillDefaults().margins(10, 10).applyTo(area);
final Collection<IBuildConfig> buildConfigs = findBuildConfigsWithWebHooks();
if (!buildConfigs.isEmpty()) {
Link webHooksLink = new Link(area, SWT.NONE);
webHooksLink.setText("Click <a>here</a> to display the webhooks available to automatically trigger builds.");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(webHooksLink);
webHooksLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
WebHooksDialog dialog = new WebHooksDialog(getParentShell(), buildConfigs);
dialog.open();
}
});
}
if (job.getParameters().isEmpty()) {
return;
}
Label lblParams = new Label(area, SWT.WRAP);
lblParams.setText("Please make note of the following parameters which may include values required to administer your resources:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).hint(100, SWT.DEFAULT).grab(true, false).applyTo(lblParams);
Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.TOP).grab(true, true).applyTo(container);
GridLayoutFactory.fillDefaults().numColumns(2).margins(10, 10).equalWidth(false).applyTo(container);
Composite parameters = new Composite(container, SWT.NONE);
GridDataFactory.fillDefaults().hint(100, 200).grab(true, true).applyTo(parameters);
TableViewer viewer = createTable(parameters);
viewer.setInput(job.getParameters());
Button copyToClipboard = new Button(container, SWT.PUSH);
copyToClipboard.setImage(OpenShiftImages.COPY_TO_CLIPBOARD_IMG);
copyToClipboard.setToolTipText("Copy parameters to clipboard");
copyToClipboard.addSelectionListener(onClickCopyButton(lblParams));
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(false, false).applyTo(copyToClipboard);
}
Aggregations