Currently SWT's TabFolder supports only the TOP and BOTTOM styles, ie. it will only draw the tabs horizontally along the top or bottom of the control. This is unlike Swing's JTabbedPane, which gives the option of also orienting the tabs vertically, along the side of the control.
Can anyone suggest any workarounds to achieve a vertical orientation in SWT? Any suggestions of custom or 3rd-party components (or other alternative) would be appreciated.
I don't know of any SWT-compatible controls like that, but you could build your own alternative using a StackLayout and some control(s) to switch between the different "panels." Here's a simple example SWT Snippet.
You could also look at the code for CTabFolder and see if it would be straightforward to modify it to suite your needs.
Related
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.
according to https://developers.google.com/web-toolkit/doc/latest/DevGuideUiPanels#Standards I 'm not suppose to use DockPanel, VerticalPanel, HorizontalPanel. But Those are the only panels that support hasverticalalignment and hashorizontalalignment. How am I suppose to align the widgets if I want to conform to the standards mode? Or should I keep the project in its current form using VericalPanel and HorizontalPanel, and ignore the warning eclipse gives me:
[INFO] [project] - GWT no longer supports Quirks Mode
(document.compatMode=' BackCompat').Make sure your application's
host HTML page has a Standards Mode (document.compatMode='
CSS1Compat') doctype,e.g. by using <!doctype html> at the
start of your application's HTML page.To continue using this
unsupported rendering mode and risk layout problems, suppress this
message by addingthe following line to your*.gwt.xml module
file: <extend-configuration-property
name="document.compatMode" value="BackCompat"/>
P.S.: I work in uibinder
Using tables for layouts is considered a bad practice by most UI experts. These layouts are rigid - they don't adjust well with the size of their contents.
You can build any layout you want without using these panels. Horizontal alignment is the easiest one: you simply add a CSS rule "text-align: center" (left, right) to the parent widget. For more interesting effects you can use "float: left" or "float: right". In some rare cases you may event want to use absolute positioning ("position: absolute", "left: 20px"; "top: 20px").
Vertical alignment is a little trickier, but generally you want your content to flow from top to the bottom. You can manage vertical positioning by using top and bottom margins or setting the line heights.
You can find many great resources on building fluid layouts on the Internet. Most suggested html and CSS solutions can be used with GWT, and Ui:Binder is a very convenien way to do so. You can also search StackOverflow for layout solutions to any problem you face.
I am currently working with the SWT package in Eclipse. Is it possible to create a resizable control within a composite control.
For instance, if I have a tree control which I would like to expand, but in order to view the sub tree items I would like to 'click and drag' the border of the tree to resize it, much like the draggable divider in the Eclipse help website.
I think the SWT Sash is what you are looking for.
Here is a good example on how to use it.
EDIT:
Just found that SashForm is much easier to use. See LINK for a good example.
I'm trying to build a GWT GUI, but I'm not sure if it's possible. Basically, I need to be able to stack three layouts/panels, one on top of another like this:
Bottom Layout: Panel that fills the whole screen (will actually contain SVG stuff).
Middle Layout: DockLayoutPanel with tools docked around the edges, also full screen.
Top Layout: Transparent panel, again filling the whole screen.
Is it possible to stack panels like this? I assume I could use AbsolutePanel to do it somehow, but I was hoping for a nicer solution.
Thanks,
Jon
Because you want a DockLayoutPanel inside, try with a LayoutPanel (or the RootLayoutPanel) and simply add your widgets in order as, by default, a child of a LayoutPanel fills its parent.
I am building a simple interface using a 3 row GtkVbox. Inside middle row, I'd like to show a centered image and a small config panel. If config panel is shown, it must appear over the image. How could I simulate a layered panel where the config panel appers in an upper level than the image. Any ideas?
Regards
Overlaying widgets on top of each other isn't really what GTK is built for - you might be using the wrong tool for the job. Maybe you should check out Clutter?
I believe you can use GtkOverlay to put the panel over the image.