Results 1 to 6 of 6

Thread: Eclipse like dynamic tool bar based on perspective

  1. #1
    Join Date
    Jan 2006
    Posts
    7

    Default Eclipse like dynamic tool bar based on perspective

    I would like to implement a dynamic toolbar based on some user perspective.

    We're using the jide-springrcp project to create different perspective that would show different views in the page. Is there a way to dynamically replace the "magic" toolbar? I don't want to just disable certain button. I would like a button to disable altogether when we switch to a different perspective.

    Similar to what eclipse does, when you switch to Java perspective, we will see the "New package", "New class" button. But when you switch to debug perspective, those button is gone, not just disabled.

    Thank you very much in advance.

  2. #2
    Join Date
    Aug 2004
    Location
    San Francisco
    Posts
    423

    Default

    Hi,

    This isn't something I've ever done with the jide based perspectives, but that's not to say it couldn't be done.

    Maybe in the perspective display method you could get the toolbar via
    Application.instance().getActiveWindow().getToolBa r() and the make the required commands visible or not?

    Jonny

    Quote Originally Posted by mchanspring View Post
    I would like to implement a dynamic toolbar based on some user perspective.

    We're using the jide-springrcp project to create different perspective that would show different views in the page. Is there a way to dynamically replace the "magic" toolbar? I don't want to just disable certain button. I would like a button to disable altogether when we switch to a different perspective.

    Similar to what eclipse does, when you switch to Java perspective, we will see the "New package", "New class" button. But when you switch to debug perspective, those button is gone, not just disabled.

    Thank you very much in advance.

  3. #3
    Join Date
    Jan 2006
    Posts
    7

    Default

    Johnny,

    Thanks for your response. That toolbar is a commandgroup, which can be used to genarate menuBar and toolbar .. etc using createMenuBar(), createToolBar() ... etc.

    How I can get the toolbar instance that are created before?

    Is it possible to replace the toolbar completely?

    Thanks again,

    Michael

  4. #4
    Join Date
    Aug 2004
    Location
    San Francisco
    Posts
    423

    Default

    Michael,

    I was thinking you could iterate through the various members of the command group underlying the toolbar and make those visible or not. ie keep the same toolbar but just manipulate the members.

    Jonny

  5. #5
    Join Date
    Jan 2006
    Posts
    7

    Default

    Jonny,

    That's the thing. I'm not sure whether the commandgroup can still link to the toolbar which was already created in some "system level" framework code. Perhaps, it's good to extend the framework to support not just disabled command, but a disappeared command.

    Just an idea.

    Regards,

    Michael

  6. #6
    Join Date
    Aug 2004
    Location
    San Francisco
    Posts
    423

    Default

    Michael,

    have you tried it? I'd have assumed that obtaining the command group for the toolbar and calling setVisible on the command would work. It certainly works in other situations, as I'm using it ie the extension you mention from supporting disabling to supporting visibility is already there I think.

    Jonny

    Quote Originally Posted by mchanspring View Post
    Jonny,

    That's the thing. I'm not sure whether the commandgroup can still link to the toolbar which was already created in some "system level" framework code. Perhaps, it's good to extend the framework to support not just disabled command, but a disappeared command.

    Just an idea.

    Regards,

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •