fix bug on creation of the BundleRawPage
authorBruno Sinou <bsinou@argeo.org>
Fri, 8 Mar 2013 09:52:57 +0000 (09:52 +0000)
committerBruno Sinou <bsinou@argeo.org>
Fri, 8 Mar 2013 09:52:57 +0000 (09:52 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@6106 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/ArtifactsBrowserPage.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/BundleRawPage.java
plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/GenericBundleEditor.java

index f8979dea8a4b10276e4dda971766ac2861f66460..9f44f1611eef1dc5c8ffd75cb057f7fc4a551033 100644 (file)
@@ -20,13 +20,9 @@ import java.text.SimpleDateFormat;
 
 import javax.jcr.Node;
 import javax.jcr.Property;
-import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.Value;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.argeo.ArgeoException;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.slc.client.ui.dist.DistConstants;
@@ -62,8 +58,8 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
 public class ArtifactsBrowserPage extends FormPage implements DistConstants,
                RepoConstants {
        final static String PAGE_ID = "artifactsBrowserPage";
-       private final static Log log = LogFactory
-                       .getLog(ArtifactsBrowserPage.class);
+       // private final static Log log = LogFactory
+       // .getLog(ArtifactsBrowserPage.class);
 
        /* DEPENDENCY INJECTION */
        private Session jcrSession;
@@ -264,23 +260,23 @@ public class ArtifactsBrowserPage extends FormPage implements DistConstants,
                        return null;
                }
 
-               private String formatValueAsString(Value value) {
-                       // TODO enhance this method
-                       try {
-                               String strValue;
-
-                               if (value.getType() == PropertyType.BINARY)
-                                       strValue = "<binary>";
-                               else if (value.getType() == PropertyType.DATE)
-                                       strValue = timeFormatter.format(value.getDate().getTime());
-                               else
-                                       strValue = value.getString();
-                               return strValue;
-                       } catch (RepositoryException e) {
-                               throw new ArgeoException(
-                                               "unexpected error while formatting value", e);
-                       }
-               }
+               // private String formatValueAsString(Value value) {
+               // // TODO enhance this method
+               // try {
+               // String strValue;
+               //
+               // if (value.getType() == PropertyType.BINARY)
+               // strValue = "<binary>";
+               // else if (value.getType() == PropertyType.DATE)
+               // strValue = timeFormatter.format(value.getDate().getTime());
+               // else
+               // strValue = value.getString();
+               // return strValue;
+               // } catch (RepositoryException e) {
+               // throw new ArgeoException(
+               // "unexpected error while formatting value", e);
+               // }
+               // }
        }
 
        private class ArtifactTreeSelectionListener implements
index 329adc8909a0b89f1f32374775ab3e1fbf699b4b..d989cff938cbc483d4227270fd75ba4adafa7911 100644 (file)
@@ -41,7 +41,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeColumn;
 import org.eclipse.ui.forms.IManagedForm;
@@ -62,7 +61,6 @@ public class BundleRawPage extends FormPage implements SlcNames, SlcTypes {
 
        // This page widgets
        private TreeViewer complexTree;
-       private Text mavenSnippet;
 
        public BundleRawPage(FormEditor editor, String title, Node currentNode) {
                super(editor, "id", title);
@@ -74,12 +72,11 @@ public class BundleRawPage extends FormPage implements SlcNames, SlcTypes {
                GridLayout layout = new GridLayout(1, false);
                layout.marginWidth = 5;
                form.getBody().setLayout(layout);
-
                createViewer(form.getBody());
        }
 
        private void createViewer(Composite parent) {
-               
+
                // Create the viewer
                int style = SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION;
                Tree tree = new Tree(parent, style);
@@ -91,6 +88,7 @@ public class BundleRawPage extends FormPage implements SlcNames, SlcTypes {
                createColumn(tree, "Value", SWT.LEFT, 200);
                tree.setLinesVisible(true);
                tree.setHeaderVisible(true);
+               complexTree = new TreeViewer(tree);
 
                // Configure
                complexTree.addDoubleClickListener(new GenericDoubleClickListener());
@@ -105,7 +103,6 @@ public class BundleRawPage extends FormPage implements SlcNames, SlcTypes {
 
        }
 
-       
        private static TreeColumn createColumn(Tree parent, String name, int style,
                        int width) {
                TreeColumn result = new TreeColumn(parent, style);
@@ -334,4 +331,4 @@ public class BundleRawPage extends FormPage implements SlcNames, SlcTypes {
                public void dispose() {
                }
        }
-}
+}
\ No newline at end of file
index 17e546aaf1a78ff21f4f697b1f0f786f031d303d..1274f7c83ddf1102d09fe39624ad32badbb98c0c 100644 (file)
@@ -56,7 +56,7 @@ public class GenericBundleEditor extends FormEditor {
                try {
                        bundleDetailsPage = new BundleDetailsPage(this, "Main", bundleNode);
                        addPage(bundleDetailsPage);
-                       bundleRawPage = new BundleRawPage(this, "Main", bundleNode);
+                       bundleRawPage = new BundleRawPage(this, "Raw info", bundleNode);
                        addPage(bundleRawPage);
                } catch (PartInitException e) {
                        throw new ArgeoException("Not able to add an empty page ", e);