Commit 8c970391 authored by Simon Barner's avatar Simon Barner
Browse files

- Remove obsolete workaround to create dummy image for text-only entries (fixed in OPAL 1.0.4)

parent a523f7bf
......@@ -30,15 +30,11 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.DialogCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.mihalis.opal.itemSelector.DLItem;
import org.mihalis.opal.itemSelector.DualList;
......@@ -51,7 +47,7 @@ import org.mihalis.opal.itemSelector.SelectionChangeListener;
* @author barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: A1F77143E07BA25C297FFA48654A6313
* @ConQAT.Rating YELLOW Hash: D45A2BB67FDB88B44CADF1FE266167A5
*/
public class MultiSelectionCellEditor extends DialogCellEditor {
......@@ -122,14 +118,12 @@ public class MultiSelectionCellEditor extends DialogCellEditor {
super(parent, SWT.NONE);
Image dummyImage = createDummyImage(getShell().getDisplay());
List<String> labels = new ArrayList<String>();
labels.addAll(labelValueMapping.getLabels());
for(Object selectedItem : selectedElements) {
String label = labelValueMapping.getLabelForValue(selectedItem);
DLItem item = new DLItem(label, dummyImage);
DLItem item = new DLItem(label);
add(item);
selectDoNotFireEvent(0);
remove(item);
......@@ -137,24 +131,11 @@ public class MultiSelectionCellEditor extends DialogCellEditor {
}
for(String label : labels) {
DLItem item = new DLItem(label, dummyImage);
DLItem item = new DLItem(label);
add(item);
}
}
/**
* Creates a dummy image required to work around a layout bug in {@link DualList} if used
* without any image.
*/
private Image createDummyImage(Display display) {
Image image = new Image(display, 1, 1);
GC gc = new GC(image);
gc.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
gc.fillRectangle(new Rectangle(0, 0, 1, 1));
gc.dispose();
return image;
}
/** {@inheritDoc} */
@Override
public void deselectAll(final boolean shouldFireEvents) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment