Source:
public EdCompTargetList() { _w = new TelescopeForm(this); _w.addComponentListener(new ComponentAdapter() { public void componentShown(final ComponentEvent componentEvent) { toggleAgsGuiElements(); } }); _w.removeButton .addActionListener(removeListener); _w.copyButton .addActionListener(copyListener); _w.pasteButton .addActionListener(pasteListener); _w.duplicateButton.addActionListener(duplicateListener); _w.primaryButton .addActionListener(primaryListener); _w.guidingControls.manualGuideStarButton().peer().addActionListener(manualGuideStarListener); _w.guidingControls.autoGuideStarGuiderSelector().addSelectionListener(strategy -> AgsStrategyUtil.setSelection(getContextObservation(), strategy) ); _w.guideGroupName.addWatcher(new TextBoxWidgetWatcher() { @Override public void textBoxKeyPress(final TextBoxWidget tbwe) { SwingUtilities.invokeLater(() -> selectedGroup().map(igg -> { final String newName = _w.guideGroupName.getText(); final TargetObsComp toc = getDataObject(); final int idx = igg.index(); final GuideGroup newGroup = igg.group().setName(newName); final TargetEnvironment oldEnv = toc.getTargetEnvironment(); toc.setTargetEnvironment(oldEnv.setGroup(idx, newGroup)); _w.guideGroupName.requestFocus(); return new IndexedGuideGroup(idx, newGroup); }).foreach(EdCompTargetList.this::setSelectionToGroup) ); } }); _w.positionTable.addKeyListener(new KeyAdapter() { @Override public void keyPressed(final KeyEvent event) { switch (event.getKeyCode()) { case KeyEvent.VK_DELETE: case KeyEvent.VK_BACK_SPACE: _w.removeButton.doClick(); break; } } }); _agsPub.subscribe((obs, oldOptions, newOptions) -> updateGuiding()); BagsManager.instance().addBagsStatusListener((obs, oldStatus, newStatus) -> { if (obs == getContextObservation()) updateGuiding(); }); }

Target:
public EdCompTargetList() { _w = new TelescopeForm(this); _w.addComponentListener(new ComponentAdapter() { public void componentShown(final ComponentEvent componentEvent) { toggleAgsGuiElements(); } }); _w.removeButton .addActionListener(removeListener); _w.copyButton .addActionListener(copyListener); _w.pasteButton .addActionListener(pasteListener); _w.duplicateButton.addActionListener(duplicateListener); _w.primaryButton .addActionListener(primaryListener); _w.guidingControls.manualGuideStarButton().peer().addActionListener(manualGuideStarListener); _w.guidingControls.autoGuideStarGuiderSelector().addSelectionListener(strategy -> AgsStrategyUtil.setSelection(getContextObservation(), strategy) ); _w.guideGroupName.addWatcher(new TextBoxWidgetWatcher() { @Override public void textBoxKeyPress(final TextBoxWidget tbwe) { SwingUtilities.invokeLater(() -> selectedGroup().map(igg -> { final String newName = _w.guideGroupName.getText(); final TargetObsComp toc = getDataObject(); final int idx = igg.index(); final GuideGroup newGroup = igg.group().setName(newName); final TargetEnvironment oldEnv = toc.getTargetEnvironment(); toc.setTargetEnvironment(oldEnv.setGroup(idx, newGroup)); _w.guideGroupName.requestFocus(); return new IndexedGuideGroup(idx, newGroup); }).foreach(EdCompTargetList.this::setSelectionToGroup) ); } }); _w.positionTable.addKeyListener(new KeyAdapter() { @Override public void keyPressed(final KeyEvent event) { switch (event.getKeyCode()) { case KeyEvent.VK_DELETE: case KeyEvent.VK_BACK_SPACE: _w.removeButton.doClick(); break; } } }); _agsPub.subscribe((obs, oldOptions, newOptions) -> updateGuiding()); BagsManager.instance().addBagsStatusListener((key, oldStatus, newStatus) -> { if (key.equals(getContextObservation().getNodeKey())) updateGuiding(); }); }