Revision ee305eb1
Added by Katja Luther about 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearchResultComposite.java | ||
---|---|---|
118 | 118 |
protected IStatus run(IProgressMonitor monitor) { |
119 | 119 |
Collection<URI> mediaUris = new HashSet<>(); |
120 | 120 |
for (UUID uuid : mediaUuids) { |
121 |
if (TermSearchResultComposite.this.isDisposed()){ |
|
122 |
this.cancel(); |
|
123 |
} |
|
121 | 124 |
Media media = CdmStore.getService(IMediaService.class).load(uuid); |
122 | 125 |
if(media==null){ |
123 | 126 |
continue; |
... | ... | |
135 | 138 |
// ignore |
136 | 139 |
} |
137 | 140 |
} |
138 |
Composite mediaContainer = new Composite(content, SWT.NONE); |
|
139 |
mediaContainer.setLayout(new FillLayout()); |
|
140 |
for (Image image : imageBuffer) { |
|
141 |
Composite composite = new Composite(mediaContainer, SWT.NONE); |
|
142 |
composite.addPaintListener(new PaintListener() { |
|
143 |
@Override |
|
144 |
public void paintControl(PaintEvent e) { |
|
145 |
if(image!=null){ |
|
146 |
e.gc.setAntialias(SWT.ON); |
|
147 |
e.gc.setInterpolation(SWT.HIGH); |
|
148 |
e.gc.drawImage(image, 0, 0,image.getBounds().width, image.getBounds().height,0, 0, 40, 40); |
|
149 |
e.gc.dispose(); |
|
150 |
} |
|
141 |
try{ |
|
142 |
if (!content.isDisposed()){ |
|
143 |
Composite mediaContainer = new Composite(content, SWT.NONE); |
|
144 |
mediaContainer.setLayout(new FillLayout()); |
|
145 |
for (Image image : imageBuffer) { |
|
146 |
Composite composite = new Composite(mediaContainer, SWT.NONE); |
|
147 |
composite.addPaintListener(new PaintListener() { |
|
148 |
@Override |
|
149 |
public void paintControl(PaintEvent e) { |
|
150 |
if(image!=null){ |
|
151 |
e.gc.setAntialias(SWT.ON); |
|
152 |
e.gc.setInterpolation(SWT.HIGH); |
|
153 |
e.gc.drawImage(image, 0, 0,image.getBounds().width, image.getBounds().height,0, 0, 40, 40); |
|
154 |
e.gc.dispose(); |
|
155 |
} |
|
156 |
} |
|
157 |
}); |
|
151 | 158 |
} |
152 |
}); |
|
159 |
} |
|
160 |
}catch(IllegalArgumentException e){ |
|
161 |
System.err.println(e.getStackTrace()); |
|
162 |
} |
|
163 |
if (!TermSearchResultComposite.this.isDisposed() && !TermSearchResultComposite.this.getParent().isDisposed()){ |
|
164 |
TermSearchResultComposite.this.getParent().layout(); |
|
153 | 165 |
} |
154 |
|
|
155 |
TermSearchResultComposite.this.getParent().layout(); |
|
156 | 166 |
}); |
157 | 167 |
return Status.OK_STATUS; |
158 | 168 |
} |
Also available in: Unified diff
avoid widget is disposed exceptions for termsearch