Source:
public void onFindInFiles(FindInFilesEvent event) { FindInFilesDialog dialog = new FindInFilesDialog(new OperationWithInput<FindInFilesDialog.State>() { @Override public void execute(final FindInFilesDialog.State input) { dialogState_ = input; stopAndClear(); dialogState_.clearResultsCount(); FileSystemItem searchPath = FileSystemItem.createDir(input.getPath()); JsArrayString filePatterns = JsArrayString.createArray().cast(); for (String pattern : input.getFilePatterns()) filePatterns.push(pattern); JsArrayString excludeFilePatterns = JsArrayString.createArray().cast(); for (String pattern : input.getExcludeFilePatterns()) excludeFilePatterns.push(pattern); view_.setReplaceMode(false); view_.disableReplace(); server_.beginFind(input.getQuery(), input.isRegex(), !input.isCaseSensitive(), searchPath, filePatterns, excludeFilePatterns, new SimpleRequestCallback<String>() { @Override public void onResponseReceived(String handle) { currentFindHandle_ = handle; updateSearchLabel(input.getQuery(), input.getPath(), input.isRegex()); view_.setStopSearchButtonVisible(true); super.onResponseReceived(handle); view_.ensureVisible(true); } }); } }); dialog.getDirectoryChooser().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { fileServer_.isGitDirectory(dialog.getDirectory(), new ServerRequestCallback<Boolean>() { @Override public void onResponseReceived(Boolean isGitDirectory) { if (isGitDirectory) dialog.setGitStatus(true); else dialog.setGitStatus(false); } @Override public void onError(ServerError error) { dialog.setGitStatus(true); Debug.logError(error); } }); } }); if (!StringUtil.isNullOrEmpty(event.getSearchPattern())) dialog.setSearchPattern(event.getSearchPattern()); if (dialogState_ == null) { dialog.setDirectory( session_.getSessionInfo().getActiveProjectDir() != null ? session_.getSessionInfo().getActiveProjectDir() : workbenchContext_.getCurrentWorkingDir()); } else { dialog.setState(dialogState_); } dialog.showModal(); }

Target:
public void onFindInFiles(FindInFilesEvent event) { FindInFilesDialog dialog = new FindInFilesDialog(new OperationWithInput<FindInFilesDialog.State>() { @Override public void execute(final FindInFilesDialog.State input) { dialogState_ = input; stopAndClear(); dialogState_.clearResultsCount(); FileSystemItem searchPath = FileSystemItem.createDir(input.getPath()); JsArrayString includeFilePatterns = JsArrayString.createArray().cast(); for (String pattern : input.getFilePatterns()) includeFilePatterns.push(pattern); JsArrayString excludeFilePatterns = JsArrayString.createArray().cast(); for (String pattern : input.getExcludeFilePatterns()) excludeFilePatterns.push(pattern); view_.setReplaceMode(false); view_.disableReplace(); server_.beginFind(input.getQuery(), input.isRegex(), !input.isCaseSensitive(), searchPath, includeFilePatterns, excludeFilePatterns, new SimpleRequestCallback<String>() { @Override public void onResponseReceived(String handle) { currentFindHandle_ = handle; updateSearchLabel(input.getQuery(), input.getPath(), input.isRegex()); view_.setStopSearchButtonVisible(true); super.onResponseReceived(handle); view_.ensureVisible(true); } }); } }); if (session_.getSessionInfo().isVcsAvailable(VCSConstants.GIT_ID)) { dialog.getDirectoryChooser().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { fileServer_.isGitDirectory(dialog.getDirectory(), new ServerRequestCallback<Boolean>() { @Override public void onResponseReceived(Boolean isGitDirectory) { dialog.setGitStatus(isGitDirectory); } @Override public void onError(ServerError error) { dialog.setGitStatus(true); Debug.logError(error); } }); } }); } if (!StringUtil.isNullOrEmpty(event.getSearchPattern())) dialog.setSearchPattern(event.getSearchPattern()); if (dialogState_ == null) { dialog.setDirectory( session_.getSessionInfo().getActiveProjectDir() != null ? session_.getSessionInfo().getActiveProjectDir() : workbenchContext_.getCurrentWorkingDir()); } else { dialog.setState(dialogState_); } dialog.showModal(); }