Skip to content

Commit

Permalink
Load the current chromatogram when peak/scan list becomes visible.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Feb 22, 2022
1 parent 2b81d52 commit 42e866e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ void execute(MPart part, MDirectToolItem toolItem) {
}
}

@Override
public void setFocus() {

ExtendedPeakScanListUI control = getControl();
if(control != null) {
getControl().setFocus();
}
}

@Inject
@Optional
public void updatePeakSelection(@UIEventTopic(IChemClipseEvents.TOPIC_PEAK_XXD_UPDATE_SELECTION) IPeak peak) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.eclipse.chemclipse.ux.extension.xxd.ui.internal.support.TableConfigSupport;
import org.eclipse.chemclipse.ux.extension.xxd.ui.operations.DeletePeaksOperation;
import org.eclipse.chemclipse.ux.extension.xxd.ui.operations.DeleteScansOperation;
import org.eclipse.chemclipse.ux.extension.xxd.ui.part.support.DataUpdateSupport;
import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferenceConstants;
import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePageLists;
import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePageMergePeaks;
Expand Down Expand Up @@ -111,6 +112,7 @@ public class ExtendedPeakScanListUI extends Composite implements IExtendedPartUI
private ScanIdentifierUI scanIdentifierUI;
private Button buttonTableEdit;
private AtomicReference<PeakScanListUI> tableViewer = new AtomicReference<>();
//
private IChromatogramSelection chromatogramSelection;
//
private boolean showScans;
Expand Down Expand Up @@ -142,6 +144,14 @@ private void updateFromPreferences() {
@Override
public boolean setFocus() {

DataUpdateSupport dataUpdateSupport = Activator.getDefault().getDataUpdateSupport();
List<Object> objects = dataUpdateSupport.getUpdates(IChemClipseEvents.TOPIC_CHROMATOGRAM_XXD_UPDATE_SELECTION);
if(!objects.isEmpty()) {
Object first = objects.get(0);
if(first instanceof IChromatogramSelection) {
chromatogramSelection = (IChromatogramSelection)first;
}
}
updateChromatogramSelection();
return true;
}
Expand Down

0 comments on commit 42e866e

Please sign in to comment.