GWT Celltable fixed columns - java

Is there a way to make, let say first 3 out of 7, columns fixed in Cell table. I want to be able to see always first three columns and have horizontal scroll on others.

You will have to create a custom widget that consists of a ScrollPanel, which includes two CellTable widgets set side by side. The right table should be wrapped in a FlowPanel with overflow-x property set to AUTO (overflow-y should remain at HIDDEN).
You can use the same DataProvider for both tables to synchronize all changes. Be careful with the SelectionModel though, if you need it. I would limit selection to the first column of checkboxes and disable selection by clicking on a row.
Make sure that your widget fits into its space, or you may end up with two horizontal scrollbars - one for the ScrollPanel and one for the right table. Finally, remember to set sizes on both tables so that they have the same height.

Related

GridBagLayout: changes alignment after adding checkbox

I have two classes which creates two different dialog box. Both the classes have same code, except one has additional lines of code, which creates a checkbox
first Class, with Checkbox
Second Class, without Checkbox
There is slight alignment difference in "save" button. How can I fix this.
Is there a particular reason you're using fixed row and column sizes? One of the great features of GridBagLayout is its ability to center/align and fill. This also tends to make things look better on different screen sizes, different fonts, etc.
To answer your specific question, my guess is that the checkbox is taller than the row you're putting it into, pushing the next row down.
When I debug GBL, I often set row/column background colors to different things and print out (or view in a debugger) sizes of the things I'm trying to fit into the container.
I had to adjust the row height as the checkbox was taller than the row and was pushing the third row downward( Thanks to Ingrid Biery). so I changed the 2nd row height from 25 to 30 and it worked.

I can't resize or move elements on Intellij IDEA GUI designer

I just want to drag and drop them like in Netbeans.
is there any way to get functionality of Netbeans or Eclipse in IDEA?
I had the same problem and I have solved it. You need to create a new row before dragging any new elements. In the left side you will see small green boxes for each row. Right click on the last row's green box and then choose "Insert row after this". Then you can drag and drop any new elements into your newly created row.
You can drag and drop components and alter on which part of the layout they appear. You might need to split a column if you want the component on only the half of a parent.
See: https://www.jetbrains.com/idea/help/placing-gui-components-on-a-form.html
But to set some minimum size or set if a component should grow, you need to look into properties panel of a selected component (on the left).
See: https://www.jetbrains.com/idea/help/setting-component-properties.html

Java JFace TableViewer fix/freeze row

I've build an application in Java with the help of JFace/SWT. I am using mainly the TableViewer of JFace and sometime the SWT table behind with myTableViewer.getTable().
My table has a header (filled with the column names) and the first row is rendered with CCombos in CellEditors (drop down menus for filters).
Now I want to fix this first row ("filter-row") in the table, so it is always shown, independently if I am scrolling down or not..
Do you know any opportunity to do this (instead of splitting one table in two tables, as I found it in the internet)?
The SWT Table does not support fixed rows or columns.
If the combos were inteded to hold a limited number of choices you may use context menus on the column headers instead.
There are also alternative Table-like implementations in varying degrees of maturity that you may consider:
Nebula Grid
XViewer
NatTable
If non of the above fits your requirements you will have to either use a distinct table that holds the combo widgets or implement a custom 'header' control.

Jface tableviewer - Columns are not spaced out even with tablecolumnlayout

I am using a jface tableviewer with a tablecolumnlayout (for it's parent composite) in my eclipse RCP application.
I see that, in my view, the columns are equally spaced out to cover the entire width of the table.. So far so good.
We have a functionality where we need to save & load the table layout . Basically user can hide/ re-order any number of columns and he wishes to save that particular layout..
I am using the eclipse preferences API to save/retrieve the table layout.
The view opens with a default layout (with all columns & with the default ordering ) when the view is opened for the 1st time. Hence, I would save a DEFAULT layout(with the default ordering & column widths) whenever the view loads so that user can come back to the original layout at any time.
But, the problem here is when I try to load the default layout, I see that the columns are NOT equally spaced out and there is an empty column at the end.
What can i possibly do to achieve the default behaviour where columns get equally spaced out to cover the width of the table?
Note: I tried invoking the layout() of table's parent composite or calling the redraw of both table as well as composite but it did not work out.
I solved the above mentioned issue.
SWT increases the given width of the columns during view rendering so that the entire table width is occupied.
I was able to get the increased width of each column only when the view was about to be rendered (during part Activation ).
If I asked for the column width just after using the tablecolumnlayout, I was still getting the predefined width.
As a solution to this, I moved my code to save the default layout during part activation so that the actual increased width is obtained.

Smartgwt ListGrid auto generated selection checkbox column freezing

I am using smartGwt 4.0, ListGrid allows us to add multiple columns with auto generated checkbox selection. I am using below property to get checkboxs for each record in the grid,
listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
I have many columns in the ListGrid so it comes with horizontal scrollbar, when i try to scroll to the right side, the selection checkbox column gets scrolled and after verifying mutil column values user has to scroll all the way left to select the record, this is bit annoying, is there a way to freez the checkbox column in ListGrid...?
yes you can do it using ListGridField#setFrozen().
whether this field should be "frozen" for the purposes of horizontal scrolling.
sample code:
listGridField.setFrozen(true);
--EDIT--
Try with ListGrid#freezeField() or other equivalent methods.
For detailed information have a look at FrozenFields
If it doesn't work then add your checkbox column instead of using default checkbox selection appearance and now make it frozen.

Categories

Resources