locked
Custom tool window like DSL Details.. RRS feed

  • Question

  • Hi all,

    I have defined my first little language with the very impressive DSL Tools.

    When I now work with the application I miss a custom window to handle the (very  specific) configuration of some of my model classes. What I need is a tool like the DSL Details tool window so I want to ask if someone has already builds a similar think.

    Seems like I have two (write an Add-in or a Package) or more options to solve my requirements but I’m not sure what is the best way to do this.

    Today I’m not very familiar with writing any kind of IDE Extension but after looking in the documentation it looks not really hard. But the first big problem is: How can I call a command from the DSL Designer View to the Add-in and vice versa.

    What I firstly want is after select, or maybe click, on a Modelclass the Toolwindow should display properties of that class.  Now when I change those properties with the tool the Model must also changed (behavior like standard property window).

     

    Maybe someone has a little example or a documentation of my requirements?

     

    Regards and sorry for bad English

    Markus

    Monday, December 25, 2006 7:40 PM

Answers

  • Markus,

    You are right, creating a custom toolwindow isn't that hard. Basically all you have to do is write a new class and inherit that from the "ToolWindow" (Microsoft.VisualStudio.Modeling.Shel). You can find some more information about that here.

    I have just written a post about a custom toolwindow that I created for my own DSL. In this toolwindow I used the "VirtualTreeControl" because I felt the need to to manipulate "relational data "in my DSL in an easy way without a lot of mouse clicks. Unfortunately this post doesn't explain the steps that are needed to build such a control. You probably don't need the VirtualTreeControl in your custom toolwindow so hopefuly the first link in this reply helps you implementing your custom toolwindow. if not, let me know and maybe I can help you a little further.

    It would be great if in the next releases of the DSL Tools creating custom toolwindows like this becomes more straight forward!

    Edward

    Monday, December 25, 2006 11:22 PM

All replies

  • Markus,

    You are right, creating a custom toolwindow isn't that hard. Basically all you have to do is write a new class and inherit that from the "ToolWindow" (Microsoft.VisualStudio.Modeling.Shel). You can find some more information about that here.

    I have just written a post about a custom toolwindow that I created for my own DSL. In this toolwindow I used the "VirtualTreeControl" because I felt the need to to manipulate "relational data "in my DSL in an easy way without a lot of mouse clicks. Unfortunately this post doesn't explain the steps that are needed to build such a control. You probably don't need the VirtualTreeControl in your custom toolwindow so hopefuly the first link in this reply helps you implementing your custom toolwindow. if not, let me know and maybe I can help you a little further.

    It would be great if in the next releases of the DSL Tools creating custom toolwindows like this becomes more straight forward!

    Edward

    Monday, December 25, 2006 11:22 PM
  • Hello Edward,

    I've read your post about the VirtualTreeControl a few days ago and tried to post a comment in your blog, but comments seem to be disabled..? However, after reading this article, I spent a lot of time in finding some useful information about the VirtualTreeControl and ... found nothing.

    Could you post some more details about implementing a custom tool window using this control?

    --
    Regards,
    Daniel

    Tuesday, December 26, 2006 3:57 PM
  • I'm very interested in this as well, maybe you can tell us something about how to communicate with the toolwindow?

    Thanks, it's very much appreciated!!

    Clemens

    Tuesday, December 26, 2006 7:06 PM
  • Daniel,

    As far as I can see comments are not disabled for my blog. I tried adding a comment myself and it looks like everything is working OK.

    You are right. There is no information available for this control, at least I haven't found it myself. As I already wrote in my post this control isn't very easy to use. You have to write a lot of code to get this beautity to work. So, I cannot just explain this control in just a few lines. It just wouldn't make sense. Let me think a little to see if and/or how I can share some more information about this control in an easy and constructive way.

    Let me get back on this one.

    Edward

    Tuesday, December 26, 2006 8:37 PM
  • Edward,

    thank you for the quick answer .

    For this time I have build my custom designer with an Add-in that shows a specific Usercontrol (with a reference to the dsl-project).

    In future projects I will better use your concept because it has some advantages.  It seems the MS Documentation about this issue is a little too short for me (so I hope I can come with further questions).

     

    Regards Markus  

    Friday, December 29, 2006 1:20 AM
  • Markus,

    In my opinion tools like this can dramatically improve the user experience of DSL's, so I will try to answer all your questions about custom toolwindows like this :-).

    In the meantime I will see if I can find a way to share some more information about this.

    Edward

    Friday, December 29, 2006 11:55 AM
  • Just to be crystal clear. The virtual tree control is NOT a publically supported piece of API and we have no plans to make it so.

    I'd recommend that you don't make use of it.

     

     

    Wednesday, January 3, 2007 4:08 PM
  • Gareth,

    Thanks for this remark! I am absolutely aware of this and also mentioned this in my post. This is exactly the reason that I haven’t shared any details yet. The point I was trying to make in my post is the improvement in the user experience a tool window LIKE this can make for a DSL. I wasn’t really proposing the usage of this control. We are currently looking into some alternatives for this VirtualTreeControl to find a way to accomplish the same user experience only by using a “supported control”.

    Edward

    Wednesday, January 3, 2007 8:02 PM
  • The class details toolwindow of Class Designer heavily use VirtualTreeControl. Since I'm not supporting a commercial DSL solution, I wouldn't hesitate using VirtualTree since it's so beautiful and handy, but a little Reflector shows that it's relatively hard to use it.

    So I decided to create my own instead. The idea was to show a first level hierarchical information so I used DataGridView in virtual mode. Here's the result:
    http://altinoren.com/content/binary/awtoolbox.JPG

    The ToolWindow shows an easy interface to mass add/change/remove properties. To keep the toolwindow up-to-date, I have Add/Change/DeleteRule implementations on my model, firing appropriate events subscribed by the toolwindow.
    Thursday, January 4, 2007 12:09 PM