import javax.jcr.RepositoryException;
import org.argeo.cms.viewers.EditablePart;
+import org.argeo.eclipse.ui.EclipseUiUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
Control child = getControl();
if (child instanceof Label) {
Label lbl = (Label) child;
- if (FormUtils.notEmpty(text))
+ if (EclipseUiUtils.isEmpty(text))
lbl.setText(message);
else if (readOnly)
setLinkValue(lbl, text);
lbl.setText(text);
} else if (child instanceof Text) {
Text txt = (Text) child;
- if (FormUtils.notEmpty(text)) {
+ if (EclipseUiUtils.isEmpty(text)) {
txt.setText("");
txt.setMessage(message);
} else
String value = text.getText();
String errMsg = null;
- if (FormUtils.notEmpty(value))
+ if (EclipseUiUtils.isEmpty(value))
return;
if (values.contains(value))
Control child = getControl();
if (child instanceof Label) {
Label lbl = (Label) child;
- if (FormUtils.notEmpty(text))
+ if (EclipseUiUtils.isEmpty(text))
lbl.setText(message);
else
lbl.setText(text);
} else if (child instanceof Text) {
Text txt = (Text) child;
- if (FormUtils.notEmpty(text)) {
+ if (EclipseUiUtils.isEmpty(text)) {
txt.setText("");
} else
txt.setText(text);
}
public synchronized void stopEditing() {
- if (FormUtils.notEmpty(dateTxt.getText()))
+ if (EclipseUiUtils.isEmpty(dateTxt.getText()))
getControl().setData(STYLE, FormStyle.propertyMessage.style());
else
getControl().setData(STYLE, FormStyle.propertyText.style());
import org.argeo.cms.viewers.EditablePart;
import org.argeo.cms.widgets.EditableText;
+import org.argeo.eclipse.ui.EclipseUiUtils;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
Control child = getControl();
if (child instanceof Label) {
Label lbl = (Label) child;
- if (FormUtils.notEmpty(text))
+ if (EclipseUiUtils.isEmpty(text))
lbl.setText(message + " ");
else
lbl.setText(text);
} else if (child instanceof Text) {
Text txt = (Text) child;
- if (FormUtils.notEmpty(text)) {
+ if (EclipseUiUtils.isEmpty(text)) {
txt.setText("");
txt.setMessage(message + " ");
} else
}
public synchronized void stopEditing() {
- if (FormUtils.notEmpty(((Text) getControl()).getText()))
+ if (EclipseUiUtils.isEmpty(((Text) getControl()).getText()))
getControl().setData(STYLE, propertyMessage.style());
else
getControl().setData(STYLE, propertyText.style());
// JCR : Model
node = ept.getNode();
String propName = ept.getPropertyName();
- if (FormUtils.notEmpty(txt)) {
+ if (EclipseUiUtils.isEmpty(txt)) {
if (node.hasProperty(propName))
node.getProperty(propName).remove();
} else {
public final static String DEFAULT_SHORT_DATE_FORMAT = "dd/MM/yyyy";
- /** Simply checks if a string is not null nor empty */
- public static boolean notEmpty(String stringToTest) {
- return EclipseUiUtils.notEmpty(stringToTest);
- }
-
/** Best effort to convert a String to a calendar. Fails silently */
public static Calendar parseDate(DateFormat dateFormat, String calStr) {
Calendar cal = null;
- if (notEmpty(calStr)) {
+ if (EclipseUiUtils.notEmpty(calStr)) {
try {
Date date = dateFormat.parse(calStr);
cal = new GregorianCalendar();