Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
kernel
Commits
8c970391
Commit
8c970391
authored
Apr 19, 2017
by
Simon Barner
Browse files
- Remove obsolete workaround to create dummy image for text-only entries (fixed in OPAL 1.0.4)
parent
a523f7bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/MultiSelectionCellEditor.java
View file @
8c970391
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment