]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms.ui/src/org/argeo/cms/ui/viewers/Section.java
Major refactoring of Argeo CMS UI
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / ui / viewers / Section.java
index 730ba671d71def6011c3d025a8beed39fb8cc58b..d282eebbe72b5789aa7d31b634dbe81be198850a 100644 (file)
@@ -7,7 +7,7 @@ import java.util.Map;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
-import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.ui.widgets.JcrComposite;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
@@ -38,7 +38,7 @@ public class Section extends JcrComposite {
                        } else {
                                relativeDepth = 0;
                        }
-                       setLayout(CmsUiUtils.noSpaceGridLayout());
+                       setLayout(CmsSwtUtils.noSpaceGridLayout());
                } catch (RepositoryException e) {
                        throw new IllegalStateException("Cannot create section from " + node, e);
                }
@@ -78,8 +78,8 @@ public class Section extends JcrComposite {
                        sectionHeader.dispose();
 
                sectionHeader = new Composite(parent, SWT.NONE);
-               sectionHeader.setLayoutData(CmsUiUtils.fillWidth());
-               sectionHeader.setLayout(CmsUiUtils.noSpaceGridLayout());
+               sectionHeader.setLayoutData(CmsSwtUtils.fillWidth());
+               sectionHeader.setLayout(CmsSwtUtils.noSpaceGridLayout());
                // sectionHeader.moveAbove(null);
                // layout();
                return sectionHeader;
@@ -106,13 +106,20 @@ public class Section extends JcrComposite {
        public SectionPart nextSectionPart(SectionPart sectionPart) {
                Control[] children = getChildren();
                for (int i = 0; i < children.length; i++) {
-                       if (sectionPart == children[i])
-                               if (i + 1 < children.length) {
-                                       Composite next = (Composite) children[i + 1];
-                                       return (SectionPart) next;
-                               } else {
-                                       // next section
+                       if (sectionPart == children[i]) {
+                               for (int j = i + 1; j < children.length; j++) {
+                                       if (children[i + 1] instanceof SectionPart) {
+                                               return (SectionPart) children[i + 1];
+                                       }
                                }
+
+//                             if (i + 1 < children.length) {
+//                                     Composite next = (Composite) children[i + 1];
+//                                     return (SectionPart) next;
+//                             } else {
+//                                     // next section
+//                             }
+                       }
                }
                return null;
        }