mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -199,21 +199,14 @@ public class FindManagerImpl extends FindManager {
|
||||
DataContext dataContext = e.getDataContext();
|
||||
Project project = CommonDataKeys.PROJECT.getData(dataContext);
|
||||
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
|
||||
String selection = null;
|
||||
final String selection = editor != null ? editor.getSelectionModel().getSelectedText() : null;
|
||||
|
||||
if (editor != null) {
|
||||
SelectionModel selectionModel = editor.getSelectionModel();
|
||||
if (selectionModel.hasSelection()) {
|
||||
selection = selectionModel.getSelectedText();
|
||||
}
|
||||
}
|
||||
String finalSelection = selection;
|
||||
return new DataContextWrapper(dataContext) {
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getData(@NonNls String dataId) {
|
||||
if (CommonDataKeys.PROJECT.is(dataId)) return project;
|
||||
if (PlatformDataKeys.PREDEFINED_TEXT.is(dataId)) return finalSelection;
|
||||
if (PlatformDataKeys.PREDEFINED_TEXT.is(dataId)) return selection;
|
||||
return super.getData(dataId);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user