]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/internal/SimpleEditableImage.java
1 package org
.argeo
.cms
.internal
;
3 import javax
.jcr
.RepositoryException
;
5 import org
.argeo
.cms
.util
.CmsUtils
;
6 import org
.argeo
.cms
.widgets
.EditableImage
;
7 import org
.eclipse
.swt
.graphics
.Point
;
8 import org
.eclipse
.swt
.widgets
.Composite
;
9 import org
.eclipse
.swt
.widgets
.Control
;
10 import org
.eclipse
.swt
.widgets
.Text
;
12 /** NOT working yet. */
13 public class SimpleEditableImage
extends EditableImage
{
14 private static final long serialVersionUID
= -5689145523114022890L;
17 private Point imageSize
;
19 public SimpleEditableImage(Composite parent
, int swtStyle
) {
20 super(parent
, swtStyle
);
21 // load(getControl());
25 public SimpleEditableImage(Composite parent
, int swtStyle
, String src
,
27 super(parent
, swtStyle
);
29 this.imageSize
= imageSize
;
33 protected Control
createControl(Composite box
, String style
) {
35 return createText(box
, style
);
37 return createLabel(box
, style
);
41 protected String
createImgTag() throws RepositoryException
{
44 imgTag
= CmsUtils
.img(src
, imageSize
);
46 imgTag
= CmsUtils
.noImg(imageSize
!= null ? imageSize
51 protected Text
createText(Composite box
, String style
) {
52 Text text
= new Text(box
, getStyle());
53 CmsUtils
.style(text
, style
);
57 public String
getSrc() {
61 public void setSrc(String src
) {
65 public Point
getImageSize() {
69 public void setImageSize(Point imageSize
) {
70 this.imageSize
= imageSize
;