]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/maintenance/Browse.java
Session authentication working
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / maintenance / Browse.java
index e0bba81682ba09c7ab402a77cdd108c59ecb1304..98792575bf92e982521eb4b16d7cb84cc5be5362 100644 (file)
@@ -60,8 +60,8 @@ public class Browse implements CmsUiProvider {
        private final static String BROWSE_PREFIX = "browse#";
        private final static int THUMBNAIL_WIDTH = 400;
        private final static int COLUMN_WIDTH = 160;
-       private DateFormat timeFormatter = new SimpleDateFormat("dd-MM-yyyy', 'HH:mm");
-       
+       private DateFormat timeFormatter = new SimpleDateFormat(
+                       "dd-MM-yyyy', 'HH:mm");
 
        // keep a cache of the opened nodes
        // Key is the path
@@ -79,6 +79,7 @@ public class Browse implements CmsUiProvider {
        public Control createUi(Composite parent, Node context)
                        throws RepositoryException {
                if (context == null)
+                       // return null;
                        throw new CmsException("Context cannot be null");
                GridLayout layout = CmsUtils.noSpaceGridLayout();
                layout.numColumns = 2;
@@ -255,6 +256,9 @@ public class Browse implements CmsUiProvider {
                        currParPath = JcrUtils.parentPath(currNodePath);
                if ("".equals(currParPath))
                        currParPath = "/";
+               
+               
+               
 
                Object[][] colMatrix = new Object[browserCols.size()][2];
 
@@ -266,7 +270,8 @@ public class Browse implements CmsUiProvider {
                                boolean leaveOpened = path.startsWith(currNodePath);
 
                                // workaround for same name siblings
-                               // fix me weird side effect when we go left or click on anb already selected, unfocused node
+                               // fix me weird side effect when we go left or click on anb
+                               // already selected, unfocused node
                                if (leaveOpened
                                                && (path.lastIndexOf("/") == 0
                                                                && currNodePath.lastIndexOf("/") == 0 || JcrUtils
@@ -290,6 +295,15 @@ public class Browse implements CmsUiProvider {
                                ((FilterEntitiesVirtualTable) colMatrix[l][1]).dispose();
                        }
 
+               // Remove disposed columns
+               // TODO investigate and fix the mechanism that leave them there after
+               // disposal
+               if (browserCols.containsKey(currNodePath)) {
+                       FilterEntitiesVirtualTable currCol = browserCols.get(currNodePath);
+                       if (currCol.isDisposed())
+                               browserCols.remove(currNodePath);
+               }
+
                if (!browserCols.containsKey(currNodePath))
                        createBrowserColumn(colViewer, node);
 
@@ -328,6 +342,10 @@ public class Browse implements CmsUiProvider {
 
        private Point imageWidth = new Point(250, 0);
 
+       /**
+        * Recreates the content of the box that displays information about the
+        * current selected node.
+        */
        private Control createNodeView(Composite parent, Node context)
                        throws RepositoryException {
 
@@ -530,7 +548,7 @@ public class Browse implements CmsUiProvider {
                                                } else if (e.keyCode == SWT.ARROW_LEFT) {
                                                        try {
                                                                selected = getNode().getParent();
-                                                               String newPath = selected.getPath(); //getNode().getParent()
+                                                               String newPath = selected.getPath(); // getNode().getParent()
                                                                setEdited(selected);
                                                                if (browserCols.containsKey(newPath))
                                                                        browserCols.get(newPath).setFocus();