try {
// Note: it is important to to use the default way (recursing through parents),
// since the session may not have access to parent nodes
- return ContentUtils.ROOT_SLASH + jcrWorkspace + getJcrNode().getPath();
+ return Content.ROOT_PATH + jcrWorkspace + getJcrNode().getPath();
} catch (RepositoryException e) {
throw new JcrException("Cannot get depth of " + getJcrNode(), e);
}
if (contentSession == null)
throw new IllegalArgumentException(
"Cannot adapt " + node + " to content, because it was not loaded from a content session");
- return contentSession.get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + node.getPath());
+ return contentSession.get(Content.ROOT_PATH + CmsConstants.SYS_WORKSPACE + node.getPath());
} catch (RepositoryException e) {
throw new JcrException("Cannot adapt " + node + " to a content", e);
}
// use control AFTER setting style, since it may have been reset
if (part instanceof EditableImage) {
EditableImage editableImage = (EditableImage) part;
- imageManager().load(partNode, part.getControl(), editableImage.getPreferredImageSize());
+ imageManager().load(partNode, part.getControl(), editableImage.getPreferredImageSize(), null);
}
}
}
import org.argeo.jcr.JcrUtils;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.service.ResourceManager;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.widgets.Display;
/** Manages only public images so far. */
public class DefaultImageManager extends AbstractSwtImageManager<Node> {
}
}
- public Image getSwtImage(Node node) {
+ public ImageData getSwtImageData(Node node) {
InputStream inputStream = null;
Binary binary = getImageBinary(node);
if (binary == null)
return null;
try {
inputStream = binary.getStream();
- return new Image(Display.getCurrent(), inputStream);
+ return new ImageData(inputStream);
} catch (RepositoryException e) {
throw new JcrException(e);
} finally {
if (control != null) {
((Label) control).setText(imgTag);
control.setSize(preferredImageSize != null
- ? new Point(preferredImageSize.getWidth(), preferredImageSize.getHeight())
+ ? new Point(preferredImageSize.width(), preferredImageSize.height())
: getSize());
} else {
loaded = false;
@Override
protected synchronized Boolean load(Control lbl) {
Node imgNode = getNode();
- boolean loaded = imageManager.load(imgNode, lbl, getPreferredImageSize());
+ boolean loaded = imageManager.load(imgNode, lbl, getPreferredImageSize(), null);
// getParent().layout();
return loaded;
}