public void defaultAction(final JTextComponent component) { substitute(component, this.varName); Completion.get().hideAll(); }
public void defaultAction(final JTextComponent component) { substitute(component, this.name); Completion.get().hideAll(); }
public void processKeyEvent(KeyEvent evt) { if (evt.getID() == KeyEvent.KEY_TYPED) { switch (evt.getKeyChar()) { case ';': case ',': case '(': case '.': case '\n': Completion.get().hideAll(); // case '.': // JTextComponent component = (JTextComponent)evt.getSource(); // int caretOffset = component.getSelectionEnd(); // substituteText(component, substitutionOffset, caretOffset - substitutionOffset, Character.toString(evt.getKeyChar())); // evt.consume(); // break; } } }
public void defaultAction(JTextComponent component) { if (component != null) { // Items with no insert prefix and no custom code template // are "read-only" (such as the method call items) if (getInsertPrefix().length() == 0) { return; } Completion.get().hideAll(); int caretOffset = component.getSelectionEnd(); substituteText(component, substitutionOffset, caretOffset - substitutionOffset, null); } }
@Override public void defaultAction(JTextComponent jtc) { try { StyledDocument doc = (StyledDocument) jtc.getDocument(); //Here we remove the characters starting at the start offset //and ending at the point where the caret is currently found: doc.remove(dotOffset, caretOffset - dotOffset); doc.insertString(dotOffset, getText(), null); //This statement will close the code completion box: Completion.get().hideAll(); } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } }
public void actionPerformed(ActionEvent evt) { Completion.get().hideAll(); UiUtils.open(controller.getSource(), elementHandle); } };
@Override public void defaultAction(JTextComponent component) { doSubstitute(component, null, 0); if (!file.isFolder()) { Completion.get().hideAll(); } }
public int getAutoQueryTypes(JTextComponent component, String typedText) { if (!autoPopup) { return 0; } if (typedText.length() > 0) { CodeCompletionHandler provider = getCompletable(component.getDocument(), component.getCaretPosition()); if (provider != null) { QueryType autoQuery = provider.getAutoQuery(component, typedText); switch (autoQuery) { case NONE: return 0; case STOP: { Completion.get().hideAll(); return 0; } case COMPLETION: return COMPLETION_QUERY_TYPE; case DOCUMENTATION: return DOCUMENTATION_QUERY_TYPE; case TOOLTIP: return TOOLTIP_QUERY_TYPE; case ALL_COMPLETION: return COMPLETION_ALL_QUERY_TYPE; } } } return 0; }
Completion.get().hideAll(); } catch (BadLocationException ex) { Exceptions.printStackTrace(ex);
Completion.get ().hideAll ();