Skip to content

Commit

Permalink
small code cleanup, #1995
Browse files Browse the repository at this point in the history
  • Loading branch information
hansva committed May 27, 2023
1 parent 211945b commit fe256e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@

package org.apache.hop.workflow.actions.tableexists;

import java.util.List;
import org.apache.hop.core.ICheckResult;
import org.apache.hop.core.Result;
import org.apache.hop.core.annotations.Action;
import org.apache.hop.core.database.Database;
import org.apache.hop.core.database.DatabaseMeta;
import org.apache.hop.core.exception.HopDatabaseException;
import org.apache.hop.core.util.Utils;import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.metadata.api.HopMetadataProperty;import org.apache.hop.metadata.api.IHopMetadataProvider;
import org.apache.hop.metadata.api.HopMetadataProperty;
import org.apache.hop.metadata.api.IHopMetadataProvider;
import org.apache.hop.resource.ResourceEntry;
import org.apache.hop.resource.ResourceEntry.ResourceType;
import org.apache.hop.resource.ResourceReference;
Expand All @@ -35,8 +38,6 @@
import org.apache.hop.workflow.action.validator.ActionValidatorUtils;
import org.apache.hop.workflow.action.validator.AndValidator;

import java.util.List;

/** This defines a table exists action. */
@Action(
id = "TABLE_EXISTS",
Expand All @@ -49,13 +50,13 @@
public class ActionTableExists extends ActionBase implements Cloneable, IAction {
private static final Class<?> PKG = ActionTableExists.class; // For Translator

@HopMetadataProperty(key="tablename")
@HopMetadataProperty(key = "tablename")
private String tableName;

@HopMetadataProperty(key="schemaname")
@HopMetadataProperty(key = "schemaname")
private String schemaName;

@HopMetadataProperty(key="connection")
@HopMetadataProperty(key = "connection")
private String connection;

public ActionTableExists(String n) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import org.apache.hop.metadata.api.IHopMetadataProvider;
import org.apache.hop.pipeline.transform.ITransform;
import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.MessageBox;import org.apache.hop.ui.core.gui.WindowProperty;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.gui.WindowProperty;
import org.apache.hop.ui.core.widget.MetaSelectionLine;
import org.apache.hop.workflow.WorkflowMeta;
import org.eclipse.swt.SWT;
Expand Down Expand Up @@ -138,18 +139,19 @@ public MetaSelectionLine<DatabaseMeta> addConnectionLine(
* @return the combo box UI component
*/
public MetaSelectionLine<DatabaseMeta> addConnectionLine(
Composite parent, Control previous, String connection, ModifyListener lsMod) {
Composite parent, Control previous, String connection, ModifyListener lsMod) {

DatabaseMeta databaseMeta = getWorkflowMeta().findDatabase(connection, variables);
// If we are unable to find the database metadata, display only a warning message so that the user
// If we are unable to find the database metadata, display only a warning message so that the
// user
// can proceed to correct the issue in the affected pipeline
if (databaseMeta == null) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_WARNING);
mb.setMessage(
BaseMessages.getString(
PKG,
"BaseTransformDialog.InvalidConnection.DialogMessage",
variables.resolve(connection)));
BaseMessages.getString(
PKG,
"BaseTransformDialog.InvalidConnection.DialogMessage",
variables.resolve(connection)));
mb.setText(BaseMessages.getString(PKG, "BaseTransformDialog.InvalidConnection.DialogTitle"));
mb.open();
}
Expand Down

0 comments on commit fe256e0

Please sign in to comment.