/*
- * Copyright (C) 2007-2012 Mathieu Baudier
+ * Copyright (C) 2007-2012 Argeo GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
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;
import org.argeo.slc.client.ui.dist.DistImages;
import org.argeo.slc.client.ui.dist.DistPlugin;
-import org.argeo.slc.client.ui.dist.providers.ArtifactsTreeContentProvider;
+import org.argeo.slc.client.ui.dist.controllers.ArtifactsTreeContentProvider;
import org.argeo.slc.client.ui.dist.utils.GenericDoubleClickListener;
import org.argeo.slc.jcr.SlcTypes;
import org.argeo.slc.repo.RepoConstants;
public class ArtifactsBrowser extends ViewPart implements DistConstants,
RepoConstants {
- private final static Log log = LogFactory.getLog(ArtifactsBrowser.class);
+ // private final static Log log = LogFactory.getLog(ArtifactsBrowser.class);
public final static String ID = DistPlugin.ID + ".artifactsBrowser";
/* DEPENDENCY INJECTION */
// Model initialisation
if (jcrSession != null) {
try {
- rootNode = jcrSession.getNode(ARTIFACTS_BASE_PATH);
+ rootNode = jcrSession.getNode(DEFAULT_ARTIFACTS_BASE_PATH);
artifactTreeViewer.setInput(rootNode);
} catch (RepositoryException e) {
throw new ArgeoException("Cannot load base artifact nodes", e);
viewer.setContentProvider(new ArtifactsTreeContentProvider());
viewer.setLabelProvider(new ArtifactLabelProvider());
viewer.addSelectionChangedListener(new ArtifactTreeSelectionListener());
- viewer.addDoubleClickListener(new GenericDoubleClickListener(viewer));
+ viewer.addDoubleClickListener(new GenericDoubleClickListener());
viewer.setInput(rootNode);
return viewer;
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