X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=eclipse%2Fplugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Feditors%2FProcessBuilderPage.java;h=c373bbb8ccf6c7a1ba19a975cca3406f205f6393;hb=b9677d2472658530dff02c90ba23725fc80f1c67;hp=8b85260557247e94b03ea71251c0111151f15549;hpb=cb9c3adf8b024d64da158fbc76f8874629f377ed;p=gpl%2Fargeo-slc.git diff --git a/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessBuilderPage.java b/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessBuilderPage.java index 8b8526055..c373bbb8c 100644 --- a/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessBuilderPage.java +++ b/eclipse/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessBuilderPage.java @@ -16,6 +16,8 @@ import javax.jcr.observation.EventIterator; 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; @@ -70,8 +72,7 @@ import org.eclipse.ui.forms.widgets.ScrolledForm; 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; @@ -460,6 +461,7 @@ public class ProcessBuilderPage extends FormPage implements SlcNames, SlcTypes { // 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; @@ -611,7 +613,7 @@ public class ProcessBuilderPage extends FormPage implements SlcNames, SlcTypes { } } - static class ValuesEditingSupport extends EditingSupport { + class ValuesEditingSupport extends EditingSupport { private final TableViewer tableViewer; public ValuesEditingSupport(ColumnViewer viewer) { @@ -638,7 +640,9 @@ public class ProcessBuilderPage extends FormPage implements SlcNames, SlcTypes { 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); } @@ -646,7 +650,18 @@ public class ProcessBuilderPage extends FormPage implements SlcNames, SlcTypes { @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 @@ -659,6 +674,8 @@ public class ProcessBuilderPage extends FormPage implements SlcNames, SlcTypes { .getString(); SlcJcrUtils.setPrimitiveAsProperty(specAttrNode, SLC_VALUE, type, value); + valuesViewer.refresh(); + formPart.markDirty(); } } catch (RepositoryException e) { throw new SlcException("Cannot get celle editor", e);