Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up of dialog constructors for actions and pipelines #4006 #4007

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ default boolean passDataToServletOutput() {
* the org.apache.hop.ui  * tree and has a class name that is the name of the action with
* 'Dialog' added to the end.  *
*
* <p> * e.g. if the action is org.apache.hop.workflow.actions.zipfile.JobEntryZipFile the dialog
* would be  * org.apache.hop.ui.workflow.actions.zipfile.JobEntryZipFileDialog  *
* <p> * e.g. if the action is org.apache.hop.workflow.actions.zipfile.ActionZipFile the dialog
* would be  * org.apache.hop.ui.workflow.actions.zipfile.ActionZipFileDialog  *
*
* <p> * If the dialog class for a action does not match this pattern it should override this
* method and return the  * appropriate class name  *  * @return full class name of the dialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
Expand All @@ -44,7 +43,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit a Action Abort object. */
public class ActionAbortDialog extends ActionDialog implements IActionDialog {
public class ActionAbortDialog extends ActionDialog {
private static final Class<?> PKG = ActionAbortDialog.class; // For Translator

private ActionAbort action;
Expand All @@ -58,19 +57,18 @@ public class ActionAbortDialog extends ActionDialog implements IActionDialog {
private Button wAlwaysLogRows;

public ActionAbortDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent, ActionAbort action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionAbort) action;
this.action = action;
if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionAbortDialog.ActionName.Label"));
}
}

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell.setMinimumSize(400, 200);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
Expand All @@ -49,7 +48,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit the Delete Files action settings. */
public class ActionAddResultFilenamesDialog extends ActionDialog implements IActionDialog {
public class ActionAddResultFilenamesDialog extends ActionDialog {
private static final Class<?> PKG = ActionAddResultFilenamesDialog.class; // For Translator

private static final String[] FILETYPES =
Expand Down Expand Up @@ -83,9 +82,12 @@ public class ActionAddResultFilenamesDialog extends ActionDialog implements IAct
private Button wbaFilename; // Add or change

public ActionAddResultFilenamesDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent,
ActionAddResultFilenames action,
WorkflowMeta workflowMeta,
IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionAddResultFilenames) action;
this.action = action;

if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionAddResultFilenames.Name.Default"));
Expand All @@ -94,9 +96,7 @@ public ActionAddResultFilenamesDialog(

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
Expand All @@ -47,7 +46,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit a Action As400Command metadata. */
public class ActionAs400CommandDialog extends ActionDialog implements IActionDialog {
public class ActionAs400CommandDialog extends ActionDialog {
private static final Class<?> PKG = ActionAs400CommandDialog.class; // For Translator

private ActionAs400Command action;
Expand All @@ -69,19 +68,17 @@ public class ActionAs400CommandDialog extends ActionDialog implements IActionDia
private LabelTextVar wCommand;

public ActionAs400CommandDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent, ActionAs400Command action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionAs400Command) action;
this.action = action;
if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionAs400CommandDialog.Name.Default"));
}
}

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell.setMinimumSize(new Point(600, 400));
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
Expand All @@ -50,7 +49,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit the check database connection action settings. */
public class ActionCheckDbConnectionsDialog extends ActionDialog implements IActionDialog {
public class ActionCheckDbConnectionsDialog extends ActionDialog {
private static final Class<?> PKG = ActionCheckDbConnectionsDialog.class; // For Translator

private Text wName;
Expand All @@ -62,19 +61,20 @@ public class ActionCheckDbConnectionsDialog extends ActionDialog implements IAct
private TableView wFields;

public ActionCheckDbConnectionsDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent,
ActionCheckDbConnections action,
WorkflowMeta workflowMeta,
IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionCheckDbConnections) action;
this.action = action;
if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionCheckDbConnections.Name.Default"));
}
}

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
Expand All @@ -48,7 +47,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit the Delete Files action settings. */
public class ActionCheckFilesLockedDialog extends ActionDialog implements IActionDialog {
public class ActionCheckFilesLockedDialog extends ActionDialog {
private static final Class<?> PKG = ActionCheckFilesLocked.class; // For Translator

private static final String[] FILETYPES =
Expand Down Expand Up @@ -80,9 +79,12 @@ public class ActionCheckFilesLockedDialog extends ActionDialog implements IActio
private Button wbaFilename; // Add or change

public ActionCheckFilesLockedDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent,
ActionCheckFilesLocked action,
WorkflowMeta workflowMeta,
IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionCheckFilesLocked) action;
this.action = action;

if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionCheckFilesLocked.Name.Default"));
Expand All @@ -91,9 +93,7 @@ public ActionCheckFilesLockedDialog(

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.apache.hop.workflow.actions.columnsexist.ActionColumnsExist.ColumnExist;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
Expand All @@ -63,7 +62,7 @@
* This dialog allows you to edit the Column Exists action settings. (select the connection and the
* table to be checked) This entry type evaluates!
*/
public class ActionColumnsExistDialog extends ActionDialog implements IActionDialog {
public class ActionColumnsExistDialog extends ActionDialog {
private static final Class<?> PKG = ActionColumnsExist.class; // For Translator

private Text wName;
Expand All @@ -81,19 +80,17 @@ public class ActionColumnsExistDialog extends ActionDialog implements IActionDia
private TextVar wSchemaname;

public ActionColumnsExistDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent, ActionColumnsExist action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionColumnsExist) action;
this.action = action;
if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionColumnsExist.Name.Default"));
}
}

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
Expand All @@ -56,7 +55,7 @@
import org.eclipse.swt.widgets.ToolItem;

/** This dialog allows you to edit the Copy Files action settings. */
public class ActionCopyFilesDialog extends ActionDialog implements IActionDialog {
public class ActionCopyFilesDialog extends ActionDialog {
private static final Class<?> PKG = ActionCopyFiles.class; // For Translator

protected static final String[] FILETYPES =
Expand Down Expand Up @@ -87,19 +86,17 @@ public class ActionCopyFilesDialog extends ActionDialog implements IActionDialog
private ToolItem deleteToolItem; // Delete

public ActionCopyFilesDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent, ActionCopyFiles action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionCopyFiles) action;
this.action = action;

if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionCopyFiles.Name.Default"));
}
}

protected void initUi() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyListener;
Expand All @@ -46,7 +45,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit the Copy/Move result filenames action settings. */
public class ActionCopyMoveResultFilenamesDialog extends ActionDialog implements IActionDialog {
public class ActionCopyMoveResultFilenamesDialog extends ActionDialog {
private static final Class<?> PKG = ActionCopyMoveResultFilenames.class; // For Translator

private Text wName;
Expand Down Expand Up @@ -102,9 +101,12 @@ public class ActionCopyMoveResultFilenamesDialog extends ActionDialog implements
private Button wAddDestinationFilename;

public ActionCopyMoveResultFilenamesDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent,
ActionCopyMoveResultFilenames action,
WorkflowMeta workflowMeta,
IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionCopyMoveResultFilenames) action;
this.action = action;

if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionDeleteResultFilenames.Name.Default"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.hop.ui.workflow.dialog.WorkflowDialog;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.action.IAction;
import org.apache.hop.workflow.action.IActionDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
Expand All @@ -43,7 +42,7 @@
import org.eclipse.swt.widgets.Text;

/** This dialog allows you to edit the Create File action settings. */
public class ActionCreateFileDialog extends ActionDialog implements IActionDialog {
public class ActionCreateFileDialog extends ActionDialog {
private static final Class<?> PKG = ActionCreateFile.class; // For Translator

private static final String[] FILETYPES =
Expand All @@ -62,19 +61,17 @@ public class ActionCreateFileDialog extends ActionDialog implements IActionDialo
private boolean changed;

public ActionCreateFileDialog(
Shell parent, IAction action, WorkflowMeta workflowMeta, IVariables variables) {
Shell parent, ActionCreateFile action, WorkflowMeta workflowMeta, IVariables variables) {
super(parent, workflowMeta, variables);
this.action = (ActionCreateFile) action;
this.action = action;
if (this.action.getName() == null) {
this.action.setName(BaseMessages.getString(PKG, "ActionCreateFile.Name.Default"));
}
}

@Override
public IAction open() {
Shell parent = getParent();

shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.RESIZE);
shell.setMinimumSize(400, 210);
PropsUi.setLook(shell);
WorkflowDialog.setShellImage(shell, action);
Expand Down
Loading
Loading