import javax.jcr.observation.EventListener;
import javax.jcr.observation.ObservationManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.argeo.ArgeoException;
import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
import org.argeo.jcr.JcrUtils;
public class ProcessBuilderPage extends FormPage implements SlcNames, SlcTypes {
public final static String ID = "processBuilderPage";
- // private final static Log log =
- // LogFactory.getLog(ProcessBuilderPage.class);
+ private final static Log log = LogFactory.getLog(ProcessBuilderPage.class);
private Node processNode;
// TODO optimize based on data type?
Object value = PrimitiveUtils.convert(type, specAttrNode
.getProperty(SLC_VALUE).getString());
+ log.debug(specAttrNode + ", type=" + type + ", value=" + value);
return value;
}
return null;
}
}
- static class ValuesEditingSupport extends EditingSupport {
+ class ValuesEditingSupport extends EditingSupport {
private final TableViewer tableViewer;
public ValuesEditingSupport(ColumnViewer viewer) {
Node specAttrNode = (Node) element;
return !(specAttrNode.getProperty(SLC_IS_IMMUTABLE)
.getBoolean() || specAttrNode.getProperty(
- SLC_IS_CONSTANT).getBoolean());
+ SLC_IS_CONSTANT).getBoolean())
+ && specAttrNode
+ .isNodeType(SlcTypes.SLC_PRIMITIVE_SPEC_ATTRIBUTE);
} catch (RepositoryException e) {
throw new SlcException("Cannot check canEdit", e);
}
@Override
protected Object getValue(Object element) {
- return getAttributeSpecValue((Node) element);
+ Node specAttrNode = (Node) element;
+ try {
+ Object value = getAttributeSpecValue(specAttrNode);
+ if (value == null)
+ throw new SlcException("Unsupported attribute " + element);
+ if (specAttrNode
+ .isNodeType(SlcTypes.SLC_PRIMITIVE_SPEC_ATTRIBUTE))
+ return value.toString();
+ return value;
+ } catch (RepositoryException e) {
+ throw new SlcException("Cannot get value for " + element, e);
+ }
}
@Override
.getString();
SlcJcrUtils.setPrimitiveAsProperty(specAttrNode, SLC_VALUE,
type, value);
+ valuesViewer.refresh();
+ formPart.markDirty();
}
} catch (RepositoryException e) {
throw new SlcException("Cannot get celle editor", e);