- protected Img newImg(TextSection parent, Node node) throws RepositoryException {
- Img img = new Img(parent, parent.getStyle(), node) {
- private static final long serialVersionUID = 1297900641952417540L;
-
- @Override
- protected void setContainerLayoutData(Composite composite) {
- composite.setLayoutData(CmsUiUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
- }
-
- @Override
- protected void setControlLayoutData(Control control) {
- control.setLayoutData(CmsUiUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
- }
- };
- img.setLayoutData(CmsUiUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
- updateContent(img);
- img.setMouseListener(getMouseListener());
- return img;
+ protected DbkImg newImg(TextSection parent, Node node) {
+ try {
+ DbkImg img = new DbkImg(parent, parent.getStyle(), node, imageManager);
+ img.setLayoutData(CmsUiUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
+ updateContent(img);
+ img.setMouseListener(getMouseListener());
+ return img;
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot add new image " + node, e);
+ }