use of org.yamcs.studio.core.model.LinkCatalogue in project yamcs-studio by yamcs.
the class YamcsPlugin method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
TimeEncoding.setUp();
yamcsClient = new YamcsClient(getProductString(), true);
yamcsClient.addConnectionListener(new UIConnectionListener());
ManagementCatalogue managementCatalogue = new ManagementCatalogue();
catalogues.put(ManagementCatalogue.class, managementCatalogue);
addYamcsConnectionListener(managementCatalogue);
registerCatalogue(new TimeCatalogue());
registerCatalogue(new ParameterCatalogue());
registerCatalogue(new CommandingCatalogue());
registerCatalogue(new AlarmCatalogue());
registerCatalogue(new EventCatalogue());
registerCatalogue(new LinkCatalogue());
registerCatalogue(new ArchiveCatalogue());
}
use of org.yamcs.studio.core.model.LinkCatalogue in project yamcs-studio by yamcs.
the class DataLinkTableViewer method addPopupMenu.
private void addPopupMenu() {
Menu contextMenu = new Menu(getTable());
getTable().setMenu(contextMenu);
MenuItem mItem1 = new MenuItem(contextMenu, SWT.None);
mItem1.setText("Enable Link");
mItem1.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
widgetSelected(arg0);
}
@Override
public void widgetSelected(SelectionEvent arg0) {
DataLinkRecord rec = (DataLinkRecord) (getTable().getSelection()[0].getData());
if (rec == null)
return;
LinkCatalogue catalogue = LinkCatalogue.getInstance();
catalogue.enableLink(rec.getLinkInfo().getInstance(), rec.getLinkInfo().getName()).whenComplete((data, exc) -> {
if (exc != null) {
getTable().getDisplay().asyncExec(() -> {
showMessage(getTable().getShell(), exc.getMessage());
});
}
});
}
});
MenuItem mItem2 = new MenuItem(contextMenu, SWT.None);
mItem2.setText("Disable Link");
mItem2.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
widgetSelected(arg0);
}
@Override
public void widgetSelected(SelectionEvent arg0) {
DataLinkRecord rec = (DataLinkRecord) (getTable().getSelection()[0].getData());
if (rec == null)
return;
LinkCatalogue catalogue = LinkCatalogue.getInstance();
catalogue.disableLink(rec.getLinkInfo().getInstance(), rec.getLinkInfo().getName()).whenComplete((data, exc) -> {
if (exc != null) {
getTable().getDisplay().asyncExec(() -> {
showMessage(getTable().getShell(), exc.getMessage());
});
}
});
}
});
}
Aggregations