Go on centralizing widely used UI method in EclipseUiUtils
authorBruno Sinou <bsinou@argeo.org>
Tue, 2 Jun 2015 17:51:36 +0000 (17:51 +0000)
committerBruno Sinou <bsinou@argeo.org>
Tue, 2 Jun 2015 17:51:36 +0000 (17:51 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@8143 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/EclipseUiUtils.java

index e2d5f2e81bdc1bf6310d5ba55c2acb685ec9e3ad..f3979d074e94fbd77f8f79e646ab4ca3395b634b 100644 (file)
@@ -24,12 +24,19 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
 /** Utilities to simplify UI development. */
 public class EclipseUiUtils {
 
+       /** Dispose all children of a Composite */
+       public static void clear(Composite composite) {
+               for (Control child : composite.getChildren())
+                       child.dispose();
+       }
+
        //
        // Simplify grid layouts management
        //