Search in sources :

Example 1 with AutoCompletion

use of org.fife.ui.autocomplete.AutoCompletion in project knime-core by knime.

the class JSnippetPanel method createEditorComponent.

/**
 * Creates the text editor component along with the scrollpane.
 *
 * @return The {@link RSyntaxTextArea} wrapped within a {@link JScrollPane}.
 * @since 2.8
 */
protected JComponent createEditorComponent() {
    RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
    textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    JScrollPane scroller = new JScrollPane(textArea);
    // An AutoCompletion acts as a "middle-man" between a text component
    // and a CompletionProvider. It manages any options associated with
    // the auto-completion (the popup trigger key, whether to display a
    // documentation window along with completion choices, etc.). Unlike
    // CompletionProviders, instances of AutoCompletion cannot be shared
    // among multiple text components.
    AutoCompletion ac = new AutoCompletion(m_completionProvider);
    ac.setShowDescWindow(true);
    ac.install(textArea);
    setExpEdit(textArea);
    return scroller;
}
Also used : JScrollPane(javax.swing.JScrollPane) AutoCompletion(org.fife.ui.autocomplete.AutoCompletion) RSyntaxTextArea(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea)

Example 2 with AutoCompletion

use of org.fife.ui.autocomplete.AutoCompletion in project fql by CategoricalData.

the class AqlCodeEditor method doTemplates.

@Override
protected void doTemplates() {
    CompletionProvider provider = createCompletionProvider();
    AutoCompletion ac = new AutoCompletion(provider);
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
    ac.setTriggerKey(key);
    ac.install(topArea);
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) CompletionProvider(org.fife.ui.autocomplete.CompletionProvider) AutoCompletion(org.fife.ui.autocomplete.AutoCompletion) KeyStroke(javax.swing.KeyStroke)

Example 3 with AutoCompletion

use of org.fife.ui.autocomplete.AutoCompletion in project fql by CategoricalData.

the class FQLPPCodeEditor method doTemplates.

@Override
protected void doTemplates() {
    CompletionProvider provider = createCompletionProvider();
    AutoCompletion ac = new AutoCompletion(provider);
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
    ac.setTriggerKey(key);
    ac.install(topArea);
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) CompletionProvider(org.fife.ui.autocomplete.CompletionProvider) AutoCompletion(org.fife.ui.autocomplete.AutoCompletion) KeyStroke(javax.swing.KeyStroke)

Example 4 with AutoCompletion

use of org.fife.ui.autocomplete.AutoCompletion in project fql by CategoricalData.

the class OplCodeEditor method doTemplates.

@Override
protected void doTemplates() {
    CompletionProvider provider = createCompletionProvider();
    AutoCompletion ac = new AutoCompletion(provider);
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
    ac.setTriggerKey(key);
    ac.install(topArea);
}
Also used : CompletionProvider(org.fife.ui.autocomplete.CompletionProvider) DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) AutoCompletion(org.fife.ui.autocomplete.AutoCompletion) KeyStroke(javax.swing.KeyStroke)

Example 5 with AutoCompletion

use of org.fife.ui.autocomplete.AutoCompletion in project fql by CategoricalData.

the class FqlCodeEditor method doTemplates.

@Override
protected void doTemplates() {
    CompletionProvider provider = createCompletionProvider();
    AutoCompletion ac = new AutoCompletion(provider);
    KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK);
    ac.setTriggerKey(key);
    ac.install(topArea);
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) CompletionProvider(org.fife.ui.autocomplete.CompletionProvider) AutoCompletion(org.fife.ui.autocomplete.AutoCompletion) KeyStroke(javax.swing.KeyStroke)

Aggregations

AutoCompletion (org.fife.ui.autocomplete.AutoCompletion)9 CompletionProvider (org.fife.ui.autocomplete.CompletionProvider)7 DefaultCompletionProvider (org.fife.ui.autocomplete.DefaultCompletionProvider)7 KeyStroke (javax.swing.KeyStroke)6 RSyntaxTextArea (org.fife.ui.rsyntaxtextarea.RSyntaxTextArea)3 RTextScrollPane (org.fife.ui.rtextarea.RTextScrollPane)2 Font (java.awt.Font)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 Date (java.util.Date)1 JScrollPane (javax.swing.JScrollPane)1 BadLocationException (javax.swing.text.BadLocationException)1 CollapsibleSectionPanel (org.fife.rsta.ui.CollapsibleSectionPanel)1 KnimeSyntaxTextArea (org.knime.base.node.util.KnimeSyntaxTextArea)1