/** * ************************************************************************* Search for a string * in the code ************************************************************************ */ public int searchString(String toSearch) { clearMatches(); int count = m_search.searchString(toSearch); if (count > 0) { showMatches(m_search.getMatches()); } return count; }
/** * ************************************************************************* Show previous * occurrence ************************************************************************ */ public boolean searchPrevious() { SearchMatch match = m_search.getPrevious(); if (match == null) return false; getGrid().deselectAll(); getGrid().select(match.lineNo - 1); showLine(match.lineNo > 1 ? match.lineNo - 1 : match.lineNo, false); return true; }
/** * ************************************************************************* Clear the highlight * of the given ranges ************************************************************************ */ public void clearMatches() { m_search.clear(); getGrid().setRedraw(false); getGrid().deselectAll(); for (GridItem item : getGrid().getItems()) { item.setData("DATA_SEARCH_MATCH", null); } getGrid().setRedraw(true); }
/** * ************************************************************************* Show next occurrence * ************************************************************************ */ public boolean hasMatches() { return (m_search.getMatches() != null) && (m_search.getMatches().length > 0); }