X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Forg.argeo.slc.akb.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fakb%2Fui%2Fcomposites%2FConnectorAliasSmallComposite.java;h=8717df5b51a4a146f9ce6baed746e81f6512dc41;hb=d808dd0ef9df31544d17f2ff8630f444c5ba3f52;hp=3c0726face0eeabc7422f3db16997375ec3a9e20;hpb=65c1e73020652f7b70110268de6cc2c89624a9c2;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/composites/ConnectorAliasSmallComposite.java b/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/composites/ConnectorAliasSmallComposite.java index 3c0726fac..8717df5b5 100644 --- a/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/composites/ConnectorAliasSmallComposite.java +++ b/plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/composites/ConnectorAliasSmallComposite.java @@ -3,6 +3,7 @@ package org.argeo.slc.akb.ui.composites; import javax.jcr.Node; import javax.jcr.Property; import javax.jcr.RepositoryException; +import javax.jcr.Session; import org.argeo.eclipse.ui.ErrorFeedback; import org.argeo.eclipse.ui.utils.CommandUtils; @@ -170,14 +171,26 @@ public class ConnectorAliasSmallComposite extends Composite { removeBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - CommandUtils.CallCommandWithOneParameter(DeleteAkbNodes.ID, - DeleteAkbNodes.PARAM_NODE_JCR_ID, - AkbJcrUtils.getIdentifierQuietly(connectorAlias)); - // for (IFormPart part : form.getParts()) - // if (!formPart.equals(part)) - // part.refresh(); + try { + // Manually check if corresponding node was really removed + Session session = connectorAlias.getSession(); + String absPath = connectorAlias.getPath(); + + CommandUtils.CallCommandWithOneParameter(DeleteAkbNodes.ID, + DeleteAkbNodes.PARAM_NODE_JCR_ID, + AkbJcrUtils.getIdentifierQuietly(connectorAlias)); + + if (!session.nodeExists(absPath)) + form.removePart(formPart); + + } catch (RepositoryException re) { + throw new AkbException( + "Error while removing connector Alias ", re); + } } }); + // force refresh to initialize various fields on creation + formPart.refresh(); form.addPart(formPart); }