+ protected DbkVideo newVideo(TextSection parent, Node node) {
+ try {
+// node.getSession();
+// Composite wrapper = new Composite(parent, SWT.NONE);
+// new Label(wrapper,SWT.NONE).setText("TEST");
+ DbkVideo video = new DbkVideo(parent, SWT.BORDER, node);
+ GridData gd;
+ if (maxMediaWidth != null) {
+ gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+ // TODO, manage size
+ gd.widthHint = maxMediaWidth;
+ gd.heightHint = (int) (gd.heightHint * 0.5625);
+// img.setPreferredSize(new Point(maxMediaWidth, 0));
+ } else {
+ gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+ gd.widthHint = video.getWidth();
+ gd.heightHint = video.getHeight();
+// gd = new GridData(video.getWidth(),video.getHeight());
+ }
+// wrapper.setLayoutData(gd);
+ video.setLayoutData(gd);
+ updateContent(video);
+ return null;
+ } catch (RepositoryException e) {
+ throw new JcrException("Cannot add new image " + node, e);
+ }
+ }
+