Search in sources :

Example 1 with DefaultCompletionProvider

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

the class AqlCodeEditor method createCompletionProvider.

private static CompletionProvider createCompletionProvider() {
    DefaultCompletionProvider provider = new DefaultCompletionProvider();
    provider.addCompletion(new ShorthandCompletion(provider, "typeside", "typeside ? = literal {\n\timports\n\ttypes\n\tsconstants\n\tfunctions\n\tequations\n\tjava_types\n\tjava_constants\n\tjava_functions\n\toptions\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "schema", "schema ? = literal : ? {\n\timports\n\tentities\n\tforeign_keys\n\tpath_equations\n\tattributes\n\tobservation_equations\n\toptions\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "instance", "instance ? = literal : ? {\n\timports\n\tgenerators\n\tequations\n\toptions\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "graph", "graph ? = literal : ? {\n\timports\n\tnodes\n\tedges\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "mapping", "mapping ? = literal : ? -> ? {\n\timports\n\tentities\n\tforeign_keys\n\tattributes\n\toptions\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "transform", "transform ? = literal : ? -> ? {\n\timports\n\tgenerators\n\toptions\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "query", "query ? = literal : ? -> ? {\n" + "\n entities" + "\n  e -> {for x:X y:Y " + "\n        where f(x)=f(x) g(y)=f(y) " + "\n        return att -> at(a) att2 -> at(a) " + "\n        options" + "\n  }" + "\n" + "\n foreign_keys" + "\n  f -> {x -> a.g y -> f(y) " + "\n        options" + "\n  }" + "\n options" + "\n}", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "import_csv", "import_csv path : schema (resp. inst -> inst) {imports options} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "export_csv", "export_csv_instance (resp. export_csv_transform) inst (resp. trans) path {options} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "import_csv", "import_jdbc classname url prefix : schema (resp. inst -> inst) {\nen -> sql ty -> sql (resp + att -> sql fk -> sql) ...}", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "export_csv", "export_jdbc_instance (resp export_jdbc_transform) classname url prefix {options} ", ""));
    return provider;
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) ShorthandCompletion(org.fife.ui.autocomplete.ShorthandCompletion)

Example 2 with DefaultCompletionProvider

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

the class FQLPPCodeEditor method createCompletionProvider.

private static CompletionProvider createCompletionProvider() {
    DefaultCompletionProvider provider = new DefaultCompletionProvider();
    provider.addCompletion(new ShorthandCompletion(provider, "set", "set   = { }", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "function", "function   = { } :  -> ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "category", "category   = {\n\tobjects;\n\tarrows;\n\tequations;\n}", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "functor", " functor   = {\n\tobjects;\n\tarrows;\n} :  -> ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "transform", "transform   = {\n\tobjects;\n} : ( :  -> ) -> ( :  -> ) ", ""));
    return provider;
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) ShorthandCompletion(org.fife.ui.autocomplete.ShorthandCompletion)

Example 3 with DefaultCompletionProvider

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

the class FqlCodeEditor method createCompletionProvider.

private static CompletionProvider createCompletionProvider() {
    DefaultCompletionProvider provider = new DefaultCompletionProvider();
    provider.addCompletion(new ShorthandCompletion(provider, "schema", "schema   = {\n\tnodes;\n\tattributes;\n\tarrows;\n\tequations;\n}", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "mapping", "mapping   = {\n\tnodes;\n\tattributes;\n\tarrows;\n} :  -> ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "instance", "instance   = {\n\tnodes;\n\tattributes;\n\tarrows;\n} :  ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "query", "query   = delta pi sigma", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "QUERY", "QUERY   = match {} src dst \"deta sigma forward\" ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "transform", "transform   = {\n\tnodes;\n} :  -> ", ""));
    return provider;
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) ShorthandCompletion(org.fife.ui.autocomplete.ShorthandCompletion)

Example 4 with DefaultCompletionProvider

use of org.fife.ui.autocomplete.DefaultCompletionProvider in project omegat by omegat-org.

the class RichScriptEditor method initLayout.

@Override
public void initLayout(ScriptingWindow scriptingWindow) {
    m_scriptingWindow = scriptingWindow;
    m_scriptEditor = new RSyntaxTextArea();
    m_scriptEditor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, m_scriptEditor.getFont().getSize()));
    CompletionProvider provider = new DefaultCompletionProvider();
    AutoCompletion ac = new AutoCompletion(provider);
    ac.install(m_scriptEditor);
    m_scriptEditor.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY);
    m_scriptEditor.setCodeFoldingEnabled(true);
    RTextScrollPane scrollPaneEditor = new RTextScrollPane(m_scriptEditor);
    // scrollPaneEditor.setMinimumSize(minimumSize1);
    m_csp = new CollapsibleSectionPanel();
    m_scriptingWindow.frame.getContentPane().add(m_csp);
    m_csp.add(scrollPaneEditor);
    initSearchDialogs();
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) CompletionProvider(org.fife.ui.autocomplete.CompletionProvider) DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) AutoCompletion(org.fife.ui.autocomplete.AutoCompletion) RSyntaxTextArea(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea) CollapsibleSectionPanel(org.fife.rsta.ui.CollapsibleSectionPanel) RTextScrollPane(org.fife.ui.rtextarea.RTextScrollPane) Font(java.awt.Font)

Example 5 with DefaultCompletionProvider

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

the class OplCodeEditor method createCompletionProvider.

private static CompletionProvider createCompletionProvider() {
    DefaultCompletionProvider provider = new DefaultCompletionProvider();
    provider.addCompletion(new ShorthandCompletion(provider, "theory", "theory {\n\tsorts;\n\tsymbols;\n\tequations;\n}", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "SCHEMA", "SCHEMA {\n\tentities;\n\tedges;\n\tattributes;\n\tpathEqualities;\n\tobsEqualities;\n} : ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "model", "model {\n\tsorts;\n\tsymbols;\n} : ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "query", "query {\n q1 = " + "\n {for a:b; " + "\n  where f(a)=f(b), f(b)=f(c); " + "\n  return att = at(a), att2 = at(a); " + "\n  keys fk1 = {a=f(b), b=f(g(a))} : q2," + "\n  fk2 = {c=f(b)} : q3; " + " } : t \n/* , another block */ \n} : S -> T ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "sql", "sql {\n  " + "\n  insert into A " + "\n  select (f(a) as a, f(a) as b) as a," + "\n         f(x) as x" + "\n  from A as a " + "\n  where f(a)=f(b) and f(b)=f(c) " + "\n  /* , another block */ \n} : S -> T ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "javascript", "javascript {\n\tsymbols;\n} : ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "mapping", "mapping {\n\tsorts;\n\tsymbols;\n} :  -> ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "transform", "tranform {\n\tsorts;\n} :  ->  ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "transpres", "transpres {\n\tsorts;\n} :  ->  ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "presentation", "presentation {\n\tgenerators;\n\tequations;\n} : ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "INSTANCE", "INSTANCE {\n\tgenerators;\n\tequations;\n} : ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "graph", "graph {\n\tnodes;\n\tedges;\n} ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "tables", "tables {\n\tentities;\n\tedges;\n\tattributes;} :  ", ""));
    provider.addCompletion(new ShorthandCompletion(provider, "colimit", "colimit typeSideOrSchema graph ", ""));
    return provider;
}
Also used : DefaultCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider) ShorthandCompletion(org.fife.ui.autocomplete.ShorthandCompletion)

Aggregations

DefaultCompletionProvider (org.fife.ui.autocomplete.DefaultCompletionProvider)6 ShorthandCompletion (org.fife.ui.autocomplete.ShorthandCompletion)5 Font (java.awt.Font)1 CollapsibleSectionPanel (org.fife.rsta.ui.CollapsibleSectionPanel)1 AutoCompletion (org.fife.ui.autocomplete.AutoCompletion)1 CompletionProvider (org.fife.ui.autocomplete.CompletionProvider)1 RSyntaxTextArea (org.fife.ui.rsyntaxtextarea.RSyntaxTextArea)1 RTextScrollPane (org.fife.ui.rtextarea.RTextScrollPane)1