use of org.fife.ui.autocomplete.Completion in project knime-core by knime.
the class JSnippetPanel method initCompletionProvider.
private void initCompletionProvider() {
Collection<? extends Manipulator> manipulators = m_manipProvider.getManipulators(ManipulatorProvider.ALL_CATEGORY);
for (Manipulator m : manipulators) {
Completion completion = new BasicCompletion(m_completionProvider, m.getName(), m.getDisplayName(), m.getDescription());
m_completionProvider.addCompletion(completion);
}
}
use of org.fife.ui.autocomplete.Completion in project knime-core by knime.
the class KnimeCompletionProvider method setFlowVariables.
/**
* Set flow variables that should be shown in the code completion box.
*
* @param variables flow variables
*/
public void setFlowVariables(final Iterable<FlowVariable> variables) {
if (m_flowVariableCompletions.size() > 0) {
for (Completion c : m_flowVariableCompletions) {
removeCompletion(c);
}
}
m_flowVariableCompletions.clear();
for (FlowVariable var : variables) {
String typeChar;
switch(var.getType()) {
case DOUBLE:
typeChar = "D";
break;
case INTEGER:
typeChar = "I";
break;
case STRING:
typeChar = "S";
break;
default:
return;
}
m_flowVariableCompletions.add(new BasicCompletion(this, "$${" + typeChar + var.getName() + /*.replace("\\", "\\\\").replace("}", "\\}")*/
"}$$", var.getType().toString(), "The flow variable " + var.getName() + "."));
}
addCompletions(m_flowVariableCompletions);
}
use of org.fife.ui.autocomplete.Completion in project knime-core by knime.
the class KnimeCompletionProvider method setFlowVariables.
/**
* Set flow variables that should be shown in the code completion box.
*
* @param variables flow variables
*/
public void setFlowVariables(final Iterable<FlowVariable> variables) {
if (m_flowVariableCompletions.size() > 0) {
for (Completion c : m_flowVariableCompletions) {
removeCompletion(c);
}
}
m_flowVariableCompletions.clear();
for (FlowVariable var : variables) {
String typeChar;
switch(var.getType()) {
case DOUBLE:
typeChar = "D";
break;
case INTEGER:
typeChar = "I";
break;
case STRING:
typeChar = "S";
break;
default:
return;
}
m_flowVariableCompletions.add(new BasicCompletion(this, "$${" + typeChar + var.getName() + /*.replace("\\", "\\\\").replace("}", "\\}")*/
"}$$", var.getType().toString(), "The flow variable " + var.getName() + "."));
}
addCompletions(m_flowVariableCompletions);
}
use of org.fife.ui.autocomplete.Completion in project knime-core by knime.
the class KnimeCompletionProvider method setColumns.
/**
* Set columns that should be shown in the code completion box.
*
* @param columns the columns
*/
public void setColumns(final Iterable<DataColumnSpec> columns) {
if (m_columnCompletions.size() > 0) {
for (Completion c : m_columnCompletions) {
removeCompletion(c);
}
}
m_columnCompletions.clear();
for (DataColumnSpec column : columns) {
m_columnCompletions.add(new BasicCompletion(this, escapeColumnName(column.getName()), column.getType().toString(), "The column " + column.getName() + "."));
}
addCompletions(m_columnCompletions);
}
use of org.fife.ui.autocomplete.Completion in project knime-core by knime.
the class KnimeCompletionProvider method setColumns.
/**
* Set columns that should be shown in the code completion box.
*
* @param columns the columns
*/
public void setColumns(final Iterable<DataColumnSpec> columns) {
if (m_columnCompletions.size() > 0) {
for (Completion c : m_columnCompletions) {
removeCompletion(c);
}
}
m_columnCompletions.clear();
for (DataColumnSpec column : columns) {
m_columnCompletions.add(new BasicCompletion(this, escapeColumnName(column.getName()), column.getType().toString(), "The column " + column.getName() + "."));
}
addCompletions(m_columnCompletions);
}
Aggregations