org.pentaho.di.ui.trans.step.BaseStepDialog Java Examples

The following examples show how to use org.pentaho.di.ui.trans.step.BaseStepDialog. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PGBulkLoaderDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          if ( v.getType() == ValueMetaInterface.TYPE_DATE ) {
            // The default is date mask.
            tableItem.setText( 3, BaseMessages.getString( PKG, "PGBulkLoaderDialog.DateMask.Label" ) );
          } else {
            tableItem.setText( 3, "" );
          }
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "PGBulkLoaderDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "PGBulkLoaderDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #2
Source File: SortedMergeDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      BaseStepDialog.getFieldsFromPrevious(
        r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, new TableItemInsertListener() {
          public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
            tableItem.setText( 2, "Y" );
            return true;
          }
        } );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "SortedMergeDialog.UnableToGetFieldsError.DialogTitle" ),
      BaseMessages.getString( PKG, "SortedMergeDialog.UnableToGetFieldsError.DialogMessage" ), ke );
  }
}
 
Example #3
Source File: SetValueConstantDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepMeta );
    if ( r != null ) {
      TableItemInsertListener insertListener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          return true;
        }
      };

      BaseStepDialog
        .getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages
      .getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), ke );
  }
}
 
Example #4
Source File: TeraFastDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * ...
 */
public void getUpdate() {
  try {
    final RowMetaInterface row = this.transMeta.getPrevStepFields( this.stepname );
    if ( row != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( final TableItem tableItem, final ValueMetaInterface value ) {
          // possible to check format of input fields
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious(
        row, this.wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      this.shell, BaseMessages.getString( PKG, "TeraFastDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "TeraFastDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #5
Source File: IfNullDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener insertListener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          return true;
        }
      };

      BaseStepDialog
        .getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages
      .getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), ke );
  }

}
 
Example #6
Source File: GPLoadDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          if ( v.getType() == ValueMetaInterface.TYPE_DATE ) {
            // The default is date mask.
            tableItem.setText( 3, BaseMessages.getString( PKG, "GPLoadDialog.DateMask.Label" ) );
          } else {
            tableItem.setText( 3, "" );
          }
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "GPLoadDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "GPLoadDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #7
Source File: HTTPPOSTDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 3, NO ); // default is "N"
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wFields, 1, new int[] { 1, 2 }, null, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "HTTPPOSTDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "HTTPPOSTDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
Example #8
Source File: GetPreviousRowFieldDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          return true;
        }
      };

      BaseStepDialog.getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, listener );

    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString(
      PKG, "GetPreviousRowFieldDialog.FailedToGetFields.DialogTitle" ), BaseMessages.getString(
      PKG, "GetPreviousRowFieldDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #9
Source File: AggregateRowsDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && r.size() > 0 ) {
      BaseStepDialog.getFieldsFromPrevious( r, wFields, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, null );
    } else {
      MessageBox mb;
      mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION );
      mb.setMessage( BaseMessages.getString(
        PKG, "AggregateRowsDialog.CouldNotRetrieveFields.DialogMessage", Const.CR ) );
      mb.setText( BaseMessages.getString( PKG, "AggregateRowsDialog.CouldNotRetrieveFields.DialogTitle" ) );
      mb.open();
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "AggregateRowsDialog.GetFieldsFailed.DialogTitle" ), BaseMessages
        .getString( PKG, "AggregateRowsDialog.GetFieldsFailed.DialogMessage" ), ke );
  }
}
 
Example #10
Source File: OpenERPObjectOutputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getKeyFields() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, "=" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, tableViewKeyFields, 1, new int[]{ 1, 3 }, new int[]{ }, -1, -1,
        listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "OpenERPObjectOutputDialog.FailedToGetFields.Title" ),
      BaseMessages.getString( PKG, "OpenERPObjectOutputDialog.FailedToGetFields.Message" ), ke );
  }
}
 
Example #11
Source File: SalesforceInsertDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        @Override
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 3, "Y" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "SalesforceInsertDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "SalesforceInsertDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #12
Source File: MySQLBulkLoaderDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          if ( v.getType() == ValueMetaInterface.TYPE_DATE ) {
            // The default is : format is OK for dates, see if this sticks later on...
            //
            tableItem.setText( 3, "Y" );
          } else {
            tableItem.setText( 3, "Y" ); // default is OK too...
          }
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "MySQLBulkLoaderDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #13
Source File: WriteToLogDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener insertListener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          return true;
        }
      };
      BaseStepDialog
        .getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages
      .getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), ke );
  }

}
 
Example #14
Source File: FieldsChangeSequenceDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener insertListener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, BaseMessages.getString( PKG, "System.Combo.Yes" ) );
          return true;
        }
      };
      BaseStepDialog
        .getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages
      .getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), ke );
  }

}
 
Example #15
Source File: CheckSumDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener insertListener = new TableItemInsertListener() {
        @Override
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, BaseMessages.getString( PKG, "System.Combo.Yes" ) );
          return true;
        }
      };
      BaseStepDialog
        .getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages
      .getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), ke );
  }
}
 
Example #16
Source File: DatabaseLookupDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, "=" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wKey, 1, new int[] { 1, 3 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "DatabaseLookupDialog.GetFieldsFailed.DialogTitle" ), BaseMessages
        .getString( PKG, "DatabaseLookupDialog.GetFieldsFailed.DialogMessage" ), ke );
  }

}
 
Example #17
Source File: DeleteDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, "=" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wKey, 1, new int[] { 1, 3 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "DeleteDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "DeleteDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #18
Source File: SasInputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void get() {
  try {

    // As the user for a file to use as a reference
    //
    FileDialog dialog = new FileDialog( shell, SWT.OPEN );
    dialog.setFilterExtensions( new String[] { "*.sas7bdat;*.SAS7BDAT", "*.*" } );
    dialog.setFilterNames( new String[] {
      BaseMessages.getString( PKG, "SASInputDialog.FileType.SAS7BAT" ) + ", "
        + BaseMessages.getString( PKG, "System.FileType.TextFiles" ),
      BaseMessages.getString( PKG, "System.FileType.CSVFiles" ),
      BaseMessages.getString( PKG, "System.FileType.TextFiles" ),
      BaseMessages.getString( PKG, "System.FileType.AllFiles" ) } );
    if ( dialog.open() != null ) {
      String filename = dialog.getFilterPath() + System.getProperty( "file.separator" ) + dialog.getFileName();
      SasInputHelper helper = new SasInputHelper( filename );
      BaseStepDialog.getFieldsFromPrevious(
        helper.getRowMeta(), wFields, 1, new int[] { 1 }, new int[] { 3 }, 4, 5, null );
    }

  } catch ( Exception e ) {
    new ErrorDialog( shell, "Error", "Error reading information from file", e );
  }
}
 
Example #19
Source File: UpdateDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, "=" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wKey, 1, new int[] { 1, 3 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "UpdateDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "UpdateDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #20
Source File: CombinationLookupDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      BaseStepDialog.getFieldsFromPrevious(
        r, wKey, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, new TableItemInsertListener() {
          public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
            tableItem.setText( 3, "N" );
            return true;
          }
        } );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString(
      PKG, "CombinationLookupDialog.UnableToGetFieldsError.DialogTitle" ), BaseMessages.getString(
      PKG, "CombinationLookupDialog.UnableToGetFieldsError.DialogMessage" ), ke );
  }
}
 
Example #21
Source File: SortRowsDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener insertListener = new TableItemInsertListener() {
        @Override
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, BaseMessages.getString( PKG, "System.Combo.Yes" ) );
          return true;
        }
      };
      BaseStepDialog
        .getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, insertListener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages
      .getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), ke );
  }

}
 
Example #22
Source File: SynchronizeAfterMergeDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 3, "Y" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString(
      PKG, "SynchronizeAfterMergeDialog.FailedToGetFields.DialogTitle" ), BaseMessages.getString(
      PKG, "SynchronizeAfterMergeDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #23
Source File: SalesforceUpsertDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 3, "Y" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "SalesforceUpsertDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "SalesforceUpsertDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #24
Source File: LDAPOutputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 3, "Y" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "LDAPOutputUpdateDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "LDAPOutputUpdateDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #25
Source File: RssOutputDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get( TableView wTable ) {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wTable, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "RssOutputDialog.UnableToGetFieldsError.DialogTitle" ), BaseMessages
        .getString( PKG, "RssOutputDialog.UnableToGetFieldsError.DialogMessage" ), ke );
  }
}
 
Example #26
Source File: DBProcDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null && !r.isEmpty() ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          tableItem.setText( 2, "IN" );
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] { 3 }, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "DBProcDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "DBProcDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
Example #27
Source File: MergeJoinDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getKeys2() {
  MergeJoinMeta joinMeta = new MergeJoinMeta();
  getMeta( joinMeta );

  try {
    List<StreamInterface> infoStreams = joinMeta.getStepIOMeta().getInfoStreams();

    StepMeta stepMeta = infoStreams.get( 1 ).getStepMeta();
    if ( stepMeta != null ) {
      RowMetaInterface prev = transMeta.getStepFields( stepMeta );
      if ( prev != null ) {
        BaseStepDialog.getFieldsFromPrevious( prev, wKeys2, 1, new int[] { 1 }, new int[] {}, -1, -1, null );
      }
    }
  } catch ( KettleException e ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "MergeJoinDialog.ErrorGettingFields.DialogTitle" ), BaseMessages
        .getString( PKG, "MergeJoinDialog.ErrorGettingFields.DialogMessage" ), e );
  }
}
 
Example #28
Source File: MergeJoinDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getKeys1() {
  MergeJoinMeta joinMeta = new MergeJoinMeta();
  getMeta( joinMeta );

  try {
    List<StreamInterface> infoStreams = joinMeta.getStepIOMeta().getInfoStreams();

    StepMeta stepMeta = infoStreams.get( 0 ).getStepMeta();
    if ( stepMeta != null ) {
      RowMetaInterface prev = transMeta.getStepFields( stepMeta );
      if ( prev != null ) {
        BaseStepDialog.getFieldsFromPrevious( prev, wKeys1, 1, new int[] { 1 }, new int[] {}, -1, -1, null );
      }
    }
  } catch ( KettleException e ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "MergeJoinDialog.ErrorGettingFields.DialogTitle" ), BaseMessages
        .getString( PKG, "MergeJoinDialog.ErrorGettingFields.DialogMessage" ), e );
  }
}
 
Example #29
Source File: StringCutDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void get() {
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          if ( v.getType() == ValueMetaInterface.TYPE_STRING ) {
            // Only process strings
            return true;
          } else {
            return false;
          }
        }
      };

      BaseStepDialog.getFieldsFromPrevious( r, wFields, 1, new int[] { 1 }, new int[] {}, -1, -1, listener );

    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "StringCutDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "StringCutDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
Example #30
Source File: MonetDBBulkLoaderDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void getUpdate() {
  try {

    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      TableItemInsertListener listener = new TableItemInsertListener() {
        public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) {
          if ( v.getType() == ValueMetaInterface.TYPE_DATE ) {
            // The default is : format is OK for dates, see if this sticks later on...
            //
            tableItem.setText( 3, "Y" );
          } else {
            tableItem.setText( 3, "Y" ); // default is OK too...
          }
          return true;
        }
      };
      BaseStepDialog.getFieldsFromPrevious( r, wReturn, 1, new int[] { 1, 2 }, new int[] {}, -1, -1, listener );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages
      .getString( PKG, "MonetDBBulkLoaderDialog.FailedToGetFields.DialogTitle" ), BaseMessages.getString(
      PKG, "MonetDBBulkLoaderDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}