How to implement a image list control with SWT? - swt

Does anybody have any idea on how to easily implement a image list(like the windows explorer with medium icons) control with swt? it seems like that it could be done easily with CListCtrl in c++ on windows, but does not seem to be easy with swt? any hints are appreciated!

Up to me, you need to create your own widget (check e.g. http://www.snip2code.com/Snippet/11489/Custom-SWT-List-Box) and add composite items to your custom list.

If vertical-only scrolling is enough, I suggest you rely on a single column TableViewer. This is what I did in a project where I needed a gallery-like window allowing the user to pick a graphical component based on displayed thumbnails.
You just need to implement the proper TableLabelProvider.getColumnImage and return the desired thumbnail corresponding to your list entry.
That gives a pretty decent list-like rendering.
In addition, TableViewer API is very well documented.

Related

WindowBuilder SWT Table

Can you suggest me how to build a Table with Eclipse WindowBuilder Plugin and SWT?
I read the official docs but I found orrible example with fixed column size. I would like to build a Table who fit the parent container (I used composite) when it is resized.
P.S.: Maybe I should use Swing instead?? All valid example I have seen are with JTable..
Can you help me?
Thank you
Thank you for your reply!
I have to do a little GUI application for a friend, I'm not so practice nor with Swing neither with SWT.
Anyway I manage to do a Simple ApplicationWindow with menubar, some submenu item and a composite container under the menu where panel should appear when user clicks on menu item.
Than I manage to build a TableViewer inside that composite component.. but now I would like add another table in the same place (the table represents different thing and should appear or disappear when user click some menu button).
In Swing I see many example of CardLayout but nothing with SWT.
Can you suggest me a simple example of layered layout with SWT?? I have the impression that Swing is much more simple..
Thank you all
On my modest opinion, Swing is well documented than SWT and maybe more simple. I switched to it.
Thank you.

Is it possible to put my own custom control or composite inside listviewer of Jface

I wanted to display list of custom controls or composite in a list .I was thinking to use listview But I stumbled that listview only supports text or image it does not support to put composite inside (Even I see its same with atble viewer too .Is there any way this can be done
You can accomplish that, with some extra effort, have a look to this:Snippet
https://github.com/eclipse/eclipse.platform.ui/blob/master/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet010OwnerDraw.java
in the "CountryEntries classes" you can find different methods that draw the parts:
drawFlag
drawName
drawCupYear

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

Can you create a resizable control in SWT?

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.

j2me form how to define gui properties

i'm new to j2me. how to set form elements (text field ,text box) width,font,alignment and other Gui related properties.
i tried to find solution for setting form background but no success. can you guide me
Firstly, J2ME is a very limited framework.
As far as I can remember if you are just using an item from the basic javax.microedition.lcdui package there is very limited styling available. It allows you to give directives on how to lay the item out on the screen and what the item's appearance mode will be.
An Item is not responsible for where it is placed and is down to the Screens layout management algorithm to place your item on the Screen. For example, the way Items are laid out on Forms and Lists differ based upon how the layout management works.
You can create your own customs items by extending CustomItem and implementing and overriding various functions to get the desired visual effect. This however is a lot of work
and the end result is not always very pleasing. You could also do the same by extending the Form class and overriding the paint methods to get your disered visual effect.
The best way to have control over form elements is to use one of the Widget like frameworks that exist and are built upon these basic J2ME classes. For example LWUIT and J2ME Polish allow you to style items in a very similar manner and layout Items using a CSS box inspired manner.
Although I have no used LWUIT so cannot vouch for it.