hansva opened a new issue, #6469:
URL: https://github.com/apache/hop/issues/6469
### What would you like to happen?
Currently, every transform contains code to create a shell looking something
along the lines like this:
```
Shell parent = getParent();
shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX |
SWT.MIN);
PropsUi.setLook(shell);
setShellImage(shell, input);
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = PropsUi.getFormMargin();
formLayout.marginHeight = PropsUi.getFormMargin();
shell.setLayout(formLayout);
shell.setText(BaseMessages.getString(PKG,
"ChangeFileEncodingDialog.Shell.Title"));
```
I propose we move this code to `BaseTransformDialog.java` as the shell
variable itself is located there
```
protected void createShell(String title) {
Shell parent = getParent();
shell = new Shell(parent, BaseDialog.getDefaultDialogStyle());
PropsUi.setLook(shell);
setShellImage(shell, baseTransformMeta);
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = PropsUi.getFormMargin();
formLayout.marginHeight = PropsUi.getFormMargin();
shell.setLayout(formLayout);
shell.setText(title);
}
```
This will reduce code duplication across all our transforms, another small
adition is `BaseDialog.getDefaultDialogStyle()`
which looks like this:
```
public static int getDefaultDialogStyle() {
if (EnvironmentUtils.getInstance().isWeb() || OsHelper.isMac()) {
// For Hop Web and macOS, use simpler style without min/max buttons
return SWT.DIALOG_TRIM | SWT.RESIZE;
} else {
// For other desktop platforms, include min/max buttons
return SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN;
}
}
```
In Hop Web, the minimize button makes the application go into a weird state
where you lose the dialog with no way of reopening it, in MacOS the minimize
button on transform dialogs makes the entire application minimize
### Issue Priority
Priority: 2
### Issue Component
Component: Hop Gui
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]