How to add links inside combobox? - java

In the combobox dropdown, rather than just text content, how to add links as shown in this sample image:
Image shows edit & delete link in the dropdown along with the text content. How to implement something similar in Java using SWT?

In existing Combo available in SWT it is not possible to add links for specific function.
So the better solution is to create your own custom widgets in SWT.
Writing Portable Widgets
The SWT library provides two widget classes that are typically used as the basis for a custom 100% Java portable widget:
Canvas - to create basic widgets
Composite - to create compound widgets
Please refer Write Your Own Widget and
Developing custom widgets with SWT for creating custom widget.

Related

Java Swing Panel collapse into drop down on resize

I am working on ribbons using Java Swing technology. I am not using the already made framework called Flamingo (it's not giving the style I want), rather I am implementing it via the netbeans swing drag and drop. I want to make the panels collapse into drop down when the window is resized.
Like if we resized the window to be very small, we will have 3 dropdowns: File, Preferences and Help. Each drop down gives the elements in each section.
Any ideas how to achieve this?

Using css border property in eclipse rcp application

I am currently working on an eclipse rcp application that we want to customize look-and-feel wise via CSS.
Sadly the documentation is not that great, so I'd like to try to get help here.
I would like to configure the border of several Widgets via CSS. For example Composite or ScrolledComposite.
The CSS Theme is working generally, this question is only about the border property.
Can I use the border property at all to configure the border of an Widget or is there only the SWT.BORDER property that needs to be set in the creation process of a widget?
There is no support for borders in the SWT CSS. The SWT.BORDER style on the control constructor is the only thing available.
You can write your own CSS property handlers using the org.eclipse.e4.ui.css.core.propertyHandler extension point, but adding a border would be difficult as the SWT controls don't support it.
All the existing CSS properties are defined using the org.eclipse.e4.ui.css.core.propertyHandler extension point, mostly in the org.eclipse.e4.ui.css.swt plugin.

Java UI designer for end-user

I'm making a Java Swing application where the user can run and edit JavaScript and Python code using a ScriptEngine. I want the user to be able to drag-and-drop design custom frames with standard components (buttons, text boxes, etc) and specify code to run when buttons are pressed or text is typed. I will also need a way to load and save the forms and run them inside my app. Are there any libraries I can use for this? I've tried searching around but I'm not finding much.

Is it possible to add custom data to the notification body(links, buttons, ...)

I want to add some components to the body of vaadin notification. It can be button or link.
So, is it possible and how can I do it?
I am using vaadin 6.7.2
Unfortunately you can't add custom components to stock Vaadin notifications.
There are addons built specifically for this purpose, though.
Notifique is a really good one and you craft it to suit to a lot of different scenarios. You can also add custom layouts and components to it's content.

Need help regarding lwuit

I have project, already developed using canvas and lib used is LCDUI.
It's for nokia keyboard supported devices.
Now I want to incorporate same application for touch devices.
I have used touch methods like pointerpressed, etc.
For normal functionality that worked pretty well.
But it creates problem in commands.
My application is in fullscreen mode. Commands I have created using user defined menu list.
Probles is that I can not directly identify that which command has been clicked.
Setting coordinates for every command is not thr feasible solution for me.
I come across the new lib LWUIT, but i found out that it supports only forms(Can't we use on canvas?).
and integrating LCDUI and LWUIT is also not possible(please give suggestion that can we use both in same application?).
Is it possible to create form under canvas itself?
Any other lib support available?
thank you.
If you want to use LWUIT, then it has a Painter mechanism for custom background painting. I assume you can have a Form with its background painted as you like using Painter.
Some help can be found here:
Using Styles, Themes and Painters with LWUIT
LWUIT is made to override every component. You also have a basic painter class to draw lines and basic geomotry in all sorts of colors you desire. So if you combine those two, you can do some very nice stuff.
So if you override your component with an actionlistener it should generate events, which you can then catch in a parent component who has an actionperformed function.
hope this helps.

Categories