use of org.eclipse.titan.designer.finddefinition.DefinitionListSelectionDialog in project titan.EclipsePlug-ins by eclipse.
the class FindDefinitionAction method doFindDefinition.
private void doFindDefinition() {
final DefinitionListSelectionDialog dialog = new DefinitionListSelectionDialog(Display.getDefault().getActiveShell(), new DefinitionLabelProvider(), getCurrentProject());
dialog.setTitle("Find Definition");
dialog.setMessage("Type the name of a definition");
dialog.setHelpAvailable(false);
if (targetEditor instanceof TTCN3Editor) {
selection = ((TTCN3Editor) targetEditor).getSelectionProvider().getSelection();
}
if (selection instanceof TextSelection && !selection.isEmpty()) {
final IPreferencesService prefs = Platform.getPreferencesService();
final boolean reportDebugInformation = prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.DISPLAYDEBUGINFORMATION, true, null);
if (reportDebugInformation) {
TITANDebugConsole.println("text selected: " + ((TextSelection) selection).getText());
}
final TextSelection tSelection = (TextSelection) selection;
dialog.setFilter(tSelection.getText());
}
dialog.init();
if (dialog.open() == Window.CANCEL || dialog.getFirstResult() == null) {
return;
}
final Object result = dialog.getFirstResult();
if (!(result instanceof ILocateableNode)) {
return;
}
showInEditor((ILocateableNode) result);
}
Aggregations