]>
git.argeo.org Git - gpl/argeo-jcr.git/blob - swt/org.argeo.cms.jcr.ui/src/org/argeo/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
.argeo
.cms
.ux
.AbstractImageManager
;
10 import org
.argeo
.cms
.ux
.CmsUxUtils
;
11 import org
.eclipse
.swt
.widgets
.Composite
;
12 import org
.eclipse
.swt
.widgets
.Control
;
13 import org
.eclipse
.swt
.widgets
.Text
;
15 /** NOT working yet. */
16 public class SimpleEditableImage
extends EditableImage
{
17 private static final long serialVersionUID
= -5689145523114022890L;
20 private Cms2DSize imageSize
;
22 public SimpleEditableImage(Composite parent
, int swtStyle
) {
23 super(parent
, swtStyle
);
24 // load(getControl());
28 public SimpleEditableImage(Composite parent
, int swtStyle
, String src
, Cms2DSize imageSize
) {
29 super(parent
, swtStyle
);
31 this.imageSize
= imageSize
;
35 protected Control
createControl(Composite box
, String style
) {
37 return createText(box
, style
);
39 return createLabel(box
, style
);
43 protected String
createImgTag() throws RepositoryException
{
46 imgTag
= CmsUxUtils
.img(src
, imageSize
);
48 imgTag
= CmsUiUtils
.noImg(imageSize
!= null ? imageSize
: AbstractImageManager
.NO_IMAGE_SIZE
);
52 protected Text
createText(Composite box
, String style
) {
53 Text text
= new Text(box
, getStyle());
54 CmsSwtUtils
.style(text
, style
);
58 public String
getSrc() {
62 public void setSrc(String src
) {
66 public Cms2DSize
getImageSize() {
70 public void setImageSize(Cms2DSize imageSize
) {
71 this.imageSize
= imageSize
;