From a410f44e2e03c4258556443878eed0c3f8bd9476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 14 Dec 2021 11:21:36 +0100 Subject: [PATCH 1/3] Code cleanup. --- .../support/ui/provider/ListContentProvider.java | 11 ----------- .../xxd/model/filter/peaks/DeletePeaksFilter.java | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/provider/ListContentProvider.java b/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/provider/ListContentProvider.java index a45a3ec900..c327bb3df2 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/provider/ListContentProvider.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/provider/ListContentProvider.java @@ -19,7 +19,6 @@ import java.util.Set; import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; public class ListContentProvider implements IStructuredContentProvider { @@ -47,14 +46,4 @@ public Object[] getElements(Object inputElement) { } return new Object[0]; } - - @Override - public void dispose() { - - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - - } } diff --git a/chemclipse/plugins/org.eclipse.chemclipse.xxd.model/src/org/eclipse/chemclipse/xxd/model/filter/peaks/DeletePeaksFilter.java b/chemclipse/plugins/org.eclipse.chemclipse.xxd.model/src/org/eclipse/chemclipse/xxd/model/filter/peaks/DeletePeaksFilter.java index a035065d89..f32e9bdcf2 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.xxd.model/src/org/eclipse/chemclipse/xxd/model/filter/peaks/DeletePeaksFilter.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.xxd.model/src/org/eclipse/chemclipse/xxd/model/filter/peaks/DeletePeaksFilter.java @@ -58,7 +58,7 @@ public void filterIPeaks(CRUDListener listener, SubMonitor subMonitor = SubMonitor.convert(monitor, peaks.size()); for(X peak : peaks) { if(configuration.isDeleteUnidentifiedOnly()) { - if(peak.getTargets().size() == 0) { + if(peak.getTargets().isEmpty()) { listener.delete(peak); } } else { From a258d947023e8e929af459bb4e283fde886a8e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 14 Dec 2021 11:23:00 +0100 Subject: [PATCH 2/3] Use proper names. --- .../msd/converter/core/DefaultConverterSupport.java | 4 ++-- .../chemclipse/msd/converter/core/DefaultSupplier.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultConverterSupport.java b/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultConverterSupport.java index 5f9d7657df..a8de23c4c0 100644 --- a/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultConverterSupport.java +++ b/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultConverterSupport.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2019 Lablicate GmbH. + * Copyright (c) 2011, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -18,7 +18,7 @@ /** * THIS IS A TESTCLASS. DO NOT USE IN PRODUCTION! * - * @author wenigmedia + * @author Philip Wenig * */ public class DefaultConverterSupport extends AbstractConverterSupport { diff --git a/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultSupplier.java b/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultSupplier.java index fdd3f796a3..9ccf5b4685 100644 --- a/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultSupplier.java +++ b/chemclipse/tests/org.eclipse.chemclipse.msd.converter.fragment.test/src/org/eclipse/chemclipse/msd/converter/core/DefaultSupplier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2018 Lablicate GmbH. + * Copyright (c) 2011, 2021 Lablicate GmbH. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -16,7 +16,7 @@ /** * THIS IS A TESTCLASS. DO NOT USE IN PRODUCTION! * - * @author wenigmedia + * @author Philip Wenig * */ public class DefaultSupplier extends AbstractSupplier { From 248c950fca24b5c7bf45e89f5314259065b422ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 15 Dec 2021 14:31:20 +0100 Subject: [PATCH 3/3] Map default icons to the quick access toolbar. --- .../icons/16x16/xmldoc.gif | Bin 0 -> 564 bytes .../rcp/ui/icons/core/IApplicationImage.java | 6 + .../support/ui/processors/Processor.java | 144 +++++++++++++++++- 3 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/xmldoc.gif diff --git a/chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/xmldoc.gif b/chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/icons/16x16/xmldoc.gif new file mode 100644 index 0000000000000000000000000000000000000000..14eb1be09569a9c7d7dbbbf035622ba4ddecf874 GIT binary patch literal 564 zcmZ?wbhEHb6krfwc*el+!>_lWetrJ-yMN}2`!9byeD&kO%kPg~ z|9JA|$MbhTUVQ+n|MmUnp9!;;-v^0*fBWg@*B^gAfBW_D_4g-le|-A(Thk*uyK&}} zIZNAStp57r_xGQ_r_Nn6W8R`!3l_{O}Tjt3|DuWZV=vMKY{-kPhMGXMYo&oHEb;!hSv1_oCK9gwR* zal*hpvB9;exuvzmzN53Ft;vSHe}a>JkL`pB&MuQ%tr+I&F~~bOJKD8c=;~@}F=}b5 zuvxcSimK{pYG~?+iki2Y^6|;-)Ra4D)@m$rYMYMoDU()1*~^E8FB`S$3khwL*?HTb zRY96}mB3ncY3){S9v%rPK_v+_39(jw#b1(=;=fs2MFb=kC^Ry$FmZAu94QD;V6X-N Du-DPt literal 0 HcmV?d00001 diff --git a/chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/src/org/eclipse/chemclipse/rcp/ui/icons/core/IApplicationImage.java b/chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/src/org/eclipse/chemclipse/rcp/ui/icons/core/IApplicationImage.java index 77895dc513..652d5561fa 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/src/org/eclipse/chemclipse/rcp/ui/icons/core/IApplicationImage.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.rcp.ui.icons/src/org/eclipse/chemclipse/rcp/ui/icons/core/IApplicationImage.java @@ -94,6 +94,8 @@ public static String getLocation(String fileName, String size) { String IMAGE_SCAN_FID = PATH_PREFIX + "scan-fid.png"; // String IMAGE_SAMPLE = PATH_PREFIX + "sample.gif"; + String IMAGE_SAMPLE_CALIBRATION = PATH_PREFIX + "sample-calibration.gif"; + String IMAGE_SAMPLE_CALIBRATION_QUALIFIER = PATH_PREFIX + "sample-calibration-qualifier.gif"; String IMAGE_SAMPLE_QUALIFIER = PATH_PREFIX + "sample-qualifier.gif"; String IMAGE_SAMPLE_ISTD = PATH_PREFIX + "sample-istd.gif"; String IMAGE_SAMPLE_ISTD_QUALIFIER = PATH_PREFIX + "sample-istd-qualifier.gif"; @@ -156,6 +158,7 @@ public static String getLocation(String fileName, String size) { String IMAGE_PEAK_INTEGRATOR = PATH_PREFIX + "peakIntegrator.gif"; String IMAGE_CHROMATOGRAM_INTEGRATOR = PATH_PREFIX + "chromatogramIntegrator.gif"; String IMAGE_DELETE_PEAK_INTEGRATIONS = PATH_PREFIX + "deletePeakIntegrations.gif"; + String IMAGE_DELETE_PEAK_IDENTIFICATIONS = PATH_PREFIX + "delete_all_identifications.gif"; String IMAGE_DELETE_CHROMATOGRAM_INTEGRATIONS = PATH_PREFIX + "deleteChromatogramIntegrations.gif"; String IMAGE_COMBINED_INTEGRATOR = PATH_PREFIX + "combinedIntegrator.gif"; // @@ -444,6 +447,7 @@ public static String getLocation(String fileName, String size) { String IMAGE_REVIEW_DETAILS_SHOW = PATH_PREFIX + "reviewDetailsShow.gif"; String IMAGE_REVIEW_DETAILS_HIDE = PATH_PREFIX + "reviewDetailsHide.gif"; String IMAGE_PLUGINS = PATH_PREFIX + "plugins.png"; + String IMAGE_XML_FILE = PATH_PREFIX + "xmldoc.gif"; String IMAGE_ZIP_FILE = PATH_PREFIX + "zip_file.png"; String IMAGE_TRANSFER = PATH_PREFIX + "transfer.png"; // @@ -459,6 +463,8 @@ public static String getLocation(String fileName, String size) { String IMAGE_CLEAR = PATH_PREFIX + "clear.gif"; String IMAGE_RULER = PATH_PREFIX + "ruler.gif"; String IMAGE_SKIP_QUANTIFIED_PEAK = PATH_PREFIX + "skipQuantifiedPeak.gif"; + String IMAGE_DELETE_PEAK = PATH_PREFIX + "delete_peak.gif"; + String IMAGE_DELETE_PEAKS = PATH_PREFIX + "delete_peaks.gif"; String IMAGE_CROSS_ZERO = PATH_PREFIX + "crossZero.gif"; String IMAGE_INCLUDE_INTERCEPT = PATH_PREFIX + "includeIntercept.gif"; String IMAGE_LOWER_MIN_AREA = PATH_PREFIX + "lowerMinArea.gif"; diff --git a/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/processors/Processor.java b/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/processors/Processor.java index 7f4e560ff8..cf808d72da 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/processors/Processor.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.support.ui/src/org/eclipse/chemclipse/support/ui/processors/Processor.java @@ -8,6 +8,7 @@ * * Contributors: * Philip Wenig - initial API and implementation + * Matthias Mailänder - add default icons *******************************************************************************/ package org.eclipse.chemclipse.support.ui.processors; @@ -23,6 +24,145 @@ public class Processor { public Processor(IProcessSupplier processSupplier) { this.processSupplier = processSupplier; + // Quick-Access Toolbar default icons: + if(processSupplier.getCategory().equals("Baseline Detector")) { + imageFileName = IApplicationImage.IMAGE_BASELINE; + if(processSupplier.getName().contains("SNIP")) { + imageFileName = IApplicationImage.IMAGE_BASELINE_SNIP; + } else if(processSupplier.getName().contains("Delete")) { + imageFileName = IApplicationImage.IMAGE_BASELINE_DELETE; + } + } else if(processSupplier.getCategory().equals("Chromatogram Calculator")) { + imageFileName = IApplicationImage.IMAGE_CALCULATE; + if(processSupplier.getName().contains("Retention Index Calculator")) { + imageFileName = IApplicationImage.IMAGE_RETENION_INDEX; + } else if(processSupplier.getName().contains("Reset")) { + imageFileName = IApplicationImage.IMAGE_RESET; + } + } else if(processSupplier.getCategory().equals("Chromatogram Classifier")) { + imageFileName = IApplicationImage.IMAGE_CLASSIFIER; + if(processSupplier.getName().contains("WNC")) { + imageFileName = IApplicationImage.IMAGE_CLASSIFIER_WNC; + } else if(processSupplier.getName().contains("Durbin-Watson")) { + imageFileName = IApplicationImage.IMAGE_CLASSIFIER_DW; + } + } else if(processSupplier.getCategory().equals("Chromatogram Export")) { + imageFileName = IApplicationImage.IMAGE_SAVE; + if(processSupplier.getName().contains("*.CAL")) { + imageFileName = IApplicationImage.IMAGE_SAMPLE_CALIBRATION; + } else if(processSupplier.getName().contains("Excel")) { + imageFileName = IApplicationImage.IMAGE_EXCEL_DOCUMENT; + } else if(processSupplier.getName().contains("ZIP")) { + imageFileName = IApplicationImage.IMAGE_ZIP_FILE; + } else if(processSupplier.getName().contains("mzML") || processSupplier.getName().contains("mzXML") || processSupplier.getName().contains("mzData") || processSupplier.getName().contains("AnIML") || processSupplier.getName().contains("GAML")) { + imageFileName = IApplicationImage.IMAGE_XML_FILE; + } + } else if(processSupplier.getCategory().equals("Chromatogram Filter")) { + imageFileName = IApplicationImage.IMAGE_CHROMATOGRAM; + if(processSupplier.getName().contains("(1:1)")) { + imageFileName = IApplicationImage.IMAGE_RESET_EQUAL; + } else if(processSupplier.getName().contains("CODA")) { + imageFileName = IApplicationImage.IMAGE_FILTER_CODA; + } else if(processSupplier.getName().contains("Backfolding")) { + imageFileName = IApplicationImage.IMAGE_FILTER_BACKFOLDING; + } else if(processSupplier.getName().contains("Denoising")) { + imageFileName = IApplicationImage.IMAGE_FILTER_DENOISING; + } else if(processSupplier.getName().contains("Mean Normalizer")) { + imageFileName = IApplicationImage.IMAGE_FILTER_MEAN_NORMALIZER; + } else if(processSupplier.getName().contains("Median Normalizer")) { + imageFileName = IApplicationImage.IMAGE_FILTER_MEDIAN_NORMALIZER; + } else if(processSupplier.getName().equals("Normalizer")) { + imageFileName = IApplicationImage.IMAGE_FILTER_NORMALIZER; + } else if(processSupplier.getName().contains("Savitzky-Golay")) { + imageFileName = IApplicationImage.IMAGE_FILTER_SAVITZKY_GOLAY; + } else if(processSupplier.getName().contains("Scan Remover")) { + imageFileName = IApplicationImage.IMAGE_FILTER_SCANREMOVER; + } else if(processSupplier.getName().contains("Subtract")) { + imageFileName = IApplicationImage.IMAGE_SUBTRACT_SCAN_DEFAULT; + } + } else if(processSupplier.getCategory().equals("Chromatogram Integrator")) { + imageFileName = IApplicationImage.IMAGE_CHROMATOGRAM_INTEGRATOR; + if(processSupplier.getName().contains("Sumarea")) { + imageFileName = IApplicationImage.IMAGE_INTEGRATOR_SUMAREA; + } + } else if(processSupplier.getCategory().equals("Chromatogram Reports")) { + imageFileName = IApplicationImage.IMAGE_CHROMATOGRAM_REPORT; + } else if(processSupplier.getCategory().equals("External Programs")) { + if(processSupplier.getName().contains("NIST")) { + imageFileName = IApplicationImage.IMAGE_NIST; + } + } else if(processSupplier.getCategory().equals("Combined Chromatogram and Peak Integrator")) { + imageFileName = IApplicationImage.IMAGE_COMBINED_INTEGRATOR; + } else if(processSupplier.getCategory().equals("Peak Detector")) { + imageFileName = IApplicationImage.IMAGE_PEAK_DETECTOR; + if(processSupplier.getName().contains("AMDIS") || processSupplier.getName().contains("MCR-AR")) { + imageFileName = IApplicationImage.IMAGE_DECONVOLUTION; + } + } else if(processSupplier.getCategory().equals("Peak Export")) { + imageFileName = IApplicationImage.IMAGE_EXPORT; + } else if(processSupplier.getCategory().equals("Peak Filter")) { + imageFileName = IApplicationImage.IMAGE_PEAKS; + if(processSupplier.getName().contains("Add")) { + imageFileName = IApplicationImage.IMAGE_ADD; + } else if(processSupplier.getName().contains("Remove")) { + imageFileName = IApplicationImage.IMAGE_REMOVE; + } else if(processSupplier.getName().contains("Delete")) { + imageFileName = IApplicationImage.IMAGE_DELETE; + } + if(processSupplier.getName().contains("Delete Peak")) { + imageFileName = IApplicationImage.IMAGE_DELETE_PEAKS; + } else if(processSupplier.getName().contains("Delete Integration")) { + imageFileName = IApplicationImage.IMAGE_DELETE_PEAK_INTEGRATIONS; + } else if(processSupplier.getName().contains("Delete Target")) { + imageFileName = IApplicationImage.IMAGE_DELETE_PEAK_IDENTIFICATIONS; + } else if(processSupplier.getName().contains("SNIP")) { + imageFileName = IApplicationImage.IMAGE_FILTER_SNIP_ALL_PEAKS; + } + } else if(processSupplier.getCategory().equals("Peak Identifier")) { + imageFileName = IApplicationImage.IMAGE_IDENTIFY_PEAKS; + if(processSupplier.getName().equals("Library File (MS)")) { + imageFileName = IApplicationImage.IMAGE_MASS_SPECTRUM_LIBRARY; + } else if(processSupplier.getName().equals("Unknown Marker")) { + imageFileName = IApplicationImage.IMAGE_UNKNOWN; + } else if(processSupplier.getName().contains("NIST")) { + imageFileName = IApplicationImage.IMAGE_NIST_PEAKS; + } + } else if(processSupplier.getCategory().equals("Peak Integrator")) { + imageFileName = IApplicationImage.IMAGE_PEAK_INTEGRATOR; + if(processSupplier.getName().contains("Peak Max")) { + imageFileName = IApplicationImage.IMAGE_PEAK_INTEGRATOR_MAX; + } + } else if(processSupplier.getCategory().equals("Peak Quantifier")) { + imageFileName = IApplicationImage.IMAGE_QUANTIFY_ALL_PEAKS; + if(processSupplier.getName().contains("ISTD")) { + imageFileName = IApplicationImage.IMAGE_INTERNAL_STANDARDS_DEFAULT; + } else if(processSupplier.getName().contains("ESTD")) { + imageFileName = IApplicationImage.IMAGE_EXTERNAL_STANDARDS_DEFAULT; + } + if(processSupplier.getName().contains("Add Peaks to DB")) { + imageFileName = IApplicationImage.IMAGE_ADD_PEAKS_TO_QUANTITATION_TABLE; + } + } else if(processSupplier.getCategory().equals("Peak Massspectrum Filter") || processSupplier.getCategory().equals("Scan Massspectrum Filter")) { + imageFileName = IApplicationImage.IMAGE_MASS_SPECTRUM; + if(processSupplier.getName().contains("Savitzky-Golay")) { + imageFileName = IApplicationImage.IMAGE_FILTER_SAVITZKY_GOLAY; + } else if(processSupplier.getName().contains("SNIP")) { + imageFileName = IApplicationImage.IMAGE_FILTER_SNIP_ALL_PEAKS; + } else if(processSupplier.getName().contains("Subtract")) { + imageFileName = IApplicationImage.IMAGE_SUBTRACT_SCAN_DEFAULT; + } + } else if(processSupplier.getCategory().equals("Scan Identifier")) { + imageFileName = IApplicationImage.IMAGE_IDENTIFY_MASS_SPECTRUM; + if(processSupplier.getName().equals("Library File (MS)")) { + imageFileName = IApplicationImage.IMAGE_MASS_SPECTRUM_LIBRARY; + } else if(processSupplier.getName().equals("Unknown Marker")) { + imageFileName = IApplicationImage.IMAGE_UNKNOWN; + } else if(processSupplier.getName().contains("NIST")) { + imageFileName = IApplicationImage.IMAGE_NIST_MASS_SPECTRUM; + } + } else if(processSupplier.getCategory().equals("System")) { + imageFileName = IApplicationImage.IMAGE_PREFERENCES; + } } public boolean isActive() { @@ -42,9 +182,7 @@ public String getImageFileName() { public void setImageFileName(String imageFileName) { - if(imageFileName == null || imageFileName.isEmpty()) { - this.imageFileName = IApplicationImage.IMAGE_EXECUTE_EXTENSION; - } else { + if(imageFileName != null && !imageFileName.isEmpty()) { this.imageFileName = imageFileName; } }