Scrolling TabPanel - gwt

I Am trying to create a Tab Panel where I can add and delete tabs on demand.
Where I am getting stuck is that if a potential user adds too many tabs the new tabs go off the screen.
Each Tab is to contain a text area widget where a user may enter text.
Is there any way of horizontally scrolling the just the TabBar and not the whole browser window?
I could use a scroll panel but I was hoping to scrol just the Tabs, not the panel contents.
I cannot see any available method in the com.google.gwt.user.client.ui.TabPanel API that will perform this function and no real way to split the panel.
Help!

It's not what you've asked for, but you might consider using a StackPanel instead of a TabPanel, since if the user can enter a long list of items it's generally better to have vertical scrolling instead of horizontal scrolling.

The gwt TabPanel isn't the greatest, and there's not a real easy way to do what you want. You could take a look at the tab widget in Ext-GWT, which scrolls the tabs, but I don't think extjs is generally a good idea.
There's a bunch of new layout-based widgets arriving with GWT 2.0. Look at TabLayoutPanel. It places tabs in a very wide container inside a div with overflow=hidden. You might be able to add some controls to scroll that container and get the effect you want.
Good luck, and report back if you get something working. GWT really needs more widget contributors.

Related

Wix horizontal bar similar to tab component

I am new to Wix and to be honest kind of confused if there is a way to add a horizontal bar in my website.
So I have a multistate box with different states so when you press a button it takes you to that state.
What I want to do, is to somehow fit these buttons in the mobile version. I have seen that there are some components called tabs which could do the trick because they come with a default horizontal scroll bar or arrows when the content does not fit. Is there any alternative or an actual component I can add to my buttons and fix that issue?
Thank you in advance!

Gwt, the Dilemma of TabPanel, TabLayoutPanel & Custom Tab using TabBar +DeckLayoutPanel

My app has a need to store many Panel dynamically. So TabPanel is the suitable choice. However, TabPanel only works in Quirks Mode, it can also work in Standards Mode but with some Quirks, ex, when u click a link put inside a TabPanel then there is a small shaking appeared. But TabPanel is pretty simple, not heavy & easy to code.
I am not sure if i put link into a HTMLpanel & then put that HTMLPanel into that TabPanel then the shaking problem will be solved or not?
Some others say do not use TabPanel cos its behavor is unpredictable in many different webbrowsers since it support only Quirks Mode. They prefers to use TabLayoutPanel. Ok, TabLayoutPanel is very stable solid, but it is quite complicated, it must be put into the RootLayoutPanel. If I don't put it into RootLayoutPanel, then i have to set its fixed width & height (ex: 600px 300px) to be able to see it in Non-root presenters. But I want its height + width to stretch out to 100%. Some peopl have problems with TabLayoutPanel so they have to switch to TabPanel but TabPanel may be deprecated in the future.
So, some suggest me to use custom TabPanel using TabBar + DeckLayoutPanel, but i couldn't find any UiBinder guide for how to use TabBar + DeckLayoutPanel to make custom TabPanel.
If u have to use Tab in ur app (in respect to the above constraints, ie run smoothly in standards mode & not put into RootPanel) then which solution will u choose?
What approach is the best?
I use the TabLayoutPanel where possible.
When I need a tab panel that does not use the entire window or I want the tab contents to take just the side needed for the selected tab then I use a custom made TabPanel. That one is using the TabLayoutPanel for showing the tabs but the contents are put outside in a FlowPanel.

GWT: how to nest a TablayoutPanel inside a scroll Panel without specifying its exact height?

I need a scrollPanel with a verticalpanel and a tablayout panel inside it. Problem is, unless I specify the exact height of the tablayoutPanel, the tab content does not show. Any known fixes/ workarounds?
Not the answer you are looking for, but might spark an idea for another way to do this - what does it mean to scroll a tab panel? As soon as the user starts scrolling down, the tabs will no longer be visible to change tabs, user will always need to scroll all the way to the top to consider any other tab.
That said, any of the *LayoutPanel classes GWT has introduced that implement ProvidesResize, RequiresResize, etc need sizing to properly draw themselves and their content. This is why you are having the issue. These classes are designed to size their children, not to just consume as much space as those children require.
Closest I can suggest to a workaround (except for putting a ScrollPanel inside the TabLayoutPanel instead) would be to know the height of the current tab's contents, add to that the height of just the tabs themselves, and assign that as the height of the tabpanel. Not a very nice solution, but it might get you by.

Left-aligned tabs in GWT

I have a project in which I need a way to display essentially a list of tabs, each with their own content pages, down the left side of the page. I'm using TabLayoutPanels elsewhere to good effect, but after looking at how they are constructed it seems like it would be quite a bit of work to undo Google's carefully constructed layout and get it to work in any other orientation than top-aligned.
This doesn't seem like it would be an uncommon layout, so does anyone know of a successful implementation of this kind of container?
Best you can do is use DeckPanel, and make your custom tab controls to switch visible widget in that DeckPanel.

Is it possible to detect a scrollbar release event in GWT?

I'm building a GWT app where I want to be able to detect when a user releases a scroll bar on one of my ScrollPanels.
My use case is that the horizontal scroll bar represents time. Since it's impossible to represent the full range of scrollable time I want to just represent a small window of time with the scroll bar. When the user moves and releases the scroll bar I want to do a smooth recentering where the new center is the release point.
I can work out how to do this by building a custom scroll bar widget, but I wanted to check if I was missing some way to do it using a "native" scroll bar first.
You might be able to do it with a ScrollPanel and implementing your own ScrollHandler. Just use the addScrollHandler() method and you should be able to override whatever functionality you need.
However, I would suggest that you re-think your approach. What you seem to really want is a slider control for time, that kind of looks like a scroll bar. You should check out the Composite class and the Widget Gallery to see if there is some combination of Widgets that would suit what you need more. Failing that, I'd also look at SmartGWT. They have a very extensive library of GUI Widgets available, and you may find something you can use already there.