Tabs Studio Blog (organizing Visual Studio document tabs)

September 1, 2009

Changing tab title from an add-in

Filed under: Uncategorized — Tags: — Sergey Vlasov @ 2:16 am

I’ve added infrastructure to control tab and tab extension title text from an add-in. It was already possible to modify tab label control directly, but direct modifications can be overridden by Tabs Studio and require special processing for underscore characters.

Now each title has the associated list of transforms applied to this title. Each transform is a pattern regex string, replacement regex string and tag ID string. An add-in can customize this list individually for each title (add, remove and change transforms).

More specifically, TabsStudioExt.Tab and TabsStudioExt.TabExtension classes have TitleManager property returning ITitleManager interface. ITitleManager interface has Title and UntransformedTitle properties (there is no need to access underlying label control to get title any more), Transforms property returning generic list of TitleTransform and ApplyTransforms method that an add-in should call when it has finished updating the transforms list. TitleTransform has PatternRegex, ReplacementRegex and Id properties.

An example of tab title customization usage can be disambiguation of tabs with the same name adding folder/project to tab title on tab creation when there is already a tab with the same name in the group (see my upcoming Disambiguator add-in). “Remove path from tab name” option is now also implemented as a transform (pattern ^(.*/)?(.*)$, replacement $2, id [Tabs Studio] Remove path).

Tab extension title customization can be used for decorations like this:

Custom extension transformation

Custom extension transformation


It was implemented by adding two transforms (.cpp$ -> .c++ and .cs$ -> .c#) on TabExtensionCreated event to each tab extension.

1 Comment

  1. […] by Title grouping regex too:Project1 removed For more advanced title customization there is TitleTransform available in add-ins. Leave a […]

    Pingback by Tab names in a database project « Tabs Studio Blog (engineering the Visual Studio add-in) — February 10, 2010 @ 9:28 am


RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Blog at WordPress.com.

%d bloggers like this: