Skip to content

Commit

Permalink
Show also Description in Group Label Wizard
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenz Gerber <lorenz.gerber@lablicate.com>
  • Loading branch information
lorenzgerber committed Sep 20, 2024
1 parent 537c8f1 commit c37d30f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,30 @@
public class SampleGroupAssignerLabelProvider extends AbstractChemClipseLabelProvider {

public static final String SAMPLE_NAME = "Sample Name";
public static final String DESCRIPTION = "Description";
public static final String SELECT = "Select";
public static final String GROUP_NAME = "Group Name";
public static final int INDEX_COLOR = 2;
//
public static String[] TITLES = {//
SAMPLE_NAME, //
DESCRIPTION, //
SELECT, //
GROUP_NAME //
};
//
public static int[] BOUNDS = {//
300, //
100, //
200, //
30, //
100, //
};

@Override
public Image getColumnImage(Object element, int columnIndex) {

if(columnIndex == 0) {
if(columnIndex == 0 && columnIndex == 1) {
return getImage(element);
} else if(columnIndex == 1) {
} else if(columnIndex == 2) {
if(element instanceof ISample sample) {
if(sample.isSelected()) {
return ApplicationImageFactory.getInstance().getImage(IApplicationImage.IMAGE_SELECTED, IApplicationImageProvider.SIZE_16x16);
Expand All @@ -65,9 +67,12 @@ public String getColumnText(Object element, int columnIndex) {
text = sample.getSampleName() != null ? sample.getSampleName() : "";
break;
case 1:
text = ""; // Checkbox
text = sample.getDescription() != null ? sample.getDescription() : "";
break;
case 2:
text = ""; // Checkbox
break;
case 3:
text = sample.getGroupName() != null ? sample.getGroupName() : "";
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private List<ISample> extractSamples(List<ISample> samples) {
List<ISample> samplesCopy = new ArrayList<ISample>();
//
for(ISample sample : samples) {
ISample sampleCopy = new Sample(sample.getSampleName(), sample.getGroupName());
ISample sampleCopy = new Sample(sample.getSampleName(), sample.getGroupName(), sample.getDescription());
sampleCopy.setSelected(false);
samplesCopy.add(sampleCopy);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*******************************************************************************
* Copyright (c) 2015, 2022 Lablicate GmbH.
* Copyright (c) 2015, 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
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Dr. Philip Wenig - initial API and implementation
* Philip Wenig - initial API and implementation
* Lorenz Gerber - additional Constructor
*******************************************************************************/
package org.eclipse.chemclipse.xxd.process.supplier.pca.model;

Expand All @@ -21,6 +22,13 @@ public Sample(String sampleName, String groupName) {
setGroupName(groupName);
}

public Sample(String sampleName, String groupName, String description) {

super(sampleName);
setGroupName(groupName);
setDescription(description);
}

public Sample(String sampleName, String groupName, String classification, String description) {

super(sampleName);
Expand Down

0 comments on commit c37d30f

Please sign in to comment.