}
IEditorPart editorPart = getEditorPart(officeSearchMatch);
if(editorPart == null)
nextMatchAction.setEnabled(true);
else {
ResultMatchWalker resultMatchWalker = getMatchWalker(editorPart);
if(resultMatchWalker != null && resultMatchWalker.hasNextMatch())
nextMatchAction.setEnabled(true);
else if(currentSearchResult.getNextMatch(officeSearchMatch) != null)
nextMatchAction.setEnabled(true);
else
nextMatchAction.setEnabled(false);
}
ResultMatchWalker resultMatchWalker = getMatchWalker(editorPart);
if(resultMatchWalker != null && resultMatchWalker.hasPreviousMatch())
previousMatchAction.setEnabled(true);
else if(currentSearchResult.getPreviousMatch(officeSearchMatch) != null)
previousMatchAction.setEnabled(true);
else
previousMatchAction.setEnabled(false);