Skip to content

Commit

Permalink
Show the peak list by default
Browse files Browse the repository at this point in the history
but don't prefer it over Data Explorer.
  • Loading branch information
Mailaender committed Nov 5, 2024
1 parent db68e49 commit 3e9f786
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2022 Lablicate GmbH.
* Copyright (c) 2013, 2024 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down Expand Up @@ -37,4 +37,5 @@ public interface IPerspectiveAndViewIds {
*/
String VIEW_FEEDBACK = "org.eclipse.chemclipse.ux.extension.xxd.ui.part.processinginfo";
String VIEW_CONSOLE = "org.eclipse.ui.console.ConsoleView";
String DATA_EXPLORER = "org.eclipse.chemclipse.ux.extension.xxd.ui.part.dataexplorer";
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage;
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImageProvider;
import org.eclipse.chemclipse.support.events.IChemClipseEvents;
import org.eclipse.chemclipse.support.events.IPerspectiveAndViewIds;
import org.eclipse.chemclipse.support.ui.events.IKeyEventProcessor;
import org.eclipse.chemclipse.support.ui.menu.ITableMenuEntry;
import org.eclipse.chemclipse.support.ui.swt.ExtendedTableViewer;
Expand Down Expand Up @@ -96,6 +97,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swtchart.extensions.core.IKeyboardSupport;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

public class ExtendedPeakScanListUI extends Composite implements IExtendedPartUI, ConfigurableUI<PeakScanListUIConfig> {
Expand Down Expand Up @@ -133,6 +135,7 @@ public class ExtendedPeakScanListUI extends Composite implements IExtendedPartUI
private int currentModCount;
private InteractionMode interactionMode = InteractionMode.SOURCE;
private RetentionTimeRange lastRange;
private boolean isInitial = true;
//
private final IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();

Expand All @@ -152,12 +155,23 @@ public boolean setFocus() {
if(last instanceof IChromatogramSelection<?, ?> chromatogramSelection) {
updateChromatogramSelection(chromatogramSelection);
}
} else if(!isInitial) {
unfocus();
}
//
isInitial = false;
updateLabel();
return true;
}

private void unfocus() {

try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IPerspectiveAndViewIds.DATA_EXPLORER);
} catch(PartInitException e) {
logger.warn(e);
}
}

public void updateChromatogramSelection(IChromatogramSelection<?, ?> chromatogramSelection) {

if(hasChanged(chromatogramSelection)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public List<IPartHandler> getPartHandlerMandatory() {
List<IPartHandler> partHandler = new ArrayList<>();
//
partHandler.add(new PartHandler("Targets", PartSupport.PARTDESCRIPTOR_TARGETS, PreferenceSupplier.P_STACK_POSITION_TARGETS));
partHandler.add(new PartHandler("Scan List", PartSupport.PARTDESCRIPTOR_PEAK_SCAN_LIST, PreferenceSupplier.P_STACK_POSITION_PEAK_SCAN_LIST));
partHandler.add(new PartHandler("Scan Chart", PartSupport.PARTDESCRIPTOR_SCAN_CHART, PreferenceSupplier.P_STACK_POSITION_SCAN_CHART));
partHandler.add(new PartHandler("Scan Table", PartSupport.PARTDESCRIPTOR_SCAN_TABLE, PreferenceSupplier.P_STACK_POSITION_SCAN_TABLE));
//
Expand All @@ -59,7 +60,6 @@ public List<IPartHandler> getPartHandlerAdditional() {
partHandler.add(new PartHandler("Flavor Marker", PartSupport.PARTDESCRIPTOR_FLAVOR_MARKER, PreferenceSupplier.P_STACK_POSITION_FLAVOR_MARKER));
partHandler.add(new PartHandler("Literature", PartSupport.PARTDESCRIPTOR_LITERATURE, PreferenceSupplier.P_STACK_POSITION_LITERATURE));
partHandler.add(new PartHandler("CAS Numbers", PartSupport.PARTDESCRIPTOR_CAS_NUMBERS, PreferenceSupplier.P_STACK_POSITION_CAS_NUMBERS));
partHandler.add(new PartHandler("Scan List", PartSupport.PARTDESCRIPTOR_PEAK_SCAN_LIST, PreferenceSupplier.P_STACK_POSITION_PEAK_SCAN_LIST));
partHandler.add(new PartHandler("Scan Subtract", PartSupport.PARTDESCRIPTOR_SUBTRACT_SCAN, PreferenceSupplier.P_STACK_POSITION_SUBTRACT_SCAN_PART));
partHandler.add(new PartHandler("Scan Combined", PartSupport.PARTDESCRIPTOR_COMBINED_SCAN, PreferenceSupplier.P_STACK_POSITION_COMBINED_SCAN_PART));
partHandler.add(new PartHandler("Scan Comparison", PartSupport.PARTDESCRIPTOR_COMPARISON_SCAN, PreferenceSupplier.P_STACK_POSITION_COMPARISON_SCAN_CHART));
Expand Down

0 comments on commit 3e9f786

Please sign in to comment.