From 59fe6948d64e41d7fcd6e62b4ef6d2b1e826ce50 Mon Sep 17 00:00:00 2001 From: Vivian Kong Date: Tue, 16 Aug 2011 11:34:44 -0400 Subject: [PATCH] New C/C++ wizard toolbar dropdown should be refreshed on every click Change-Id: I869e6e972262e3d1ef18e3b843cab6b39af67d85 --- .../wizards/AbstractWizardDropDownAction.java | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/AbstractWizardDropDownAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/AbstractWizardDropDownAction.java index 1bd554eb843..821bf7e5377 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/AbstractWizardDropDownAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/AbstractWizardDropDownAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2011 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 @@ -71,13 +71,11 @@ public abstract class AbstractWizardDropDownAction extends Action implements IMe public Menu getMenu(Control parent) { synchronized(fLock) { - if (fMenu == null) { - fMenu= new Menu(parent); - IAction[] actions= getActions(); - for (int i= 0; i < actions.length; i++) { - ActionContributionItem item= new ActionContributionItem(actions[i]); - item.fill(fMenu, -1); - } + fMenu= new Menu(parent); + IAction[] actions= getActions(); + for (int i= 0; i < actions.length; i++) { + ActionContributionItem item= new ActionContributionItem(actions[i]); + item.fill(fMenu, -1); } return fMenu; } @@ -110,13 +108,12 @@ public abstract class AbstractWizardDropDownAction extends Action implements IMe private IAction[] getActions() { synchronized(fLock) { - if (fActions == null) { - fActions = getWizardActions(); - if (fActions == null) - fActions = NO_ACTIONS; - - //TODO provide a way to sort the actions - } + fActions = getWizardActions(); + if (fActions == null) + fActions = NO_ACTIONS; + + //TODO provide a way to sort the actions + return fActions; } }