/** * Returns the find string based on the selection or the find history. * @return the find string */ private String getFindString() { String fullSelection= fTarget.getSelectionText(); String firstLine= getFirstLine(fullSelection); if ((firstLine.length() == 0 || fRegExSearch && fullSelection.equals(fSelection)) && !fFindHistory.isEmpty()) return fFindHistory.get(0); else if (fRegExSearch && fullSelection.length() > 0) return FindReplaceDocumentAdapter.escapeForRegExPattern(fullSelection); else return firstLine; }
/** * Returns the find string based on the selection or the find history. * @return the find string */ private String getFindString() { String fullSelection= fTarget.getSelectionText(); String firstLine= getFirstLine(fullSelection); if ((firstLine.length() == 0 || fRegExSearch && fullSelection.equals(fSelection)) && !fFindHistory.isEmpty()) return fFindHistory.get(0); else if (fRegExSearch && fullSelection.length() > 0) return FindReplaceDocumentAdapter.escapeForRegExPattern(fullSelection); else return firstLine; }
private boolean initializePatternControl() { ISelection selection = getSelection(); if (selection instanceof ITextSelection && !selection.isEmpty()) { String text = ((ITextSelection) selection).getText(); if (text != null) { if (isRegExButton.getSelection()) patternCombo.setText(FindReplaceDocumentAdapter .escapeForRegExPattern(text)); else patternCombo.setText(insertEscapeChars(text)); return true; } } return false; }
if (fullSelection.length() > 0) { String firstLine= getFirstLine(fullSelection); String pattern= isRegEx ? FindReplaceDocumentAdapter.escapeForRegExPattern(fullSelection) : firstLine; fFindField.setText(pattern); if (!firstLine.equals(fullSelection)) {
if (fullSelection.length() > 0) { String firstLine= getFirstLine(fullSelection); String pattern= isRegEx ? FindReplaceDocumentAdapter.escapeForRegExPattern(fullSelection) : firstLine; fFindField.setText(pattern); if (!firstLine.equals(fullSelection)) {
private boolean initializePatternControl() { ISelection selection= getSelection(); if (selection instanceof ITextSelection && !selection.isEmpty() && ((ITextSelection)selection).getLength() > 0) { String text= ((ITextSelection) selection).getText(); if (text != null) { if (fIsRegExSearch) fPattern.setText(FindReplaceDocumentAdapter.escapeForRegExPattern(text)); else fPattern.setText(insertEscapeChars(text)); if (fPreviousExtensions.length > 0) { fExtensions.setText(fPreviousExtensions[0]); } else { String extension= getExtensionFromEditor(); if (extension != null) fExtensions.setText(extension); else fExtensions.setText("*"); //$NON-NLS-1$ } return true; } } return false; }