How can I set a minimum size of the shell in swt? For example I have added a search field in my shell but I can shrink the shell almost completely and then the search field isn't completely visible. Can I change a property of the search field to stop resizing if it would be unseen?
No, there isn't any property or anything like that to prevent the resizing.
You can use Shell.setMinimumSize
to set a minimum width.
Update The following resize code from the original version of this answer doesn't work as resize is called after the window is resized
shell.addListener(SWT.Resize, event -> {
Shell eventShell = (Shell)event.widget;
Point size = eventShell.getSize();
if (size.x < 100 || size.y < 100)
{
// Stop the resize event
event.doit = false;
}
});