5 Replies Latest reply on Oct 13, 2010 4:03 AM by heiko.braun

    Add own widgets to the basic workspace structure?

    tsarnowski

      Hello,

       

      I'm using the errai workspace. I am writing lots of tools and all get inserted into the main menu just like expected. Now my project requires an additional global widget above the left main menu - perhaps above the whole workspace. Are there ways to hook into errai's workspace building to provide basic extra widgets? And if not, is it possible to do such things?

       

      I added a picture, made out of pure gimp expertise, to illustrate my problem ;-)

        • 1. Re: Add own widgets to the basic workspace structure?
          heiko.braun

          Not out of the box. But I was thinking about that before.

          Would you like to propose a solution or even extend workspaces and send a patch?

          I do appreciate a contribution like this.

          1 of 1 people found this helpful
          • 2. Re: Add own widgets to the basic workspace structure?
            tsarnowski

            It would definitly be nice if I could define the general page structure with an own widget and insert the workspace within it.

             

            Extending the login box is also interesting to provide "password forgotten" and "more informations" links and such. So there should be two different widgets, marked by @LoginFrame and @WorkspaceFrame or something similar which can use <errai:Workspace/> and <errai:Loginbox/>. In the end I would define two UIBinder widget with content like that:

             

            <ui:....>

                <g:VerticalPane>

                    <g:Label ui:field="mystuff"/>

                    <errai:Workspace/>

                </g:VerticalPane>

            </ui:..>

             

            Depending on the two states (loggedin, not loggedin) the frames would be loaded by errai.

            • 3. Re: Add own widgets to the basic workspace structure?
              tsarnowski

              Having predefined slots is another solution and is less intrusive to the existing code I think. I can imagine a WidgetProvider annotation like this:

               

              @ExtensionWidget(location = ExtensionLocation.TOP)

              @ExtensionWidget(location = ExtensionLocation.BOTTOM, loggedOff = true, loggedIn = false)

              @ExtensionWidget(location = ExtensionLocation.BOTTOM, priority = 4)

               

              I will try to hack something around in the workspace code and will send you a patch.

              • 4. Re: Add own widgets to the basic workspace structure?
                heiko.braun

                I think I would prefer the @ExtensionWidget opposed to the UIBinder approach. There aren't really so much places

                where you want to place custom widgets. Top, bottom and maybe embedded within the lefthand navigation.

                Looking forward to your solution.

                • 5. Re: Add own widgets to the basic workspace structure?
                  heiko.braun

                  Let me know if you need help with the meta data processing. But there should be plenty of examples how to use the MetaDataScanner to look for @ExtensionWidget