Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localized Chromatogram Filters #1310

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2023 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthias Mailänder - initial API and implementation
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.csd.filter.ui.l10n;

import org.eclipse.osgi.util.NLS;

public class Messages extends NLS {

private static final String BUNDLE_NAME = "org.eclipse.chemclipse.chromatogram.csd.filter.ui.l10n.messages"; //$NON-NLS-1$ //
//
public static String filterCSD;
public static String filterCSDdescription;
//
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}

private Messages() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
filterCSD=Filter CSD
filterCSDdescription=Filter for FID, FPD, NPD, ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
filterCSD=Filter CSD
filterCSDdescription=Filter f�r FID, FPD, NPD, ...
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2015, 2018 Lablicate GmbH.
* Copyright (c) 2015, 2023 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
Expand All @@ -11,18 +11,20 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.csd.filter.ui.preferences;

import org.eclipse.chemclipse.chromatogram.csd.filter.ui.Activator;
import org.eclipse.chemclipse.chromatogram.csd.filter.ui.l10n.Messages;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

import org.eclipse.chemclipse.chromatogram.csd.filter.ui.Activator;

public class FilterPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

public FilterPreferencePage() {

super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setDescription("Filter FID");
setTitle(Messages.filterCSD);
setDescription(Messages.filterCSDdescription);
}

/**
Expand All @@ -32,6 +34,7 @@ public FilterPreferencePage() {
*/
public void createFieldEditors() {

// Used as a top node for other filters.
}

/*
Expand All @@ -41,5 +44,6 @@ public void createFieldEditors() {
*/
public void init(IWorkbench workbench) {

// no fields
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*******************************************************************************
* Copyright (c) 2023 Lablicate GmbH.
*
* All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthias Mailänder - initial API and implementation
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.csd.identifier.ui.l10n;

import org.eclipse.osgi.util.NLS;

public class Messages extends NLS {

private static final String BUNDLE_NAME = "org.eclipse.chemclipse.chromatogram.csd.identifier.ui.l10n.messages"; //$NON-NLS-1$
//
public static String csdIdentifierPreferences;
//
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}

private Messages() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
csdIdentifierPreferences=CSD Identifier Preferences
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
csdIdentifierPreferences=CSD Identifizierer Einstellungen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018 Lablicate GmbH.
* Copyright (c) 2018, 2023 Lablicate GmbH.
*
* All rights reserved. This
* program and the accompanying materials are made available under the terms of
Expand All @@ -12,16 +12,18 @@
package org.eclipse.chemclipse.chromatogram.csd.identifier.ui.preferences;

import org.eclipse.chemclipse.chromatogram.csd.identifier.ui.Activator;
import org.eclipse.chemclipse.chromatogram.csd.identifier.ui.l10n.Messages;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class PreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {

public PreferencePage() {

super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setDescription("Identifier Preferences");
setTitle(Messages.csdIdentifierPreferences);
}

/**
Expand All @@ -31,6 +33,7 @@ public PreferencePage() {
*/
public void createFieldEditors() {

// Used as a top node for other filters.
}

/*
Expand All @@ -40,5 +43,6 @@ public void createFieldEditors() {
*/
public void init(IWorkbench workbench) {

// no fields
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2021 Lablicate GmbH.
* Copyright (c) 2019, 2023 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 @@ -23,6 +23,7 @@
import org.eclipse.chemclipse.chromatogram.filter.result.ResultStatus;
import org.eclipse.chemclipse.chromatogram.filter.settings.IChromatogramFilterSettings;
import org.eclipse.chemclipse.chromatogram.filter.settings.MaxDetectorFilterSettings;
import org.eclipse.chemclipse.chromatogram.filter.ui.l10n.Messages;
import org.eclipse.chemclipse.model.core.IChromatogram;
import org.eclipse.chemclipse.model.core.IScan;
import org.eclipse.chemclipse.model.identifier.ComparisonResult;
Expand All @@ -37,12 +38,13 @@
import org.eclipse.chemclipse.support.ui.workbench.DisplayUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Shell;

@SuppressWarnings("rawtypes")
public class ChromatogramFilter extends AbstractChromatogramFilter {

private static final String IDENTIFIER = "Scan Maxima Detector UI";
private static final String IDENTIFIER = Messages.scanMaximaDetectorUI;

@SuppressWarnings("unchecked")
@Override
Expand All @@ -51,11 +53,11 @@ public IProcessingInfo applyFilter(IChromatogramSelection chromatogramSelection,
IProcessingInfo processingInfo = validate(chromatogramSelection, chromatogramFilterSettings);
//
final MaxDetectorFilterSettings filterSettings;
if(chromatogramFilterSettings instanceof MaxDetectorFilterSettings) {
filterSettings = (MaxDetectorFilterSettings)chromatogramFilterSettings;
if(chromatogramFilterSettings instanceof MaxDetectorFilterSettings maxDetectorFilterSettings) {
filterSettings = maxDetectorFilterSettings;
} else {
filterSettings = PreferenceSupplier.getMaxDetectorFilterSettings();
processingInfo.addWarnMessage(IDENTIFIER, "The settings are not of type: " + MaxDetectorFilterSettings.class + ". Default settings have been choosen instead.");
processingInfo.addWarnMessage(IDENTIFIER, NLS.bind(Messages.settingsNotOfType, MaxDetectorFilterSettings.class));
}
//
if(!processingInfo.hasErrorMessages()) {
Expand All @@ -82,7 +84,7 @@ public void run() {
}
});
}
processingInfo.setProcessingResult(new ChromatogramFilterResult(ResultStatus.OK, "The scan maxima detection was successful."));
processingInfo.setProcessingResult(new ChromatogramFilterResult(ResultStatus.OK, Messages.scanMaximaDetectionSuccessful));
}
return processingInfo;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2021 Lablicate GmbH.
* Copyright (c) 2018, 2023 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 @@ -12,6 +12,7 @@
package org.eclipse.chemclipse.chromatogram.filter.ui.core;

import org.eclipse.chemclipse.chromatogram.filter.ui.Activator;
import org.eclipse.chemclipse.chromatogram.filter.ui.l10n.Messages;
import org.eclipse.chemclipse.numeric.services.IMaximaDetectorService;
import org.eclipse.chemclipse.support.ui.provider.AbstractLabelProvider;
import org.eclipse.jface.dialogs.Dialog;
Expand Down Expand Up @@ -50,7 +51,7 @@ public IMaximaDetectorService getMaximaDetectorService() {
protected void configureShell(Shell newShell) {

super.configureShell(newShell);
newShell.setText("Scan Maxima Detectors");
newShell.setText(Messages.scanMaximaDetectors);
}

@Override
Expand Down Expand Up @@ -83,7 +84,7 @@ protected Control createDialogArea(Composite parent) {
private Label createLabel(Composite parent) {

Label label = new Label(parent, SWT.NONE);
label.setText("Select a scan maximum detector.");
label.setText(Messages.selectScanMaximaDetector);
return label;
}

Expand All @@ -97,15 +98,14 @@ private ComboViewer createComboViewer(Composite parent) {
@Override
public String getText(Object element) {

if(element instanceof IMaximaDetectorService) {
IMaximaDetectorService maximaDetectorService = (IMaximaDetectorService)element;
return maximaDetectorService.getName();
if(element instanceof IMaximaDetectorService service) {
return service.getName();
}
return null;
}
});
//
combo.setToolTipText("Select a scan maxima detetctor.");
combo.setToolTipText(Messages.selectScanMaximaDetector);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.widthHint = 150;
combo.setLayoutData(gridData);
Expand All @@ -115,8 +115,8 @@ public String getText(Object element) {
public void widgetSelected(SelectionEvent e) {

Object object = comboViewer.getStructuredSelection().getFirstElement();
if(object instanceof IMaximaDetectorService) {
maximaDetectorService = (IMaximaDetectorService)object;
if(object instanceof IMaximaDetectorService service) {
maximaDetectorService = service;
}
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* Copyright (c) 2023 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Matthias Mailänder - initial API and implementation
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.filter.ui.l10n;

import org.eclipse.osgi.util.NLS;

public class Messages extends NLS {

private static final String BUNDLE_NAME = "org.eclipse.chemclipse.chromatogram.filter.ui.l10n.messages"; //$NON-NLS-1$
//
public static String chromotogramSelectionFilter;
public static String countIncludingZero;
public static String deltaRetentionTimeMinutes;
public static String detectMinima;
public static String filter;
public static String ionRoundMethod;
public static String matchFactor;
public static String peakTargetsReferenceChromatogram;
public static String qcUseRententionIndexProcessor;
public static String scanMaximaDetectionSuccessful;
public static String scanMaximaDetectors;
public static String scanMaximaDetectorUI;
public static String scanTargetsToPeakTransfer;
public static String scanTargetsToReferenceChromatogramsTransfer;
public static String selectScanMaximaDetector;
public static String settingsNotOfType;
public static String startRetentionTimeMinutes;
public static String stopRetentionTimeMinutes;
public static String targetName;
public static String transferClosestScan;
public static String useBestTargetOnly;
//
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}

private Messages() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
chromotogramSelectionFilter=Chromatogram Selection Filter
countIncludingZero=Count (0 = All)
deltaRetentionTimeMinutes=Delta Retention Time (Minutes)
detectMinima=Detect Minima
filter=Filter
ionRoundMethod=Ion Round Method
matchFactor=Match Factor
peakTargetsReferenceChromatogram=Peak Targets -> Reference Chromatograms Transfer
qcUseRententionIndexProcessor=QC: Use Retention Index (Processor)
scanMaximaDetectionSuccessful=The scan maxima detection was successful.
scanMaximaDetectors=Scan Maxima Detectors
scanMaximaDetectorUI=Scan Maxima Detector UI
scanTargetsToPeakTransfer=Scan Targets -> Peak Transfer
scanTargetsToReferenceChromatogramsTransfer=Scan Targets -> Reference Chromatograms Transfer
selectScanMaximaDetector=Select a scan maxima detector.
settingsNotOfType=The settings are not of type: {0}. Default settings have been chosen instead.
startRetentionTimeMinutes=Start Retention Time (Minutes)
stopRetentionTimeMinutes=Stop Retention Time (Minutes)
targetName=Target Name
transferClosestScan=Transfer Closest Scan
useBestTargetOnly=Use Best Target Only
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
chromotogramSelectionFilter=Chromatogrammselektionsfilter
countIncludingZero=Anzahl (0 = Alle)
deltaRetentionTimeMinutes=Retentionszeitdelta (Minuten)
detectMinima=Detektiere Minima
filter=Filter
ionRoundMethod=Ionenrundungsmethode
matchFactor=�bereinstimmungsfaktor
peakTargetsReferenceChromatogram=Peak Treffer -> Referenzchromatogramm Transfer
qcUseRententionIndexProcessor=QK: Verwende Retentionindex (Prozessor)
scanMaximaDetectionSuccessful=Die Scan Maxima Detektion war erfolgreich.
scanMaximaDetectors=Scan Maxima Detektoren
scanMaximaDetectorUI=Scan Maxima Detektor Benutzeroberfl�che
scanTargetsToPeakTransfer=Scan Treffer -> Peak Transfer
scanTargetsToReferenceChromatogramsTransfer=Scan Treffer -> Referenzchromatogramm Transfer
selectScanMaximaDetector=W�hle einen Scan Maxima Detektor.
settingsNotOfType=Einstellungen sind nicht von Typ: {0}. Standardeinstellungen wurde verwendet.
startRetentionTimeMinutes=Start Retentionszeit (Minuten)
stopRetentionTimeMinutes=Stop Retentionszeit (Minuten)
targetName=Treffer Name
transferClosestScan=�bertrage am n�chsten liegenden Scan
useBestTargetOnly=Nur den besten Treffer nehmen.
Loading