// // // // // $Revision: 3287 $ // using System; using System.Collections; namespace ICSharpCode.Core { /// /// Creates tool bar items from a location in the addin tree. /// /// /// Label of the tool bar item. /// /// /// Icon of the tool bar item. /// /// /// This attribute must be one of these values: /// Separator, CheckBox, Item, ComboBox, DropDownButton /// /// /// Only for the type "Item". When set to false, the command class is loaded /// immediately instead of the usual lazy-loading. /// /// /// Tooltip of the tool bar item. /// /// /// Command class that is run when item is clicked; or class that manages /// the ComboBox/DropDownButton. Required for everything except "Separator". /// /// Any toolbar strip paths, e.g. /SharpDevelop/Workbench/ToolBar /// A drop down button has menu items as sub elements. /// /// A ToolStrip* object, depending on the type attribute. /// /// Conditions are handled by the item, "Exclude" maps to "Visible = false", "Disable" to "Enabled = false" public class ToolbarItemDoozer : IDoozer { /// /// Gets if the doozer handles codon conditions on its own. /// If this property return false, the item is excluded when the condition is not met. /// public bool HandleConditions { get { return true; } } public object BuildItem(object caller, Codon codon, ArrayList subItems) { return new ToolbarItemDescriptor(caller, codon, subItems); } } /// /// Represents a toolbar item. These objects are created by the ToolbarItemDoozer and /// then converted into GUI-toolkit-specific objects by the ToolbarService. /// public sealed class ToolbarItemDescriptor { public readonly object Caller; public readonly Codon Codon; public readonly IList SubItems; public ToolbarItemDescriptor(object caller, Codon codon, IList subItems) { this.Caller = caller; this.Codon = codon; this.SubItems = subItems; } } }