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

Use the new ILabel interface for automatic combo box labelling #774

Merged
merged 3 commits into from
Oct 13, 2021
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
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum AdjacentPeakSubtraction {
import org.eclipse.chemclipse.support.text.ILabel;

public enum AdjacentPeakSubtraction implements ILabel {

TWO("Two", "0"), //
ONE("One", "1"), //
NONE("None", "2");
Expand All @@ -25,22 +28,23 @@ private AdjacentPeakSubtraction(String label, String value) {
this.value = value;
}

public String getLabel() {
@Override
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{TWO.getLabel(), TWO.getValue()}, //
{ONE.getLabel(), ONE.getValue()}, //
{NONE.getLabel(), NONE.getValue()}//
{TWO.label(), TWO.value()}, //
{ONE.label(), ONE.value()}, //
{NONE.label(), NONE.value()}//
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum InstrumentFile {
import org.eclipse.chemclipse.support.text.ILabel;

public enum InstrumentFile implements ILabel {

CDF("CDF", "2");

private String label = "";
Expand All @@ -23,20 +26,21 @@ private InstrumentFile(String label, String value) {
this.value = value;
}

public String getLabel() {
@Override
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{CDF.getLabel(), CDF.getValue()}//
{CDF.label(), CDF.value()}//
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum InstrumentType {
import org.eclipse.chemclipse.support.text.ILabel;

public enum InstrumentType implements ILabel {

QUADRUPOLE("Quadrupole", "0"), //
ION_TRAP("Ion Trap", "1"), //
MAGNETIC_SECTOR("Magnetic Sector", "2"), //
Expand All @@ -26,23 +29,23 @@ private InstrumentType(String label, String value) {
this.value = value;
}

public String getLabel() {
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{QUADRUPOLE.getLabel(), QUADRUPOLE.getValue()}, //
{ION_TRAP.getLabel(), ION_TRAP.getValue()}, //
{MAGNETIC_SECTOR.getLabel(), MAGNETIC_SECTOR.getValue()}, //
{SIM.getLabel(), SIM.getValue()}//
{QUADRUPOLE.label(), QUADRUPOLE.value()}, //
{ION_TRAP.label(), ION_TRAP.value()}, //
{MAGNETIC_SECTOR.label(), MAGNETIC_SECTOR.value()}, //
{SIM.label(), SIM.value()}//
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum Option {
import org.eclipse.chemclipse.support.text.ILabel;

public enum Option implements ILabel {

YES("Yes", "1"), //
NO("No", "0");

Expand All @@ -24,21 +27,21 @@ private Option(String label, String value) {
this.value = value;
}

public String getLabel() {
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{YES.getLabel(), YES.getValue()}, //
{NO.getLabel(), NO.getValue()}//
{YES.label(), YES.value()}, //
{NO.label(), NO.value()}//
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum Resolution {
import org.eclipse.chemclipse.support.text.ILabel;

public enum Resolution implements ILabel {

HIGH("High", "0"), //
MEDIUM("Medium", "1"), //
LOW("Low", "2");
Expand All @@ -25,22 +28,22 @@ private Resolution(String label, String value) {
this.value = value;
}

public String getLabel() {
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{HIGH.getLabel(), HIGH.getValue()}, //
{MEDIUM.getLabel(), MEDIUM.getValue()}, //
{LOW.getLabel(), LOW.getValue()} //
{HIGH.label(), HIGH.value()}, //
{MEDIUM.label(), MEDIUM.value()}, //
{LOW.label(), LOW.value()} //
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum ScanDirection {
import org.eclipse.chemclipse.support.text.ILabel;

public enum ScanDirection implements ILabel {

HIGH_TO_LOW("High to Low", "-1"), //
NONE("None", "0"), //
LOW_TO_HIGH("Low to High", "1");
Expand All @@ -25,22 +28,23 @@ private ScanDirection(String label, String value) {
this.value = value;
}

public String getLabel() {
@Override
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{HIGH_TO_LOW.getLabel(), HIGH_TO_LOW.getValue()}, //
{NONE.getLabel(), NONE.getValue()}, //
{LOW_TO_HIGH.getLabel(), LOW_TO_HIGH.getValue()}//
{HIGH_TO_LOW.label(), HIGH_TO_LOW.value()}, //
{NONE.label(), NONE.value()}, //
{LOW_TO_HIGH.label(), LOW_TO_HIGH.value()}//
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum Sensitivity {
import org.eclipse.chemclipse.support.text.ILabel;

public enum Sensitivity implements ILabel {

VERY_HIGH("Very High", "60"), //
HIGH("High", "30"), //
MEDIUM("Medium", "10"), //
Expand All @@ -27,24 +30,25 @@ private Sensitivity(String label, String value) {
this.value = value;
}

public String getLabel() {
@Override
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{VERY_HIGH.getLabel(), VERY_HIGH.getValue()}, //
{HIGH.getLabel(), HIGH.getValue()}, //
{MEDIUM.getLabel(), MEDIUM.getValue()}, //
{LOW.getLabel(), LOW.getValue()}, //
{VERY_LOW.getLabel(), VERY_LOW.getValue()} //
{VERY_HIGH.label(), VERY_HIGH.value()}, //
{HIGH.label(), HIGH.value()}, //
{MEDIUM.label(), MEDIUM.value()}, //
{LOW.label(), LOW.value()}, //
{VERY_LOW.label(), VERY_LOW.value()} //
};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Lablicate GmbH.
* Copyright (c) 2020, 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
Expand All @@ -11,7 +11,10 @@
*******************************************************************************/
package org.eclipse.chemclipse.chromatogram.msd.peak.detector.supplier.amdis.model;

public enum ShapeRequirements {
import org.eclipse.chemclipse.support.text.ILabel;

public enum ShapeRequirements implements ILabel {

HIGH("High", "2"), //
MEDIUM("Medium", "1"), //
LOW("Low", "0"); //
Expand All @@ -25,22 +28,22 @@ private ShapeRequirements(String label, String value) {
this.value = value;
}

public String getLabel() {
public String label() {

return label;
}

public String getValue() {
public String value() {

return value;
}

public static String[][] getItems() {

return new String[][]{//
{HIGH.getLabel(), HIGH.getValue()}, //
{MEDIUM.getLabel(), MEDIUM.getValue()}, //
{LOW.getLabel(), LOW.getValue()} //
{HIGH.label(), HIGH.value()}, //
{MEDIUM.label(), MEDIUM.value()}, //
{LOW.label(), LOW.value()} //
};
}
}
Loading