use of org.yamcs.protobuf.Mdb.CommandInfo in project yamcs-studio by yamcs.
the class AddToStackWizardPage1 method addAliasColumn.
// Add dynamically columns for each alias of a command
private void addAliasColumn(String namespace) {
TreeViewerColumn aliasColumn = new TreeViewerColumn(commandsTreeTable, SWT.NONE);
aliasColumn.getColumn().setText(namespace);
aliasColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
CommandInfo cmd = (CommandInfo) element;
if (cmd.getAbstract()) {
// show a blank line if the command is abstract
return "";
}
List<NamedObjectId> aliases = cmd.getAliasList();
for (NamedObjectId aliase : aliases) {
if (aliase.getNamespace().equals(namespace))
return aliase.getName();
}
return "";
}
});
tcl.setColumnData(aliasColumn.getColumn(), new ColumnPixelData(COLUMN_WIDTH));
}
use of org.yamcs.protobuf.Mdb.CommandInfo in project yamcs-studio by yamcs.
the class CommandInfoViewerFilter method select.
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
CommandInfo cmd = (CommandInfo) element;
// check match in all namespace
boolean matching = false;
for (NamedObjectId alias : cmd.getAliasList()) {
matching |= alias.getName().matches(regex);
}
matching |= cmd.getQualifiedName().matches(regex);
return matching;
}
Aggregations