provider.addCompletion(new ShorthandCompletion(provider, "find", "#find|@?|$R")); provider.addCompletion(new ShorthandCompletion(provider, "sysout", "System.out.println(", "System.out.println(")); provider.addCompletion(new ShorthandCompletion(provider, "syserr", "System.err.println(", "System.err.println(")); return provider;
/** * Returns the "body" of the HTML returned by {@link #getSummary()} when * no summary text has been set. This is defined to return the replacement * text in a monospaced font. * * @return The summary text's body, if no other summary has been defined. * @see #getReplacementText() */ protected String getSummaryBody() { return "<code>" + getReplacementText(); }
/** * If a summary has been set, that summary is returned. Otherwise, the * replacement text is returned. * * @return A description of this completion (the text that will be * inserted). * @see #getReplacementText() */ @Override public String getSummary() { String summary = super.getSummary(); return summary!=null ? summary : ("<html><body>" + getSummaryBody()); }
/** * Adds shorthand completions to the code completion provider. * * @param codeCP The code completion provider. */ protected void addShorthandCompletions(DefaultCompletionProvider codeCP) { codeCP.addCompletion(new ShorthandCompletion(codeCP, "main", "int main(int argc, char **argv)")); //for (int i=0; i<5000; i++) { // codeCP.addCompletion(new BasicCompletion(codeCP, "Number" + i)); //} }