use of org.eclipse.debug.ui.IDebugModelPresentation 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.debug.ui.IDebugModelPresentation 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.debug.ui.IDebugModelPresentation 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;
}
use of org.eclipse.debug.ui.IDebugModelPresentation in project tdi-studio-se by Talend.
the class OpenDeclarationAction method run.
/*
* @see Action#run()
*/
@Override
public void run() {
if (className == null) {
return;
}
// search source
IType source = null;
try {
source = searchSource();
} catch (InterruptedException e) {
return;
}
if (source == null) {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.errorLabel, Messages.openDeclarationFailedMsg);
return;
}
// get editor input
IDebugModelPresentation presentation = DebugUITools.newDebugModelPresentation(JDIDebugModel.getPluginIdentifier());
if (presentation == null) {
return;
}
IEditorInput editorInput = presentation.getEditorInput(source);
if (editorInput == null) {
return;
}
// open editor
IEditorPart editorPart = null;
try {
editorPart = openEditor(editorInput, presentation, source);
} catch (PartInitException e) {
Activator.log(IStatus.ERROR, Messages.openEditorFailedMsg, e);
}
presentation.dispose();
if (editorPart == null) {
return;
}
// highlight method
try {
highlightMethod(editorInput, editorPart);
} catch (CoreException e) {
Activator.log(IStatus.ERROR, Messages.highlightMethodFailedMsg, e);
}
}
Aggregations