Search in sources :

Example 1 with FindReplaceOption

use of com.cubrid.tool.editor.dialog.FindReplaceOption in project cubrid-manager by CUBRID.

the class TextEditorFindReplaceMediator method findPrevious.

/**
	 *
	 * Find previous searched string
	 *
	 * @return boolean
	 */
public static boolean findPrevious() {
    TextViewer st = getCurrentTextEditor();
    if (st == null) {
        return false;
    }
    String searchedStr = st.getTextWidget().getSelectionText();
    if (searchedStr == null || searchedStr.trim().length() == 0) {
        return false;
    }
    FindReplaceOption findReplaceOption = new FindReplaceOption();
    findReplaceOption.setSearchedStr(searchedStr);
    return findAndSelect(st.getTextWidget().getCaretOffset(), false, findReplaceOption) >= 0;
}
Also used : FindReplaceOption(com.cubrid.tool.editor.dialog.FindReplaceOption) TextViewer(org.eclipse.jface.text.TextViewer)

Example 2 with FindReplaceOption

use of com.cubrid.tool.editor.dialog.FindReplaceOption in project cubrid-manager by CUBRID.

the class TextEditorFindReplaceMediator method findNext.

/**
	 *
	 * Find next searched string
	 *
	 * @return boolean
	 */
public static boolean findNext() {
    TextViewer st = getCurrentTextEditor();
    if (st == null) {
        return false;
    }
    String searchedStr = st.getTextWidget().getSelectionText();
    if (searchedStr == null || searchedStr.trim().length() == 0) {
        return false;
    }
    FindReplaceOption findReplaceOption = new FindReplaceOption();
    findReplaceOption.setSearchedStr(searchedStr);
    return findAndSelect(st.getTextWidget().getCaretOffset(), true, findReplaceOption) >= 0;
}
Also used : FindReplaceOption(com.cubrid.tool.editor.dialog.FindReplaceOption) TextViewer(org.eclipse.jface.text.TextViewer)

Aggregations

FindReplaceOption (com.cubrid.tool.editor.dialog.FindReplaceOption)2 TextViewer (org.eclipse.jface.text.TextViewer)2