EditorTool
Represents a single RadEditor tool.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class EditorTool : EditorToolBase, IMarkableStateManager, IStateManager, IAttributeAccessor
Inheritance: objectStateManagerEditorToolBaseEditorTool
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the EditorTool class.
public EditorTool()
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public EditorTool(EditorTool tool)
Initializes a new instance of the EditorTool class.
Initializes a new instance of the EditorTool class.
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public EditorTool(string name)
The name of the tool.
Fields
Gets the renderer responsible for rendering this tool instance.
protected IEditorToolRenderer toolRenderer
Properties
Gets the CSS class applied to the anchor element representing this tool.
protected virtual string AnchorCssClass { get; }
Gets or sets a value indicating whether this EditorTool is enabled.
public virtual bool Enabled { get; set; }
true if enabled; otherwise, false.
This property sets the tool's small icon for RibbonBar mode.
public string ImageUrl { get; set; }
This property sets the tool's large icon for RibbonBar mode.
public string ImageUrlLarge { get; set; }
Gets or sets the EditorTool name. It will be used by RadEditor to find the command which should be executed when the user clicks this tool.
[TypeConverter("Telerik.Web.Design.EditorToolNameTypeConverter, Telerik.Web.Design, Version=2026.3.812.462, Culture=neutral, PublicKeyToken=121fae78165ba3d4")]
public virtual string Name { get; set; }
The tool name.
protected virtual IEditorToolRenderer Renderer { get; }
Gets or sets the keyboard shortcut which will invoke the associated RadEditor command.
public virtual string ShortCut { get; set; }
Gets or sets a value indicating whether the tool icon should be displayed.
public virtual bool ShowIcon { get; set; }
true if the tool icon should be displayed; otherwise, false.
Gets or sets a value indicating whether the tool text should be displayed.
public virtual bool ShowText { get; set; }
true if the tool text should be displayed; otherwise, false.
Gets or sets the title of the EditorTool. The default ToolAdapter will render the value of this property as a tooltip or static text near the tool icon.
[ScriptIgnore]
public virtual string Text { get; set; }
The text.
Methods
Adds the anchor element attributes before rendering the tool. The class attribute may be overridden if AnchorCssClass differs from the renderer's class.
protected virtual void AddAnchorAttributes(HtmlTextWriter writer)
The HTML writer.
Ensures that at least icon or text is visible for the tool. Throws InvalidOperationException if both are disabled.
protected void EnsureIconText()
Throws an exception if the EditorTool has no name.
protected void EnsureName()
Gets the CSS class string computed by the renderer for this tool.
Renders the tool using the configured renderer.