Skip to content

Commit

Permalink
Add compile time dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Sep 12, 2024
1 parent 9e7cfb4 commit 8672b03
Show file tree
Hide file tree
Showing 27 changed files with 87 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.chemclipse.ux.extension.xxd.ui;bundle-version="0.8.0",
org.eclipse.e4.core.services;bundle-version="2.0.100",
org.eclipse.e4.core.contexts;bundle-version="1.5.1",
com.fasterxml.jackson.core.jackson-databind;bundle-version="2.9.2",
org.eclipse.chemclipse.xxd.process.ui;bundle-version="0.8.0"
com.fasterxml.jackson.core.jackson-databind;bundle-version="2.9.2",
org.eclipse.chemclipse.xxd.process.ui;bundle-version="0.8.0",
org.eclipse.chemclipse.xxd.converter.supplier.ocx;bundle-version="0.9.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Localization: OSGI-INF/l10n/bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2023 Lablicate GmbH.
* Copyright (c) 2016, 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 @@ -31,6 +31,7 @@
import org.eclipse.chemclipse.support.ui.wizards.ChromatogramWizardElements;
import org.eclipse.chemclipse.ux.extension.xxd.ui.wizards.InputEntriesWizardPage;
import org.eclipse.chemclipse.ux.extension.xxd.ui.wizards.InputWizardSettings;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Expand All @@ -49,8 +50,6 @@ public class WizardCreateRetentionIndexFile extends AbstractFileWizard {
private RetentionIndexWizardElements wizardElements = new RetentionIndexWizardElements();
//
private static final String CALIBRATION_FILE_EXTENSION = ".cal";
private static final String CHROMATOGRAM_FILE_EXTENSION = ".ocb";
private static final String CHROMATOGRAM_CONVERTER_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
//
private PageCalibrationSettings pageCalibrationSettings;
private InputEntriesWizardPage pageInputEntriesMSD;
Expand Down Expand Up @@ -196,17 +195,17 @@ public void doFinish(IProgressMonitor monitor) throws CoreException {
* Export the chromatogram.
*/
String path = calibrationFile.getAbsolutePath();
File chromatogramFile = new File(path.substring(0, path.length() - CALIBRATION_FILE_EXTENSION.length()) + CHROMATOGRAM_FILE_EXTENSION);
File chromatogramFile = new File(path.substring(0, path.length() - CALIBRATION_FILE_EXTENSION.length()) + VersionConstants.FILE_EXTENSION_CHROMATOGRAM);
IChromatogramSelection<?, ?> chromatogramSelection = wizardElements.getChromatogramSelection();
if(wizardElements.isUseMassSpectrometryData()) {
if(chromatogramSelection instanceof IChromatogramSelectionMSD chromatogramSelectionMSD) {
IChromatogramMSD chromatogramMSD = chromatogramSelectionMSD.getChromatogram();
ChromatogramConverterMSD.getInstance().convert(chromatogramFile, chromatogramMSD, CHROMATOGRAM_CONVERTER_ID, monitor);
ChromatogramConverterMSD.getInstance().convert(chromatogramFile, chromatogramMSD, VersionConstants.CONVERTER_ID_CHROMATOGRAM, monitor);
}
} else {
if(chromatogramSelection instanceof IChromatogramSelectionCSD chromatogramSelectionCSD) {
IChromatogramCSD chromatogramCSD = chromatogramSelectionCSD.getChromatogram();
ChromatogramConverterCSD.getInstance().convert(chromatogramFile, chromatogramCSD, CHROMATOGRAM_CONVERTER_ID, monitor);
ChromatogramConverterCSD.getInstance().convert(chromatogramFile, chromatogramCSD, VersionConstants.CONVERTER_ID_CHROMATOGRAM, monitor);
}
}
} catch(Exception e) {
Expand All @@ -218,4 +217,4 @@ public void doFinish(IProgressMonitor monitor) throws CoreException {
super.refreshWorkspace(monitor);
super.runOpenEditor(file, monitor);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.chemclipse.chromatogram.msd.identifier;bundle-version="0.8.0",
org.apache.commons.math3;bundle-version="3.5.0",
org.apache.pdfbox;bundle-version="2.0.26",
org.apache.commons.commons-csv;bundle-version="1.8.0"
org.apache.commons.commons-csv;bundle-version="1.8.0",
org.eclipse.chemclipse.xxd.converter.supplier.ocx
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.chemclipse.chromatogram.xxd.process.supplier.workflows.converter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2023 Lablicate GmbH.
* Copyright (c) 2016, 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 @@ -40,6 +40,7 @@
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.processing.core.exceptions.TypeCastException;
import org.eclipse.chemclipse.support.text.ValueFormat;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;

Expand All @@ -52,9 +53,6 @@ public class SampleQuantProcessor {
private static final String EXTENSION_POINT_ID_RTERES = "net.openchrom.msd.converter.supplier.agilent.hp.report.rteres";
private static final String EXTENSION_POINT_ID_SUMRPT = "net.openchrom.msd.converter.supplier.agilent.hp.report.sumrpt";
//
private static final String CHROMATOGRAM_CONVERTER_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
private static final String CHROMATOGRAM_FILE_EXTENSION = ".ocb";
//
private Pattern pattern = Pattern.compile("(\\d+)-(\\d\\d)-(\\d)"); // CAS#

public void createSampleQuantReport(File sampleQuantReportFile, ISampleQuantReport sampleQuantReport, String pathChromatogramOriginal, IProgressMonitor monitor) {
Expand Down Expand Up @@ -90,8 +88,8 @@ public void createSampleQuantReport(File sampleQuantReportFile, ISampleQuantRepo
/*
* Export the chromatogram
*/
File chromatogramExportFile = new File(sampleQuantReportFile.getAbsolutePath().replace(REPORT_FILE_EXTENSION, CHROMATOGRAM_FILE_EXTENSION));
IProcessingInfo<File> processingInfoExport = ChromatogramConverterMSD.getInstance().convert(chromatogramExportFile, chromatogramMSD, CHROMATOGRAM_CONVERTER_ID, monitor);
File chromatogramExportFile = new File(sampleQuantReportFile.getAbsolutePath().replace(REPORT_FILE_EXTENSION, VersionConstants.FILE_EXTENSION_CHROMATOGRAM));
IProcessingInfo<File> processingInfoExport = ChromatogramConverterMSD.getInstance().convert(chromatogramExportFile, chromatogramMSD, VersionConstants.CONVERTER_ID_CHROMATOGRAM, monitor);
sampleQuantReport.setPathChromatogramEdited(processingInfoExport.getProcessingResult().getAbsolutePath());
/*
* Write sample quant report
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2022 Lablicate GmbH.
* Copyright (c) 2012, 2024 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -41,7 +41,6 @@ public class ChromatogramReportExportWizard extends Wizard implements IExportWiz

private static final Logger logger = Logger.getLogger(ChromatogramReportExportWizard.class);
private static final String DESCRIPTION = "Chromatogram Report";
private static final String CONVERTER_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
private ChromatogramSelectionWizardPage chromatogramSelectionWizardPage;
private ReportSupplierSelectionWizardPage reportSupplierSelectionWizardPage;

Expand Down Expand Up @@ -89,7 +88,7 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte
* Load each chromatogram
*/
File chromatogramFile = new File(inputFile);
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(chromatogramFile, CONVERTER_ID, monitor);
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(chromatogramFile, VersionConstants.CONVERTER_ID_CHROMATOGRAM, monitor);
try {
IChromatogramMSD chromatogram = processingInfo.getProcessingResult();
if(chromatogram != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.chemclipse.csd.model;bundle-version="0.8.0",
org.eclipse.chemclipse.model;bundle-version="0.8.0",
org.eclipse.chemclipse.ux.extension.xxd.ui,
org.eclipse.chemclipse.support.ui;bundle-version="0.9.0"
org.eclipse.chemclipse.support.ui;bundle-version="0.9.0",
org.eclipse.chemclipse.xxd.converter.supplier.ocx
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Vendor: ChemClipse
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2023 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 All @@ -15,6 +15,7 @@
import java.util.Map;

import org.eclipse.chemclipse.support.ui.swt.EnhancedCombo;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.WizardPage;
Expand All @@ -32,9 +33,9 @@
public class ImportDirectoryWizardPage extends WizardPage {

private static final String CONVERTER_LABEL_XY = "*.xy";
private static final String CONVERTER_LABEL_OCB = "*.ocb";
private static final String CONVERTER_LABEL_OCB = VersionConstants.FILE_EXTENSION_CHROMATOGRAM;
private static final String CONVERTER_ID_XY = "org.eclipse.chemclipse.csd.converter.supplier.xy";
private static final String CONVERTER_ID_OCB = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
private static final String CONVERTER_ID_OCB = VersionConstants.CONVERTER_ID_CHROMATOGRAM;
//
private Map<String, String> converterIds;
//
Expand All @@ -44,7 +45,7 @@ public class ImportDirectoryWizardPage extends WizardPage {
public ImportDirectoryWizardPage(String pageName, String title, ImageDescriptor titleImage) {

super(pageName, title, titleImage);
converterIds = new HashMap<String, String>();
converterIds = new HashMap<>();
converterIds.put(CONVERTER_LABEL_XY, CONVERTER_ID_XY);
converterIds.put(CONVERTER_LABEL_OCB, CONVERTER_ID_OCB);
}
Expand Down Expand Up @@ -74,7 +75,7 @@ public void createControl(Composite parent) {
gridDataCombo.horizontalSpan = 2;
comboConverter = EnhancedCombo.create(container, SWT.NONE);
comboConverter.select(1);
comboConverter.setItems(new String[]{CONVERTER_LABEL_XY, CONVERTER_LABEL_OCB});
comboConverter.setItems(CONVERTER_LABEL_XY, CONVERTER_LABEL_OCB);
comboConverter.setLayoutData(gridDataCombo);
//
GridData gridDataText = new GridData(GridData.FILL_HORIZONTAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.chemclipse.xxd.process;bundle-version="0.8.0",
org.eclipse.chemclipse.converter.ui;bundle-version="0.8.0",
org.eclipse.chemclipse.ux.extension.xxd.ui,
org.eclipse.e4.core.contexts,
org.eclipse.e4.core.di.annotations,
org.eclipse.chemclipse.swt.ui;bundle-version="0.9.0"
org.eclipse.e4.core.contexts;bundle-version="1.12.600",
org.eclipse.e4.core.di.annotations;bundle-version="1.8.400",
org.eclipse.chemclipse.swt.ui;bundle-version="0.9.0",
org.eclipse.chemclipse.xxd.converter.supplier.ocx;bundle-version="0.9.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: org.eclipse.chemclipse.msd.converter.ui.adapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2013, 2023 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 All @@ -25,6 +25,7 @@
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.processing.core.exceptions.TypeCastException;
import org.eclipse.chemclipse.ux.extension.xxd.ui.wizards.RawFileSelectionWizardPage;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
Expand All @@ -38,7 +39,6 @@ public class ChromatogramImportWizard extends Wizard implements IImportWizard {

private static final Logger logger = Logger.getLogger(ChromatogramImportWizard.class);
private static final String DESCRIPTION = "Chromatogram MSD Import";
private static final String CONVERTER_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
private RawFileSelectionWizardPage rawFileSelectionWizardPage;
private ImportDirectoryWizardPage importDirectoryWizardPage;

Expand Down Expand Up @@ -111,7 +111,7 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte
* Export
*/
File outputFile = new File(directory + chromatogram.getName());
ChromatogramConverterMSD.getInstance().convert(outputFile, chromatogram, CONVERTER_ID, monitor);
ChromatogramConverterMSD.getInstance().convert(outputFile, chromatogram, VersionConstants.CONVERTER_ID_CHROMATOGRAM, monitor);
} catch(TypeCastException e) {
logger.warn(e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Lablicate GmbH.
* Copyright (c) 2011, 2024 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -20,6 +20,7 @@
import org.eclipse.chemclipse.msd.model.core.selection.ChromatogramSelectionMSD;
import org.eclipse.chemclipse.msd.model.core.selection.IChromatogramSelectionMSD;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.junit.Ignore;

Expand All @@ -28,8 +29,6 @@
@Ignore
public class ChromatogramImporterTestCase extends TestCase {

private static final String EXTENSION_POINT_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
//
protected IChromatogramMSD chromatogram;
protected IChromatogramSelectionMSD chromatogramSelection;

Expand All @@ -41,7 +40,7 @@ protected void setUp() throws Exception {
* Import
*/
File fileImport = new File(TestPathHelper.getAbsolutePath(TestPathHelper.TESTFILE_IMPORT_CHROMATOGRAM_1));
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, EXTENSION_POINT_ID, new NullProgressMonitor());
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, VersionConstants.CONVERTER_ID_CHROMATOGRAM, new NullProgressMonitor());
chromatogram = processingInfo.getProcessingResult();
chromatogramSelection = new ChromatogramSelectionMSD(chromatogram);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2023 Lablicate GmbH.
* Copyright (c) 2011, 2024 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -20,6 +20,7 @@
import org.eclipse.chemclipse.msd.model.core.selection.ChromatogramSelectionMSD;
import org.eclipse.chemclipse.msd.model.core.selection.IChromatogramSelectionMSD;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.junit.Ignore;

Expand All @@ -28,7 +29,6 @@
@Ignore
public class ChromatogramImporterTestCase extends TestCase {

private static final String EXTENSION_POINT_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
protected IChromatogramMSD chromatogram;
protected IChromatogramSelectionMSD chromatogramSelection;

Expand All @@ -40,7 +40,7 @@ protected void setUp() throws Exception {
* Import
*/
File fileImport = new File(TestPathHelper.getAbsolutePath(TestPathHelper.TESTFILE_IMPORT_CHROMATOGRAM_2));
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, EXTENSION_POINT_ID, new NullProgressMonitor());
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, VersionConstants.CONVERTER_ID_CHROMATOGRAM, new NullProgressMonitor());
chromatogram = processingInfo.getProcessingResult();
chromatogramSelection = new ChromatogramSelectionMSD(chromatogram);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2023 Lablicate GmbH.
* Copyright (c) 2010, 2024 Lablicate GmbH.
*
* All rights reserved. This
* program and the accompanying materials are made available under the terms of
Expand All @@ -21,6 +21,7 @@
import org.eclipse.chemclipse.msd.model.core.selection.ChromatogramSelectionMSD;
import org.eclipse.chemclipse.msd.model.core.selection.IChromatogramSelectionMSD;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.junit.Ignore;

Expand All @@ -29,7 +30,6 @@
@Ignore
public class ChromatogramImporterTestCase extends TestCase {

private static final String EXTENSION_POINT_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";
protected IChromatogramMSD chromatogram;
protected IChromatogramSelectionMSD chromatogramSelection;

Expand All @@ -41,7 +41,7 @@ protected void setUp() throws Exception {
* Import
*/
File fileImport = new File(PathResolver.getAbsolutePath(TestPathHelper.TESTFILE_IMPORT_CHROMATOGRAM_1));
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, EXTENSION_POINT_ID, new NullProgressMonitor());
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, VersionConstants.CONVERTER_ID_CHROMATOGRAM, new NullProgressMonitor());
chromatogram = processingInfo.getProcessingResult();
chromatogramSelection = new ChromatogramSelectionMSD(chromatogram);
}
Expand Down
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 All @@ -17,6 +17,7 @@
import org.eclipse.chemclipse.msd.converter.chromatogram.ChromatogramConverterMSD;
import org.eclipse.chemclipse.msd.model.core.IChromatogramMSD;
import org.eclipse.chemclipse.processing.core.IProcessingInfo;
import org.eclipse.chemclipse.xxd.converter.supplier.ocx.versions.VersionConstants;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.junit.Ignore;

Expand All @@ -28,14 +29,13 @@ public class ChromatogramReaderTestCase extends TestCase {
protected IChromatogramMSD chromatogram;
protected String pathImport;
protected File fileImport;
private static final String EXTENSION_POINT_ID = "org.eclipse.chemclipse.xxd.converter.supplier.chemclipse";

@Override
protected void setUp() throws Exception {

super.setUp();
fileImport = new File(this.pathImport);
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, EXTENSION_POINT_ID, new NullProgressMonitor());
IProcessingInfo<IChromatogramMSD> processingInfo = ChromatogramConverterMSD.getInstance().convert(fileImport, VersionConstants.CONVERTER_ID_CHROMATOGRAM, new NullProgressMonitor());
chromatogram = processingInfo.getProcessingResult();
}

Expand Down
Loading

0 comments on commit 8672b03

Please sign in to comment.