View | Details | Raw Unified | Return to bug 15670
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/PluginActionSetBuilder.java (-1 / +15 lines)
Lines 12-19 Link Here
12
12
13
import java.util.ArrayList;
13
import java.util.ArrayList;
14
import java.util.Iterator;
14
import java.util.Iterator;
15
15
import java.util.List;
16
import org.eclipse.core.runtime.IConfigurationElement;
16
import org.eclipse.core.runtime.IConfigurationElement;
17
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.Status;
17
import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
19
import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
18
import org.eclipse.jface.action.AbstractGroupMarker;
20
import org.eclipse.jface.action.AbstractGroupMarker;
19
import org.eclipse.jface.action.ActionContributionItem;
21
import org.eclipse.jface.action.ActionContributionItem;
Lines 224-235 Link Here
224
        // pass the adjunct contributions will be processed.
226
        // pass the adjunct contributions will be processed.
225
        PluginActionSetBuilder[] builders = new PluginActionSetBuilder[pluginActionSets
227
        PluginActionSetBuilder[] builders = new PluginActionSetBuilder[pluginActionSets
226
                .size()];
228
                .size()];
229
		resetPendingWirings(new ArrayList());
227
        for (int i = 0; i < pluginActionSets.size(); i++) {
230
        for (int i = 0; i < pluginActionSets.size(); i++) {
228
            PluginActionSet set = (PluginActionSet) pluginActionSets.get(i);
231
            PluginActionSet set = (PluginActionSet) pluginActionSets.get(i);
229
            PluginActionSetBuilder builder = new PluginActionSetBuilder();
232
            PluginActionSetBuilder builder = new PluginActionSetBuilder();
230
            builder.readActionExtensions(set, window);
233
            builder.readActionExtensions(set, window);
231
            builders[i] = builder;
234
            builders[i] = builder;
232
        }
235
        }
236
		List pendingWirings = resetPendingWirings(null);
237
		int size;
238
		while ((size = pendingWirings.size()) > 0) {
239
			((Runnable) pendingWirings.get(0)).run();
240
			if (pendingWirings.size() == size) {
241
				WorkbenchPlugin.log(new Status(IStatus.ERROR,
242
						WorkbenchPlugin.PI_WORKBENCH,
243
						"Unmet dependencies among menu actions")); //$NON-NLS-1$
244
				break;
245
			}
246
		}
233
        for (int i = 0; i < builders.length; i++) {
247
        for (int i = 0; i < builders.length; i++) {
234
            PluginActionSetBuilder builder = builders[i];
248
            PluginActionSetBuilder builder = builders[i];
235
            builder.processAdjunctContributions();
249
            builder.processAdjunctContributions();
(-)Eclipse UI/org/eclipse/ui/internal/PluginActionBuilder.java (-4 / +26 lines)
Lines 12-18 Link Here
12
package org.eclipse.ui.internal;
12
package org.eclipse.ui.internal;
13
13
14
import java.util.ArrayList;
14
import java.util.ArrayList;
15
15
import java.util.List;
16
import org.eclipse.core.runtime.IConfigurationElement;
16
import org.eclipse.core.runtime.IConfigurationElement;
17
import org.eclipse.core.runtime.Platform;
17
import org.eclipse.core.runtime.Platform;
18
import org.eclipse.jface.action.AbstractGroupMarker;
18
import org.eclipse.jface.action.AbstractGroupMarker;
Lines 345-352 Link Here
345
        /**
345
        /**
346
         * Contributes action from action descriptor into the provided menu manager.
346
         * Contributes action from action descriptor into the provided menu manager.
347
         */
347
         */
348
        protected void contributeMenuAction(ActionDescriptor ad,
348
		protected void contributeMenuAction(final ActionDescriptor ad,
349
                IMenuManager menu, boolean appendIfMissing) {
349
				final IMenuManager menu, final boolean appendIfMissing) {
350
            // Get config data.
350
            // Get config data.
351
            String mpath = ad.getMenuPath();
351
            String mpath = ad.getMenuPath();
352
            String mgroup = ad.getMenuGroup();
352
            String mgroup = ad.getMenuGroup();
Lines 358-364 Link Here
358
            if (mpath != null) {
358
            if (mpath != null) {
359
                parent = parent.findMenuUsingPath(mpath);
359
                parent = parent.findMenuUsingPath(mpath);
360
                if (parent == null) {
360
                if (parent == null) {
361
                    ideLog("Plug-in '" + ad.getPluginId() + "' contributed an invalid Menu Extension (Path: '" + mpath + "' is invalid): " + ad.getId()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
361
					if (pendingWirings != null) {
362
						final List currentList = pendingWirings;
363
						pendingWirings.add(new Runnable() {
364
							public void run() {
365
								contributeMenuAction(ad, menu, appendIfMissing);
366
								currentList.remove(this);
367
							}
368
						});
369
					}
362
                    return;
370
                    return;
363
                }
371
                }
364
            }
372
            }
Lines 523-528 Link Here
523
		}
531
		}
524
    }
532
    }
525
    
533
    
534
	static List/* <Runnable */pendingWirings;
535
536
	/*
537
	 * (non-Javadoc)
538
	 * 
539
	 * @see org.eclipse.jface.action.IMenuManager#resetPendingWirings(java.util
540
	 * .List)
541
	 */
542
	public static List resetPendingWirings(List newList) {
543
		List old = pendingWirings;
544
		pendingWirings = newList;
545
		return old;
546
	}
547
526
    private static boolean allowIdeLogging = false;
548
    private static boolean allowIdeLogging = false;
527
    
549
    
528
    /**
550
    /**

Return to bug 15670