]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - cms/ui/internal/SimpleEditableImage.java
1 package org
.argeo
.cms
.ui
.internal
;
3 import javax
.jcr
.RepositoryException
;
5 import org
.argeo
.api
.cms
.ux
.Cms2DSize
;
6 import org
.argeo
.cms
.swt
.CmsSwtUtils
;
7 import org
.argeo
.cms
.ui
.util
.CmsUiUtils
;
8 import org
.argeo
.cms
.ui
.widgets
.EditableImage
;
9 import org
.eclipse
.swt
.widgets
.Composite
;
10 import org
.eclipse
.swt
.widgets
.Control
;
11 import org
.eclipse
.swt
.widgets
.Text
;
13 /** NOT working yet. */
14 public class SimpleEditableImage
extends EditableImage
{
15 private static final long serialVersionUID
= -5689145523114022890L;
18 private Cms2DSize imageSize
;
20 public SimpleEditableImage(Composite parent
, int swtStyle
) {
21 super(parent
, swtStyle
);
22 // load(getControl());
26 public SimpleEditableImage(Composite parent
, int swtStyle
, String src
, Cms2DSize imageSize
) {
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
= CmsUiUtils
.img(src
, imageSize
);
46 imgTag
= CmsUiUtils
.noImg(imageSize
!= null ? imageSize
: NO_IMAGE_SIZE
);
50 protected Text
createText(Composite box
, String style
) {
51 Text text
= new Text(box
, getStyle());
52 CmsSwtUtils
.style(text
, style
);
56 public String
getSrc() {
60 public void setSrc(String src
) {
64 public Cms2DSize
getImageSize() {
68 public void setImageSize(Cms2DSize imageSize
) {
69 this.imageSize
= imageSize
;