@javax.ws.rs.ext.Provider public class ContextInformationProducer { @Produces @RequestScoped public ContextInformation create() { ContextInformation contextInformation = new ContextInformation(); contextInformation.setBrowserUserAgent(httpHeaders.getHeaderString("User-Agent")); }
@Override public IContextInformation getContextInformation() { return new ContextInformation(getDisplayString(), getDisplayString()); }
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { ICompletionProposal[] result= new ICompletionProposal[Syntax.HELP.size()]; int i=0; for ( Syntax s : Syntax.HELP.values()) { IContextInformation info= new ContextInformation( s.getHeader(), s.getHeader()); result[i++]= new CompletionProposal(s.getHeader()+": ", offset-1, 1, s.getHeader().length()+2, null, s.getHeader(), info, s.getLead()); //$NON-NLS-1$ } return result; }
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { ICompletionProposal[] result= new ICompletionProposal[Syntax.HELP.size()]; int i=0; for ( Syntax s : Syntax.HELP.values()) { IContextInformation info= new ContextInformation( s.getHeader(), s.getHeader() +"-"+s.getLead()); result[i++]= new CompletionProposal(s.getHeader(), offset, 0, s.getHeader().length(), null, s.getLead(), info, s.getExample()); //$NON-NLS-1$ } return result; }
return new IContextInformation[]{new ContextInformation(contextString, info.toString())};
return new ContextInformation[]{new ContextInformation(contextInfo, contextInfo)};