import java.util.ConcurrentModificationException;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
elements.add(element);
}
- protected void removeElement(ICdmFormElement element){
- elements.remove(element);
- }
-
/**
* Remove all child {@link ICdmFormElement}s and child {@link Control}s
* of the given and the element itself.
*/
@Override
public void removeElements(){
- for(ICdmFormElement childElement : getElements()){
+ for (Iterator<ICdmFormElement> iterator = getElements().iterator();iterator.hasNext();) {
+ ICdmFormElement childElement = iterator.next();
// recursion
childElement.removeElements();
// dispose of the controls
removeControls(childElement);
}
+ if(this instanceof ISelectableElement){
+ SelectionArbitrator selectionArbitrator = ((ISelectableElement) this).getSelectionArbitrator();
+ if(selectionArbitrator != null){
+ formFactory.destroySelectionArbitrator(selectionArbitrator);
+ }
+ }
removeControls(this);
elements.clear();
}
}
}
- protected void reflowParentScrolledForm(boolean flushCashes){
- ScrolledForm scrolledForm = null;
- Composite parent = getLayoutComposite().getParent();
- while(parent!=null && !(parent instanceof ScrolledForm)){
- parent = parent.getParent();
- }
- scrolledForm = (ScrolledForm)parent;
- if(scrolledForm!=null){
- scrolledForm.reflow(flushCashes);
- }
- }
-
@Override
public void refresh() {
// empty default implementation