/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
}
private void clearExpressions() {
- IEvaluationService evaluationService = (IEvaluationService) PlatformUI
+ IEvaluationService evaluationService = PlatformUI
.getWorkbench().getService(IEvaluationService.class);
Iterator i = refsByActivityDefinition.values().iterator();
while (i.hasNext()) {
// enabledWhen comes into play
IEvaluationReference ref = (IEvaluationReference) refsByActivityDefinition
.get(activityDefinition);
- IEvaluationService evaluationService = (IEvaluationService) PlatformUI
+ IEvaluationService evaluationService = PlatformUI
.getWorkbench().getService(IEvaluationService.class);
boolean newRef = false;
if (activityDefinition != null && evaluationService!=null) {
*/
private Job getUpdateJob() {
if (deferredIdentifierJob == null) {
- deferredIdentifierJob = new Job("Identifier Update Job") { //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
- */
+ deferredIdentifierJob = new Job("Activity Identifier Update") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
+ final Map identifierEventsByIdentifierId = new HashMap();
+
while (!deferredIdentifiers.isEmpty()) {
Identifier identifier = (Identifier) deferredIdentifiers.remove(0);
Set activityIds = new HashSet();
if (activityIdsChanged) {
IdentifierEvent identifierEvent = new IdentifierEvent(identifier, activityIdsChanged,
false);
- final Map identifierEventsByIdentifierId = new HashMap(1);
identifierEventsByIdentifierId.put(identifier.getId(),
identifierEvent);
- UIJob notifyJob = new UIJob("Identifier Update Job") { //$NON-NLS-1$
-
- @Override
- public IStatus runInUIThread(
- IProgressMonitor monitor) {
- notifyIdentifiers(identifierEventsByIdentifierId);
- return Status.OK_STATUS;
- }
- };
- notifyJob.setSystem(true);
- notifyJob.schedule();
- }
+ }
+ }
+ if (!identifierEventsByIdentifierId.isEmpty()) {
+ UIJob notifyJob = new UIJob("Activity Identifier Update UI") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ notifyIdentifiers(identifierEventsByIdentifierId);
+ return Status.OK_STATUS;
+ }
+ };
+ notifyJob.setSystem(true);
+ notifyJob.schedule();
}
return Status.OK_STATUS;
}