New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Represents a single RadEditor tool.

Definition

Constructors

Initializes a new instance of the EditorTool class.

C#
public EditorTool()
C#
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public EditorTool(EditorTool tool)
Parameters:toolEditorTool

Initializes a new instance of the EditorTool class.

C#
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public EditorTool(string name, string shortCut)
Parameters:namestring

The name of the tool.

shortCutstring

The shortcut for the tool.

Initializes a new instance of the EditorTool class.

C#
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public EditorTool(string name)
Parameters:namestring

The name of the tool.

Fields

Gets the renderer responsible for rendering this tool instance.

C#
protected IEditorToolRenderer toolRenderer

Properties

Gets the CSS class applied to the anchor element representing this tool.

C#
protected virtual string AnchorCssClass { get; }

Gets or sets a value indicating whether this EditorTool is enabled.

C#
public virtual bool Enabled { get; set; }
Property Value:

true if enabled; otherwise, false.

This property sets the tool's small icon for RibbonBar mode.

C#
public string ImageUrl { get; set; }

This property sets the tool's large icon for RibbonBar mode.

C#
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.

C#
[TypeConverter("Telerik.Web.Design.EditorToolNameTypeConverter, Telerik.Web.Design, Version=2026.3.812.462, Culture=neutral, PublicKeyToken=121fae78165ba3d4")]
public virtual string Name { get; set; }
Property Value:

The tool name.

C#
protected virtual IEditorToolRenderer Renderer { get; }

Gets or sets the keyboard shortcut which will invoke the associated RadEditor command.

C#
public virtual string ShortCut { get; set; }

Gets or sets a value indicating whether the tool icon should be displayed.

C#
public virtual bool ShowIcon { get; set; }
Property Value:

true if the tool icon should be displayed; otherwise, false.

Gets or sets a value indicating whether the tool text should be displayed.

C#
public virtual bool ShowText { get; set; }
Property Value:

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.

C#
[ScriptIgnore]
public virtual string Text { get; set; }
Property Value:

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.

C#
protected virtual void AddAnchorAttributes(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

The HTML writer.

Ensures that at least icon or text is visible for the tool. Throws InvalidOperationException if both are disabled.

C#
protected void EnsureIconText()

Throws an exception if the EditorTool has no name.

C#
protected void EnsureName()

Gets the CSS class string computed by the renderer for this tool.

C#
protected virtual string GetAnchorCssClass()
Returns:

string

Renders the tool using the configured renderer.

C#
public void RenderControl(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

The HTML writer.