Skip to content

Package: MultiControl$WidgetWrapper$3

MultiControl$WidgetWrapper$3

nameinstructionbranchcomplexitylinemethod
widgetSelected(SelectionEvent)
M: 33 C: 14
30%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 9 C: 2
18%
M: 0 C: 1
100%
{...}
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.edit.internal.swt.controls;
15:
16: import java.lang.reflect.Constructor;
17: import java.lang.reflect.InvocationTargetException;
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.eclipse.core.databinding.Binding;
22: import org.eclipse.core.databinding.observable.list.IListChangeListener;
23: import org.eclipse.core.databinding.observable.list.IObservableList;
24: import org.eclipse.core.databinding.observable.list.ListChangeEvent;
25: import org.eclipse.core.databinding.observable.list.ListDiff;
26: import org.eclipse.core.databinding.observable.list.ListDiffVisitor;
27: import org.eclipse.emf.common.util.Diagnostic;
28: import org.eclipse.emf.common.util.EList;
29: import org.eclipse.emf.databinding.edit.EMFEditObservables;
30: import org.eclipse.emf.ecore.EStructuralFeature.Setting;
31: import org.eclipse.emf.ecp.edit.internal.swt.Activator;
32: import org.eclipse.emf.ecp.edit.internal.swt.util.ECPObservableValue;
33: import org.eclipse.emf.ecp.edit.internal.swt.util.SWTControl;
34: import org.eclipse.emf.ecp.edit.spi.ECPAbstractControl;
35: import org.eclipse.emf.ecp.edit.spi.ECPControlDescription;
36: import org.eclipse.emf.ecp.edit.spi.ECPControlFactory;
37: import org.eclipse.emf.ecp.edit.spi.swt.actions.ECPSWTAction;
38: import org.eclipse.emf.ecp.edit.spi.util.ECPApplicableTester;
39: import org.eclipse.emf.ecp.edit.spi.util.ECPStaticApplicableTester;
40: import org.eclipse.emf.ecp.view.spi.model.VDiagnostic;
41: import org.eclipse.emf.edit.command.MoveCommand;
42: import org.eclipse.emf.edit.command.RemoveCommand;
43: import org.eclipse.emf.edit.domain.EditingDomain;
44: import org.eclipse.jface.action.Action;
45: import org.eclipse.jface.layout.GridDataFactory;
46: import org.eclipse.jface.layout.GridLayoutFactory;
47: import org.eclipse.swt.SWT;
48: import org.eclipse.swt.custom.ScrolledComposite;
49: import org.eclipse.swt.events.SelectionAdapter;
50: import org.eclipse.swt.events.SelectionEvent;
51: import org.eclipse.swt.graphics.Color;
52: import org.eclipse.swt.graphics.Image;
53: import org.eclipse.swt.widgets.Button;
54: import org.eclipse.swt.widgets.Composite;
55: import org.eclipse.swt.widgets.Control;
56: import org.eclipse.swt.widgets.Display;
57: import org.eclipse.swt.widgets.Label;
58:
59: /**
60: * This control provides the necessary common functionality to create a multicontrol that are needed for
61: * {@link org.eclipse.emf.ecore.EStructuralFeature EStructuralFeature}s that have multiple values.
62: *
63: * @deprecated Use the new MultiAttributeSWTRenderer and MultiReferenceSWTRenderer directly instead
64: * @author Eugen Neufeld
65: */
66: @Deprecated
67: public abstract class MultiControl extends SWTControl {
68:
69:         private static final String ICONS_ARROW_DOWN_PNG = "icons/arrow_down.png";//$NON-NLS-1$
70:         private static final String ICONS_ARROW_UP_PNG = "icons/arrow_up.png";//$NON-NLS-1$
71:         private static final String ICONS_UNSET_FEATURE = "icons/unset_feature.png"; //$NON-NLS-1$
72:
73:         private IObservableList model;
74:         private IListChangeListener changeListener;
75:         // list of controls
76:         private final List<WidgetWrapper> widgetWrappers = new ArrayList<WidgetWrapper>();
77:         private final List<ECPSWTAction> toolBarActions = new ArrayList<ECPSWTAction>();
78:         private Composite mainComposite;
79:         private Composite sectionComposite;
80:         private ECPControlDescription controlDescription;
81:         private Class<?> supportedClassType;
82:         private ECPSWTAction[] actions;
83:
84:         private Button unsetButton;
85:         private Label tooltipLabel;
86:
87:         /**
88:          * This returns the array of actions to display in the multi control.
89:          *
90:          * @return the array of action to add
91:          */
92:         protected abstract ECPSWTAction[] instantiateActions();
93:
94:         private void findControlDescription(Setting setting) {
95:                 int bestPriority = -1;
96:                 final ECPControlFactory controlFactory = Activator.getDefault().getECPControlFactory();
97:                 if (controlFactory == null) {
98:                         Activator.getDefault().ungetECPControlFactory();
99:                         return;
100:                 }
101:                 for (final ECPControlDescription description : controlFactory.getControlDescriptors()) {
102:                         for (final ECPApplicableTester tester : description.getTester()) {
103:                                 if (ECPStaticApplicableTester.class.isInstance(tester)) {
104:                                         final ECPStaticApplicableTester test = (ECPStaticApplicableTester) tester;
105:                                         final int priority = getTesterPriority(test, setting);
106:                                         if (bestPriority < priority) {
107:                                                 bestPriority = priority;
108:                                                 controlDescription = description;
109:                                                 supportedClassType = test.getSupportedClassType();
110:                                         }
111:                                 } else {
112:                                         continue;
113:                                 }
114:                         }
115:                 }
116:                 Activator.getDefault().ungetECPControlFactory();
117:         }
118:
119:         /**
120:          * Checks the priority of a tester.
121:          *
122:          * @param tester the {@link ECPStaticApplicableTester} to test
123:          * @param setting the {@link Setting} to use
124:          * @return the priority
125:          */
126:         protected abstract int getTesterPriority(ECPStaticApplicableTester tester,
127:                 Setting setting);
128:
129:         @Override
130:         protected void fillControlComposite(Composite parent) {
131:                 final Setting firstSetting = getFirstSetting();
132:                 findControlDescription(firstSetting);
133:                 actions = instantiateActions();
134:
135:                 mainComposite = new Composite(parent, SWT.BORDER);
136:                 mainComposite.setBackground(parent.getBackground());
137:                 GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(mainComposite);
138:                 GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(mainComposite);
139:
140:                 // TOOLBAR
141:                 createButtonBar();
142:                 // SEPERATOR
143:                 final Label seperator = new Label(mainComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
144:                 GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).span(3, 1).applyTo(seperator);
145:
146:                 model = EMFEditObservables.observeList(getEditingDomain(firstSetting), firstSetting.getEObject(),
147:                         firstSetting.getEStructuralFeature());
148:
149:                 final ScrolledComposite scrolledComposite = new ScrolledComposite(mainComposite, SWT.V_SCROLL);
150:                 scrolledComposite.setExpandVertical(true);
151:                 scrolledComposite.setExpandHorizontal(true);
152:                 GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).hint(SWT.DEFAULT, 150)
153:                         .minSize(SWT.DEFAULT, 150).span(3, 1).applyTo(scrolledComposite);
154:
155:                 sectionComposite = new Composite(scrolledComposite, SWT.NONE);
156:                 sectionComposite.setBackground(parent.getBackground());
157:                 GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).spacing(0, 5).applyTo(sectionComposite);
158:
159:                 changeListener = new ListChangeListener(scrolledComposite);
160:                 model.addListChangeListener(changeListener);
161:                 for (int i = 0; i < model.size(); i++) {
162:                         addControl();
163:                 }
164:                 refreshSection();
165:
166:                 scrolledComposite.setMinSize(sectionComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
167:                 scrolledComposite.setContent(sectionComposite);
168:
169:         }
170:
171:         @Override
172:         protected Button getCustomUnsetButton() {
173:                 return unsetButton;
174:         }
175:
176:         private void isFull() {
177:                 final int upperBound = getFirstStructuralFeature().getUpperBound();
178:                 final boolean full = model.size() >= upperBound && upperBound != -1;
179:                 for (final Action action : toolBarActions) {
180:                         action.setEnabled(!full);
181:                 }
182:         }
183:
184:         private void addControl() {
185:                 if (sectionComposite.isDisposed()) {
186:                         return;
187:                 }
188:
189:                 final ECPObservableValue modelValue = new ECPObservableValue(model, widgetWrappers.size(), supportedClassType);
190:                 final WidgetWrapper h = new WidgetWrapper(modelValue);
191:                 h.createControl(sectionComposite, SWT.NONE);
192:                 widgetWrappers.add(h);
193:         }
194:
195:         /**
196:          * Returns the {@link SWTControl}.
197:          *
198:          * @return the created {@link SWTControl}
199:          */
200:         private SWTControl getSingleInstance() {
201:                 try {
202:                         // final Constructor<? extends ECPControl> widgetConstructor = controlDescription.getControlClass()
203:                         // .getConstructor(boolean.class, IItemPropertyDescriptor.class, EStructuralFeature.class,
204:                         // ECPControlContext.class, boolean.class);
205:                         //
206:                         // return (SWTControl) widgetConstructor.newInstance(false, getItemPropertyDescriptor(),
207:                         // getStructuralFeature(), getModelElementContext(), true);
208:                         final Constructor<? extends ECPAbstractControl> widgetConstructor = controlDescription.getControlClass()
209:                                 .getConstructor();
210:
211:                         final SWTControl control = (SWTControl) widgetConstructor.newInstance();
212:                         control.init(getViewModelContext(), getControl());
213:                         control.setEmbedded(true);
214:                         return control;
215:                 } catch (final IllegalArgumentException ex) {
216:                         Activator.logException(ex);
217:                 } catch (final InstantiationException ex) {
218:                         Activator.logException(ex);
219:                 } catch (final IllegalAccessException ex) {
220:                         Activator.logException(ex);
221:                 } catch (final InvocationTargetException ex) {
222:                         Activator.logException(ex);
223:                 } catch (final SecurityException ex) {
224:                         Activator.logException(ex);
225:                 } catch (final NoSuchMethodException ex) {
226:                         Activator.logException(ex);
227:                 }
228:                 return null;
229:         }
230:
231:         private void refreshSection() {
232:                 int widgetSize = 150;
233:                 if (widgetWrappers.size() > 0) {
234:                         widgetSize = widgetWrappers.size()
235:                                 * (widgetWrappers.get(0).composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y + 5);
236:                 }
237:                 sectionComposite.setSize(sectionComposite.getSize().x, widgetSize < 150 ? 150 : widgetSize);
238:                 sectionComposite.layout();
239:                 isFull();
240:         }
241:
242:         private void createButtonBar() {
243:                 final Composite toolbarComposite = new Composite(mainComposite, SWT.NONE);
244:                 toolbarComposite.setBackground(mainComposite.getBackground());
245:                 GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false).applyTo(toolbarComposite);
246:
247:                 int colNum = actions.length + 1;
248:                 if (!isEmbedded() && getFirstStructuralFeature().isUnsettable()) {
249:                         colNum++;
250:                 }
251:
252:                 GridLayoutFactory.fillDefaults().numColumns(colNum).equalWidth(false).applyTo(toolbarComposite);
253:
254:                 tooltipLabel = new Label(toolbarComposite, SWT.NONE);
255:                 tooltipLabel.setBackground(mainComposite.getBackground());
256:                 GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(tooltipLabel);
257:
258:                 for (final ECPSWTAction action : actions) {
259:                         action.setEnabled(isEditable());
260:                         createButtonForAction(action, toolbarComposite);
261:                 }
262:
263:                 if (!isEmbedded() && getFirstStructuralFeature().isUnsettable()) {
264:                         unsetButton = new Button(toolbarComposite, SWT.PUSH);
265:                         unsetButton.setEnabled(!getControl().isReadonly());
266:                         unsetButton.setToolTipText(getUnsetButtonTooltip());
267:                         unsetButton.setImage(Activator.getImage(ICONS_UNSET_FEATURE));
268:                 }
269:         }
270:
271:         /**
272:          * @author Jonas
273:          *
274:          */
275:         private final class ListChangeListener implements IListChangeListener {
276:                 /**
277:                  * @author jonas
278:                  *
279:                  */
280:                 private final class ListDiffVisitorExtension extends ListDiffVisitor {
281:                         private int widthBeforeChange = -1; // initial negative value
282:
283:                         @Override
284:                         public void handleRemove(int index, Object element) {
285:                                 updateIndicesAfterRemove(index);
286:                                 triggerScrollbarUpdate();
287:                                 updateTargets();
288:                         }
289:
290:                         private void updateTargets() {
291:                                 for (final WidgetWrapper widgetWrapper : widgetWrappers) {
292:                                         widgetWrapper.widget.getDataBindingContext().updateTargets();
293:                                 }
294:                         }
295:
296:                         @Override
297:                         public void handleAdd(int index, Object element) {
298:                                 if (sectionComposite.isDisposed()) {
299:                                         return;
300:                                 }
301:                                 addControl();
302:
303:                                 sectionComposite.layout();
304:                                 triggerScrollbarUpdate();
305:                                 updateTargets();
306:                         }
307:
308:                         @Override
309:                         public void handleMove(int oldIndex, int newIndex, Object element) {
310:                                 updateTargets();
311:                         }
312:
313:                         @Override
314:                         public void handleReplace(int index, Object oldElement, Object newElement) {
315:                                 widgetWrappers.get(index).widget.getDataBindingContext().updateTargets();
316:                         }
317:
318:                         private void triggerScrollbarUpdate() {
319:                                 if (sectionComposite.isDisposed()) {
320:                                         return;
321:                                 }
322:                                 final int widthAfterChange = sectionComposite.getSize().x;
323:                                 if (widthBeforeChange != widthAfterChange) {
324:                                         scrolledComposite
325:                                                 .setMinHeight(sectionComposite.computeSize(widthAfterChange, SWT.DEFAULT).y);
326:                                         widthBeforeChange = widthAfterChange;
327:                                 }
328:                         }
329:                 }
330:
331:                 private final ScrolledComposite scrolledComposite;
332:
333:                 /**
334:                  * @param scrolledComposite
335:                  */
336:                 private ListChangeListener(ScrolledComposite scrolledComposite) {
337:                         this.scrolledComposite = scrolledComposite;
338:                 }
339:
340:                 @Override
341:                 public void handleListChange(ListChangeEvent event) {
342:                         final ListDiff diff = event.diff;
343:                         diff.accept(new ListDiffVisitorExtension());
344:                 }
345:         }
346:
347:         /**
348:          * This class is the common wrapper for multi controls. It adds a remove, move up and move down button.
349:          *
350:          * @author Eugen Neufeld
351:          *
352:          */
353:         private final class WidgetWrapper {
354:
355:                 private ECPObservableValue modelValue;
356:
357:                 private Composite composite;
358:
359:                 private SWTControl widget;
360:
361:                 WidgetWrapper(ECPObservableValue modelValue) {
362:                         this.modelValue = modelValue;
363:                 }
364:
365:                 private WidgetWrapper getThis() {
366:                         return this;
367:                 }
368:
369:                 void createControl(Composite parent, int style) {
370:                         composite = new Composite(parent, style);
371:                         composite.setBackgroundMode(SWT.INHERIT_FORCE);
372:                         composite.setBackground(parent.getBackground());
373:                         GridLayoutFactory.fillDefaults().numColumns(4).spacing(2, 0).applyTo(composite);
374:                         GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(composite);
375:
376:                         widget = getSingleInstance();
377:                         widget.setObservableValue(modelValue);
378:                         final Composite createControl = widget.createControl(composite);
379:
380:                         widget.setEditable(!getControl().isReadonly());
381:
382:                         GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(createControl);
383:
384:                         createDeleteButton(composite);
385:                         if (getFirstStructuralFeature().isOrdered()) {
386:                                 createUpDownButtons(composite);
387:                         }
388:
389:                 }
390:
391:                 /**
392:                  * Initializes the delete button.
393:                  */
394:                 private void createDeleteButton(Composite composite) {
395:                         final Button delB = new Button(composite, SWT.PUSH);
396:                         delB.setImage(Activator.getImage(ICONS_UNSET_FEATURE));
397:                         delB.setEnabled(!getControl().isReadonly());
398:                         delB.addSelectionListener(new SelectionAdapter() {
399:                                 private static final long serialVersionUID = 1L;
400:
401:                                 /*
402:                                  * (non-Javadoc)
403:                                  * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
404:                                  */
405:                                 @Override
406:                                 public void widgetSelected(SelectionEvent e) {
407:                                         final Setting firstSetting = getFirstSetting();
408:                                         final EditingDomain editingDomain = getEditingDomain(firstSetting);
409:
410:                                         editingDomain.getCommandStack()
411:                                                 .execute(
412:                                                         RemoveCommand.create(editingDomain, firstSetting.getEObject(),
413:                                                                 firstSetting.getEStructuralFeature(), modelValue.getValue()));
414:                                 }
415:
416:                         });
417:                 }
418:
419:                 /**
420:                  * Initializes the up/down buttons.
421:                  */
422:                 private void createUpDownButtons(Composite composite) {
423:                         final Image up = Activator.getImage(ICONS_ARROW_UP_PNG);
424:                         final Image down = Activator.getImage(ICONS_ARROW_DOWN_PNG);
425:
426:                         final Button upB = new Button(composite, SWT.PUSH);
427:                         upB.setImage(up);
428:                         upB.setEnabled(!getControl().isReadonly());
429:                         upB.addSelectionListener(new SelectionAdapter() {
430:                                 private static final long serialVersionUID = 1L;
431:
432:                                 /*
433:                                  * (non-Javadoc)
434:                                  * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
435:                                  */
436:                                 @Override
437:                                 public void widgetSelected(SelectionEvent e) {
438:                                         if (getThis().getModelValue().getIndex() == 0) {
439:                                                 return;
440:                                         }
441:                                         final int currentIndex = getThis().getModelValue().getIndex();
442:                                         final Setting firstSetting = getFirstSetting();
443:                                         final EditingDomain editingDomain = getEditingDomain(firstSetting);
444:
445:                                         editingDomain.getCommandStack()
446:                                                 .execute(
447:                                                         new MoveCommand(editingDomain, firstSetting.getEObject(), firstSetting
448:                                                                 .getEStructuralFeature(), currentIndex, currentIndex - 1));
449:
450:                                 }
451:                         });
452:                         final Button downB = new Button(composite, SWT.PUSH);
453:                         downB.setImage(down);
454:                         downB.setEnabled(!getControl().isReadonly());
455:                         downB.addSelectionListener(new SelectionAdapter() {
456:                                 private static final long serialVersionUID = 1L;
457:
458:                                 /*
459:                                  * (non-Javadoc)
460:                                  * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
461:                                  */
462:                                 @Override
463:                                 public void widgetSelected(SelectionEvent e) {
464:•                                        if (getThis().getModelValue().getIndex() + 1 == model.size()) {
465:                                                 return;
466:                                         }
467:                                         final int currentIndex = getThis().getModelValue().getIndex();
468:                                         final Setting firstSetting = getFirstSetting();
469:                                         final EditingDomain editingDomain = getEditingDomain(firstSetting);
470:                                         editingDomain
471:                                                 .getCommandStack()
472:                                                 .execute(
473:                                                         new MoveCommand(editingDomain, firstSetting.getEObject(), firstSetting
474:                                                                 .getEStructuralFeature(), currentIndex, currentIndex + 1));
475:
476:                                 }
477:                         });
478:                 }
479:
480:                 /**
481:                  * @return the modelValue
482:                  */
483:                 ECPObservableValue getModelValue() {
484:                         return modelValue;
485:                 }
486:
487:                 public void dispose() {
488:                         composite.dispose();
489:                         modelValue.dispose();
490:                         widget.dispose();
491:                         composite = null;
492:                         modelValue = null;
493:                         widget = null;
494:                 }
495:         }
496:
497:         private void updateIndicesAfterRemove(int indexRemoved) {
498:                 if (widgetWrappers.size() == 0) {
499:                         return;
500:                 }
501:                 final WidgetWrapper wrapper = widgetWrappers.remove(widgetWrappers.size() - 1);
502:                 wrapper.dispose();
503:         }
504:
505:         /**
506:          * {@inheritDoc}
507:          *
508:          * @see org.eclipse.emf.ecp.edit.spi.ECPAbstractControl#applyValidation(org.eclipse.emf.ecp.view.spi.model.VDiagnostic)
509:          */
510:         @Override
511:         protected void applyValidation(final VDiagnostic diagnostic) {
512:                 Display.getDefault().asyncExec(new Runnable() {
513:                         @Override
514:                         public void run() {
515:                                 final Diagnostic displayedDiagnostic = getMostSevereDiagnostic(diagnostic);
516:                                 if (displayedDiagnostic == null) {
517:                                         if (validationLabel == null || validationLabel.isDisposed()) {
518:                                                 return;
519:                                         }
520:                                         updateValidationColor(null);
521:                                         validationLabel.setImage(null);
522:                                         validationLabel.setToolTipText(""); //$NON-NLS-1$
523:                                 } else {
524:                                         updateValidationColor(getValidationBackgroundColor(displayedDiagnostic.getSeverity()));
525:                                         if (validationLabel == null) {
526:                                                 return;
527:                                         }
528:                                         final Image image = getValidationIcon(displayedDiagnostic.getSeverity());
529:                                         validationLabel.setImage(image);
530:                                         validationLabel.setToolTipText(displayedDiagnostic.getMessage());
531:                                 }
532:                         }
533:                 });
534:         }
535:
536:         /**
537:          * @param diagnostic
538:          * @return
539:          */
540:         private Diagnostic getMostSevereDiagnostic(VDiagnostic diagnostic) {
541:                 int highestSeverity = -1;
542:                 Diagnostic displayedDiagnostic = null;
543:                 if (diagnostic == null) {
544:                         return displayedDiagnostic;
545:                 }
546:                 final EList<Object> diagnostics = diagnostic.getDiagnostics();
547:                 for (final Object object : diagnostics) {
548:                         if (object == null) {
549:                                 continue;
550:                         }
551:                         final Diagnostic childDiagnostic = (Diagnostic) object;
552:                         if (childDiagnostic.getSeverity() > highestSeverity) {
553:                                 highestSeverity = childDiagnostic.getSeverity();
554:                                 displayedDiagnostic = childDiagnostic;
555:                         }
556:                 }
557:                 return displayedDiagnostic;
558:         }
559:
560:         /**
561:          * Allows controls to supply a second visual effect for controls on validation. The color to set is provided as the
562:          * parameter.
563:          *
564:          * @param color the color to set, null if the default background color should be set
565:          */
566:         protected void updateValidationColor(Color color) {
567:
568:         }
569:
570:         /**
571:          * {@inheritDoc}
572:          */
573:         @Override
574:         public void dispose() {
575:                 super.dispose();
576:                 model.removeListChangeListener(changeListener);
577:                 model.dispose();
578:
579:                 for (final WidgetWrapper helper : widgetWrappers) {
580:                         helper.dispose();
581:                 }
582:                 mainComposite.dispose();
583:         }
584:
585:         @Override
586:         public Binding bindValue() {
587:                 return null;
588:         }
589:
590:         /**
591:          * {@inheritDoc}
592:          *
593:          * @deprecated
594:          */
595:         @Deprecated
596:         @Override
597:         public void setEditable(boolean isEditable) {
598:                 for (final ECPSWTAction action : actions) {
599:                         action.setEnabled(isEditable);
600:                 }
601:         }
602:
603:         @Override
604:         protected Control[] getControlsForTooltip() {
605:                 return new Control[] { tooltipLabel };
606:         }
607:
608:         /**
609:          * {@inheritDoc}
610:          *
611:          * @deprecated
612:          */
613:         @Override
614:         @Deprecated
615:         public boolean showLabel() {
616:                 return true;
617:         }
618:
619: }