Skip to content

Commit

Permalink
Add literature references to peak detectors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Nov 2, 2024
1 parent b18f887 commit f8eb6e9
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2023 Lablicate GmbH.
* Copyright (c) 2014, 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 @@ -109,6 +109,7 @@ public static IPeakDetectorCSDSupport getPeakDetectorSupport() {
try {
IPeakDetectorSettingsCSD instance = (IPeakDetectorSettingsCSD)element.createExecutableExtension(PEAK_DETECTOR_SETTINGS);
supplier.setSettingsClass(instance.getClass());
supplier.getLiteratureReferences().addAll(instance.getLiteratureReferences());
} catch(CoreException e) {
logger.error(e);
// settings class is optional, set null instead
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2023 Lablicate GmbH.
* Copyright (c) 2019, 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 @@ -66,6 +66,7 @@ private static final class PeakDetectorProcessorSupplier extends ChromatogramSel
public PeakDetectorProcessorSupplier(IPeakDetectorSupplier supplier, IProcessTypeSupplier parent) {

super("PeakDetectorCSD." + supplier.getId(), supplier.getPeakDetectorName(), supplier.getDescription(), (Class<IPeakDetectorSettingsCSD>)supplier.getSettingsClass(), parent, DataType.CSD); //$NON-NLS-1$
getLiteratureReferences().addAll(supplier.getLiteratureReferences());
this.supplier = supplier;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2023 Lablicate GmbH.
* Copyright (c) 2008, 2024 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -131,6 +131,7 @@ public static IPeakDetectorMSDSupport getPeakDetectorSupport() {
try {
IPeakDetectorSettingsMSD instance = (IPeakDetectorSettingsMSD)element.createExecutableExtension(PEAK_DETECTOR_SETTINGS);
supplier.setSettingsClass(instance.getClass());
supplier.getLiteratureReferences().addAll(instance.getLiteratureReferences());
} catch(CoreException e) {
logger.error(e);
// settings class is optional, set null instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private static final class PeakDetectorProcessorSupplier extends ChromatogramSel
public PeakDetectorProcessorSupplier(IPeakDetectorSupplier supplier, IProcessTypeSupplier parent) {

super("PeakDetectorMSD." + supplier.getId(), supplier.getPeakDetectorName(), supplier.getDescription(), (Class<IPeakDetectorSettingsMSD>)supplier.getSettingsClass(), parent, DataType.MSD);
getLiteratureReferences().addAll(supplier.getLiteratureReferences());
this.supplier = supplier;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2018 Lablicate GmbH.
* Copyright (c) 2008, 2024 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -12,16 +12,22 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.peak.detector.core;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.chemclipse.chromatogram.peak.detector.settings.IPeakDetectorSettings;
import org.eclipse.chemclipse.support.literature.LiteratureReference;

public abstract class AbstractPeakDetectorSupplier<S extends IPeakDetectorSettings> implements IPeakDetectorSupplier {

private String id = "";
private String description = "";
private String peakDetectorName = "";
private Class<? extends S> settingsClass;
private List<LiteratureReference> literatureReference = new ArrayList<>();

public AbstractPeakDetectorSupplier(String id, String description, String peakDetectorName) {

setId(id);
setDescription(description);
setPeakDetectorName(peakDetectorName);
Expand Down Expand Up @@ -82,6 +88,7 @@ private void setPeakDetectorName(String peakDetectorName) {
}
}

@Override
public Class<? extends S> getSettingsClass() {

return this.settingsClass;
Expand All @@ -92,6 +99,12 @@ public void setSettingsClass(Class<? extends S> settingsClass) {
this.settingsClass = settingsClass;
}

@Override
public List<LiteratureReference> getLiteratureReferences() {

return literatureReference;
}

@Override
public boolean equals(Object other) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2018 Lablicate GmbH.
* Copyright (c) 2008, 2024 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.peak.detector.core;

import java.util.List;

import org.eclipse.chemclipse.chromatogram.peak.detector.settings.IPeakDetectorSettings;
import org.eclipse.chemclipse.support.literature.LiteratureReference;

public interface IPeakDetectorSupplier {

Expand Down Expand Up @@ -43,4 +46,6 @@ public interface IPeakDetectorSupplier {
* @return
*/
Class<? extends IPeakDetectorSettings> getSettingsClass();

List<LiteratureReference> getLiteratureReferences();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2023 Lablicate GmbH.
* Copyright (c) 2018, 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 @@ -111,6 +111,7 @@ public static IPeakDetectorWSDSupport getPeakDetectorSupport() {
try {
IPeakDetectorSettingsWSD instance = (IPeakDetectorSettingsWSD)element.createExecutableExtension(PEAK_DETECTOR_SETTINGS);
supplier.setSettingsClass(instance.getClass());
supplier.getLiteratureReferences().addAll(instance.getLiteratureReferences());
} catch(CoreException e) {
logger.error(e);
// settings class is optional, set null instead
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private static final class PeakDetectorProcessorSupplier extends ChromatogramSel
public PeakDetectorProcessorSupplier(IPeakDetectorSupplier supplier, IProcessTypeSupplier parent) {

super("PeakDetectorWSD." + supplier.getId(), supplier.getPeakDetectorName(), supplier.getDescription(), (Class<IPeakDetectorSettingsWSD>)supplier.getSettingsClass(), parent, DataType.WSD);
getLiteratureReferences().addAll(supplier.getLiteratureReferences());
this.supplier = supplier;
}

Expand Down

0 comments on commit f8eb6e9

Please sign in to comment.