set fix size of an java rcp4 Part - eclipse-rcp

I prgram an application with Java and use RCP4.
Now I´d like to program an navigation Bar in my application.
The navigation Bar shoud have a fix width which shoud not be modifiable.
Can I do thas with a Part in the RCP4 application model?
I found no way to fix the size of a Part.

If your part belongs to Part Sash Container, you should create your own renderer (Something similar to org.eclipse.swt.custom.SashForm)
http://www.eclipse.org/forums/index.php/t/173646/ may be useful.

What about using a TrimBar? We embedded a navigation tree into the left-side Window Trim. TrimBar's can't be resized but will change size to accommodate what they contain (i.e. the left side trim bar's width will grow so that the tree will fit), but cannot be resized by the user.
If, however, you would like to use a Part, create a Part Sash Container to separate this Part from the rest of the items in your perspective and then add "NoMove" as a Tag to the Part Sash Container. This prevents the sash from being resized.

Related

How to set a fixed part sash container data value

I am trying to make different UI layouts for my e4 RCP application depending on the resolution. I am trying to set a fixed container data value for my parts but have no idea how to do this. Basically in the layout below I have a partstash container with a part and another partstash with two parts. I want the partstashes to be a fixed size and not resizeable. How do i achieve this? Alternatively is there a way to ensure that the content within a stash container will auto resize and always fit?
Add the tag NoMove to the 'Part Sash Container' containing the parts that should not be resizable.
So here:
Setting the NoMove tag prevents the child part stacks and sash container from being resized

GTK3: Making a container aligned to bottom, filling horizontal space but not vertical

all.
I am writing an app in C with GTK3 and using Glade to build the UI.
What I am trying to do is making a container that will stay on the bottom of the frame, filling the horizontal space but not vertical. I will place a few buttons there and don't want them loose in the frame. Right now I just have enough code to show the window to see how it looks in runtime, focusing just on UI.
What I have tried so far:
GtkBox: would be perfect if I could adjust its height so I have free space above it, for another container. But it seems to take whatever free space is left (that is, the whole screen).
GtkPaned: would be perfect if I could prevent it from being resized in runtime and hide the handle. But, well, this is the purpose of this widget, so it doesn't seem to be possible.
GtkGrid: same thing as GtkBox.
For those who already worked with Borland C++ Builder or Delphi, it is the functionality of a "Panel" I'm trying to repeat. That is, you drop the container in the frame, align it to bottom (which makes it fill the horizontal space) and then you adjust the height in design time.
Any ideas? If you need more information, just let me know.
*EDIT: Alexander, this is when I try to expand on your comment, that is, using more than 1 button and container inside a container (see top right of Glade for the hierarchy).
When all buttons have Expand "Off", which works for 1 button, and when it is "On" (then I don't get to adjust the height anymore).
"No" to all buttons
"Yes" to all buttons
The simpliest solution: take GtkBox and use gtk_box_pack_end.
Another way is to control container align and expand behaviour (use gtk_widget_set_halign/gtk_widget_set_valign and gtk_widget_set_hexpand/gtk_widget_set_vexpand on the container itself)
Edit: didn't notice you are using glade. Create a gtkbox, add a child and change child's pack type
Also notice: if you want to add container near another container, you should pack both containers in another container.

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.

Gtk layered layout

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.

How to set initial size of a TreeViewer?

I'm using a TreeViewer within a jface WizardPage and the initial input into the tree causes the WizardPage to grow vertically so that it can show all of the tree's values. When expanding one of the tree's values, then the vertical scrollbar works as expected. I'd like to be able to set the tree's size initially so that it is fixed and the scrollbar is already shown when the WizardPage is first drawn, but doing this isn't particularly obvious to me - the setSize method on the TreeViewer's Tree doesn't seem to do anything.
Any help would be appreciated!
Just for the records for this old question:
We solve this problem in our applications by using an own layout manager which we can set fixed sizes for certain controls (with Swing we had done that by using component.setPreferredSize(size)). If no such fixed size is used, we calculate the preferred size of the control while performing the layout. This prevents making controls getting more and more space depending on the control's content when the user resizes the application window or dialog.