Skip to content

Commit

Permalink
Merge pull request #774 from Mailaender/ilabel
Browse files Browse the repository at this point in the history
Use the new ILabel interface for automatic combo box labelling
  • Loading branch information
eselmeister authored Oct 13, 2021
2 parents 20595ce + 5dc92bb commit 45bb131
Show file tree
Hide file tree
Showing 45 changed files with 299 additions and 206 deletions.
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

0 comments on commit 45bb131

Please sign in to comment.