use of org.eclipse.ui.dialogs.ElementListSelectionDialog in project generator by mybatis.
the class GeneratorLaunchShortcut method chooseConfiguration.
private ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> candidates) {
IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider);
dialog.setElements(candidates.toArray());
dialog.setTitle(Messages.LAUNCH_CONFIGURATION_SELECTOR_TITLE);
dialog.setMessage(Messages.LAUNCH_CONFIGURATION_SELECTOR_MESSAGE);
dialog.setMultipleSelection(false);
int result = dialog.open();
labelProvider.dispose();
if (result == Window.OK) {
return (ILaunchConfiguration) dialog.getFirstResult();
}
return null;
}
use of org.eclipse.ui.dialogs.ElementListSelectionDialog in project tdi-studio-se by Talend.
the class BusinessModelingAssistantProvider method selectElement.
/**
* @generated NOT
*/
protected EObject selectElement(EObject[] elements) {
Shell shell = Display.getCurrent().getActiveShell();
ILabelProvider labelProvider = new AdapterFactoryLabelProvider(BusinessDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
//$NON-NLS-1$
dialog.setMessage(Messages.getString("BusinessModelingAssistantProvider.AvaiableDomainModelElements"));
//$NON-NLS-1$
dialog.setTitle(Messages.getString("BusinessModelingAssistantProvider.SelectDomainModelElement"));
dialog.setMultipleSelection(false);
dialog.setElements(elements);
EObject selected = null;
if (dialog.open() == Window.OK) {
selected = (EObject) dialog.getFirstResult();
}
return selected;
}
use of org.eclipse.ui.dialogs.ElementListSelectionDialog in project tesb-studio-se by Talend.
the class InitFinishMessageDialog method createMessageArea.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createMessageArea(Composite composite) {
// create image
Image image = getImage();
if (image != null) {
imageLabel = new Label(composite, SWT.NULL);
image.setBackground(imageLabel.getBackground());
imageLabel.setImage(image);
GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
}
Link link = new Link(composite, SWT.WRAP);
link.setText("Local runtime serview has been started, totally installed bundles: <a href=\"#\">" + bundlesName.length + "</a>.");
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ElementListSelectionDialog report = new ElementListSelectionDialog(getShell(), new LabelProvider());
report.setTitle("Installed bundles:");
report.setMessage("Search bundle (? = any character, * = any string):");
report.setElements(bundlesName);
report.open();
}
});
return composite;
}
use of org.eclipse.ui.dialogs.ElementListSelectionDialog in project ow by vtst.
the class EasyLaunchShortcut method chooseConfiguration.
/**
* Returns a configuration from the given collection of configurations that should be launched,
* or <code>null</code> to cancel. Default implementation opens a selection dialog that allows
* the user to choose one of the specified launch configurations. Returns the chosen configuration,
* or <code>null</code> if the user cancels.
*
* @param configs list of configurations to choose from
* @return configuration to launch or <code>null</code> to cancel
*/
protected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configs) {
IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
ElementListSelectionDialog dialog = new ElementListSelectionDialog(MiscUi.getShell(), labelProvider);
dialog.setElements(configs.toArray());
dialog.setTitle(messages.getString("choose_configuration_title"));
dialog.setMessage(messages.getString("choose_configuration_message"));
dialog.setMultipleSelection(false);
int result = dialog.open();
labelProvider.dispose();
if (result == Window.OK) {
return (ILaunchConfiguration) dialog.getFirstResult();
}
return null;
}
use of org.eclipse.ui.dialogs.ElementListSelectionDialog in project ow by vtst.
the class EasyLaunchShortcut method chooseConfiguration.
/**
* Returns a configuration from the given collection of configurations that should be launched,
* or <code>null</code> to cancel. Default implementation opens a selection dialog that allows
* the user to choose one of the specified launch configurations. Returns the chosen configuration,
* or <code>null</code> if the user cancels.
*
* @param configs list of configurations to choose from
* @return configuration to launch or <code>null</code> to cancel
*/
protected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configs) {
IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
ElementListSelectionDialog dialog = new ElementListSelectionDialog(Utils.getShell(), labelProvider);
dialog.setElements(configs.toArray());
dialog.setTitle(messages.getString("choose_configuration_title"));
dialog.setMessage(messages.getString("choose_configuration_message"));
dialog.setMultipleSelection(false);
int result = dialog.open();
labelProvider.dispose();
if (result == Window.OK) {
return (ILaunchConfiguration) dialog.getFirstResult();
}
return null;
}
Aggregations