@Override public boolean isContextInformationValid(int offset) { IContextInformation[] infos= fProcessor.computeContextInformation(fViewer, offset); if (infos != null && infos.length > 0) { for (int i= 0; i < infos.length; i++) if (fContextInformation.equals(infos[i])) return true; } return false; } }
public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { IContextInformation[] allInformation = null; for (IContentAssistProcessor delegate : delegates) { IContextInformation[] information = delegate.computeContextInformation(viewer, offset); allInformation = merge(allInformation, information); } return allInformation; }
@Override public void run() throws Exception { result[0]= p.computeContextInformation(viewer, offset); fLastErrorMessage= p.getErrorMessage(); } });
@Override public boolean isContextInformationValid(int offset) { IContextInformation[] infos= fProcessor.computeContextInformation(fViewer, offset); if (infos != null && infos.length > 0) { for (IContextInformation info : infos) if (fContextInformation.equals(info)) return true; } return false; } }
public boolean isContextInformationValid(int offset) { if (fContextInformation instanceof ISmartContextInformation) { return ((ISmartContextInformation) fContextInformation).isContextInformationValid(fViewer, offset); } else { IContextInformation[] infos= fProcessor.computeContextInformation(fViewer, offset); if (infos != null && infos.length > 0) { for (int i= 0; i < infos.length; i++) if (fContextInformation.equals(infos[i])) return true; } return false; } }
/** * Returns an array of context information objects computed based * on the specified document position. The position is used to determine * the appropriate content assist processor to invoke. * * @param viewer the viewer for which to compute the context information * @param position a document position * @return an array of context information objects * * @see IContentAssistProcessor#computeContextInformation */ IContextInformation[] computeContextInformation(ITextViewer viewer, int position) { fLastErrorMessage= null; IContextInformation[] result= null; IContentAssistProcessor p= getProcessor(viewer, position); if (p != null) { result= p.computeContextInformation(viewer, position); fLastErrorMessage= p.getErrorMessage(); } return result; }
/** * Returns an array of context information objects computed based * on the specified document position. The position is used to determine * the appropriate content assist processor to invoke. * * @param viewer the viewer for which to compute the context information * @param position a document position * @return an array of context information objects * * @see IContentAssistProcessor#computeContextInformation */ IContextInformation[] computeContextInformation(ITextViewer viewer, int position) { fLastErrorMessage= null; IContextInformation[] result= null; IContentAssistProcessor p= getProcessor(viewer, position); if (p != null) { result= p.computeContextInformation(viewer, position); fLastErrorMessage= p.getErrorMessage(); } return result; }