protected void refresh(Control control) throws RepositoryException {
if (!(control instanceof Section))
return;
+ long begin = System.currentTimeMillis();
Section section = (Section) control;
if (section instanceof TextSection) {
CmsUiUtils.clear(section);
refresh(s);
}
// section.layout(true, true);
+ long duration = System.currentTimeMillis() - begin;
+// System.out.println(duration + " ms - " + DbkUtils.getTitle(section.getNode()));
}
/** To be overridden in order to provide additional SectionPart types */
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);
+ DbkVideo video = new DbkVideo(parent,getCmsEditable().canEdit()?SWT.NONE : SWT.READ_ONLY, 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());
+// gd.widthHint = video.getWidth();
+// gd.heightHint = video.getHeight();
}
-// wrapper.setLayoutData(gd);
video.setLayoutData(gd);
updateContent(video);
return null;
paragraph.setText(textInterpreter.readSimpleHtml(partNode));
} else if (part instanceof DbkImg) {
DbkImg editableImage = (DbkImg) part;
- imageManager.load(partNode, part.getControl(), editableImage.getPreferredImageSize());
+ // imageManager.load(partNode, part.getControl(),
+ // editableImage.getPreferredImageSize());
} else if (part instanceof DbkVideo) {
DbkVideo video = (DbkVideo) part;
video.load(part.getControl());