Skip to content

Commit

Permalink
Merge branch 'master471' into 'master'
Browse files Browse the repository at this point in the history
#471 Улучшение по визуализации результатов поиска

See merge request shared/runawfe-professional-devstudio!172
  • Loading branch information
dofs197 committed Mar 29, 2021
2 parents 431189f + 854fb1f commit 80b7b61
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/ru.runa.gpd/src/ru/runa/gpd/search/SearchPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ protected void showMatch(Match match, int offset, int length, boolean activate)
ElementMatch elementMatch = (ElementMatch) match.getElement();
IEditorPart editor = null;
if (ElementMatch.CONTEXT_FORM.equals(elementMatch.getContext())) {
selectFormNode(elementMatch);
try {
FormNode formNode = (FormNode) elementMatch.getGraphElement();
editor = FormTypeProvider.getFormType(formNode.getFormType()).openForm(elementMatch.getFile(), formNode);
} catch (CoreException e) {
PluginLogger.logError(e);
}
} else if (ElementMatch.CONTEXT_FORM_VALIDATION.equals(elementMatch.getContext())) {
selectFormNode(elementMatch);
try {
FormNode formNode = (FormNode) elementMatch.getGraphElement();
editor = FormTypeProvider.getFormType(formNode.getFormType())
Expand Down Expand Up @@ -143,4 +145,11 @@ protected void clear() {
contentProvider.clear();
}
}

private void selectFormNode(ElementMatch elementMatch) {
ProcessEditorBase processEditor = WorkspaceOperations.openProcessDefinition(elementMatch.getParent().getFile());
if (processEditor != null) {
processEditor.select(elementMatch.getParent().getGraphElement());
}
}
}

0 comments on commit 80b7b61

Please sign in to comment.