You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "hansva (via GitHub)" <gi...@apache.org> on 2026/01/28 10:02:24 UTC

[I] [Feature Request]: Add a default shell method for Transforms/Actions (hop)

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: issues-unsubscribe@hop.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Add a default shell method for Transforms/Actions (hop)

Posted by "nadment (via GitHub)" <gi...@apache.org>.
nadment commented on issue #6469:
URL: https://github.com/apache/hop/issues/6469#issuecomment-3813613237

   This is a good start to simplification, but we can go further and create a dialog box that handles much more:
   
   - The transformation name
   - The description
   - Help/OK, Cancel buttons
   
   Thus, a dialog box for an action/transform would only require 3 implemented methods.
   
   void createControl(Composite _parent);
   public void setWidgetsContent();
   public void getWidgetsContent(T meta);


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Add a default shell method for Transforms/Actions (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva closed issue #6469: [Feature Request]: Add a default shell method for Transforms/Actions
URL: https://github.com/apache/hop/issues/6469


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Feature Request]: Add a default shell method for Transforms/Actions (hop)

Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva commented on issue #6469:
URL: https://github.com/apache/hop/issues/6469#issuecomment-3816116942

   I'm not sure I want to take the challenge to rewrite all the dialogs at this point in time.
   My main problem was that I had to streamline the shell creation to allow different styles for different operating systems.
   
   But that being said, I have expanded the work to include the transform name, as this code is the same everywhere and I have added a builder for the buttons.
   
   This way, you can do
   
   ```
   buildButtonBar(null).ok(e -> ok()).preview(e -> preview()).cancel(e -> cancel()).build();
   ```


-- 
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: issues-unsubscribe@hop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org