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

Show also Description in Group Label Wizard #1881

Merged
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
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