import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
import org.osgi.service.useradmin.UserAdminEvent;
/** Manage the transaction that is bound to the current perspective */
import org.osgi.service.useradmin.UserAdminEvent;
/** Manage the transaction that is bound to the current perspective */
+ UiAdminUtils.notifyTransactionStateChange(userTransaction);
// Try to remove invalid thread access errors when managing users.
// Try to remove invalid thread access errors when managing users.
- HandlerUtil.getActivePart(event).getSite().getShell().getDisplay()
- .asyncExec(new Runnable() {
- @Override
- public void run() {
- UiAdminUtils
- .notifyTransactionStateChange(userTransaction);
- }
- });
+ // HandlerUtil.getActivePart(event).getSite().getShell().getDisplay()
+ // .asyncExec(new Runnable() {
+ // @Override
+ // public void run() {
+ // UiAdminUtils
+ // .notifyTransactionStateChange(userTransaction);
+ // }
+ // });
} catch (CmsException e) {
throw e;
} catch (CmsException e) {
throw e;
// TODO this check should be done before.
if (role.getType() == Role.GROUP) {
// TODO check if the user is already member of this group
// TODO this check should be done before.
if (role.getType() == Role.GROUP) {
// TODO check if the user is already member of this group
- myUserAdminWrapper.beginTransactionIfNeeded();
+
+ // Remove invalid thread access errors when managing users.
+ // myUserAdminWrapper.beginTransactionIfNeeded();
+ event.display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ myUserAdminWrapper.beginTransactionIfNeeded();
+ }
+ });
+
Group group = (Group) role;
group.addMember(myUser);
myUserAdminWrapper.notifyListeners(new UserAdminEvent(null,
Group group = (Group) role;
group.addMember(myUser);
myUserAdminWrapper.notifyListeners(new UserAdminEvent(null,
import org.apache.commons.logging.LogFactory;
import org.argeo.cms.CmsException;
import org.argeo.security.ui.admin.SecurityAdminPlugin;
import org.apache.commons.logging.LogFactory;
import org.argeo.cms.CmsException;
import org.argeo.security.ui.admin.SecurityAdminPlugin;
-import org.eclipse.swt.SWTException;
import org.eclipse.ui.AbstractSourceProvider;
import org.eclipse.ui.ISources;
import org.eclipse.ui.AbstractSourceProvider;
import org.eclipse.ui.ISources;
try {
fireSourceChanged(ISources.WORKBENCH, TRANSACTION_STATE,
getInternalCurrentState());
try {
fireSourceChanged(ISources.WORKBENCH, TRANSACTION_STATE,
getInternalCurrentState());
- } catch (SWTException e) {
- // FIXME
- log.warn("Cannot fire transaction state change event: "
- + e.getMessage());
+ } catch (Exception e) {
+ log.warn("Cannot fire transaction state change event. Caught exception: "
+ + e.getClass().getCanonicalName() + " - " + e.getMessage());