当前位置: 首页>>代码示例>>Java>>正文


Java EnterSelectionDialog.getSelectionIndeces方法代码示例

本文整理汇总了Java中org.pentaho.di.ui.core.dialog.EnterSelectionDialog.getSelectionIndeces方法的典型用法代码示例。如果您正苦于以下问题:Java EnterSelectionDialog.getSelectionIndeces方法的具体用法?Java EnterSelectionDialog.getSelectionIndeces怎么用?Java EnterSelectionDialog.getSelectionIndeces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.ui.core.dialog.EnterSelectionDialog的用法示例。


在下文中一共展示了EnterSelectionDialog.getSelectionIndeces方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectSlaveServers

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void selectSlaveServers()
{
    String[] names = SlaveServer.getSlaveServerNames(slaveServers);
    int idx[] = Const.indexsOfFoundStrings(wServers.getItems(0), names);
    
    EnterSelectionDialog dialog = new EnterSelectionDialog(shell, names, Messages.getString("ClusterSchemaDialog.SelectServers.Label"),  //$NON-NLS-1$
		Messages.getString("ClusterSchemaDialog.SelectServersCluster.Label")); //$NON-NLS-1$
    dialog.setSelectedNrs(idx);
    dialog.setMulti(true);
    if (dialog.open()!=null)
    {
        clusterSchema.getSlaveServers().clear();
        int[] indeces = dialog.getSelectionIndeces();
        for (int i=0;i<indeces.length;i++)
        {
            SlaveServer slaveServer = SlaveServer.findSlaveServer(slaveServers, names[indeces[i]]);
            clusterSchema.getSlaveServers().add(slaveServer);
        }
        
        refreshSlaveServers();
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:ClusterSchemaDialog.java

示例2: selectSlaveServers

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void selectSlaveServers()
{
    String[] names = SlaveServer.getSlaveServerNames(slaveServers);
    int idx[] = Const.indexsOfFoundStrings(wServers.getItems(0), names);
    
    EnterSelectionDialog dialog = new EnterSelectionDialog(shell, names, BaseMessages.getString(PKG, "ClusterSchemaDialog.SelectServers.Label"),  //$NON-NLS-1$
		BaseMessages.getString(PKG, "ClusterSchemaDialog.SelectServersCluster.Label")); //$NON-NLS-1$
    dialog.setAvoidQuickSearch();
    dialog.setSelectedNrs(idx);
    dialog.setMulti(true);
    if (dialog.open()!=null)
    {
        clusterSchema.getSlaveServers().clear();
        int[] indeces = dialog.getSelectionIndeces();
        for (int i=0;i<indeces.length;i++)
        {
            SlaveServer slaveServer = SlaveServer.findSlaveServer(slaveServers, names[indeces[i]]);
            clusterSchema.getSlaveServers().add(slaveServer);
        }
        
        refreshSlaveServers();
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:ClusterSchemaDialog.java

示例3: selectSlaveServers

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void selectSlaveServers() {
  String[] names = SlaveServer.getSlaveServerNames( slaveServers );
  int[] idx = Const.indexsOfFoundStrings( wServers.getItems( 0 ), names );

  EnterSelectionDialog dialog =
    new EnterSelectionDialog( shell, names,
      BaseMessages.getString( PKG, "ClusterSchemaDialog.SelectServers.Label" ),
      BaseMessages.getString( PKG, "ClusterSchemaDialog.SelectServersCluster.Label" ) );
  dialog.setAvoidQuickSearch();
  dialog.setSelectedNrs( idx );
  dialog.setMulti( true );
  if ( dialog.open() != null ) {
    clusterSchema.getSlaveServers().clear();
    int[] indeces = dialog.getSelectionIndeces();
    for ( int i = 0; i < indeces.length; i++ ) {
      SlaveServer slaveServer = SlaveServer.findSlaveServer( slaveServers, names[indeces[i]] );
      clusterSchema.getSlaveServers().add( slaveServer );
    }

    refreshSlaveServers();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:ClusterSchemaDialog.java

示例4: getTableName

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void getTableName()
	{
		DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
		if (databaseMeta!=null)
		{
			Database database = new Database(databaseMeta);
			try
			{
				database.connect();
				String Tablenames[]=database.getTablenames();
				EnterSelectionDialog dialog = new EnterSelectionDialog(shell, Tablenames, Messages.getString("JobTruncateTables.SelectTables.Title"), Messages.getString("JobTruncateTables.SelectTables.Message"));
				dialog.setMulti(true);

				if (dialog.open()!=null)
				{
					int idx[] = dialog.getSelectionIndeces();
					for (int i=0;i<idx.length;i++)
					{
						TableItem tableItem = new TableItem(wFields.table, SWT.NONE);
						tableItem.setText(1, Tablenames[idx[i]]);
					}
				}
			}
			catch(KettleDatabaseException e)
			{
				new ErrorDialog(shell, Messages.getString("System.Dialog.Error.Title"), Messages.getString("JobEntryTruncateTables.ConnectionError.DialogMessage"), e);
			}
			finally
			{
				if(database!=null) database.disconnect();
			}
		    wFields.removeEmptyRows();
		    wFields.setRowNums();
		    wFields.optWidth(true);
		 
		}
		
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:39,代码来源:JobEntryTruncateTablesDialog.java

示例5: getTableName

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void getTableName()
	{
		DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
		if (databaseMeta!=null)
		{
			Database database = new Database(loggingObject, databaseMeta);
			try
			{
				database.connect();
				String Tablenames[]=database.getTablenames();
				EnterSelectionDialog dialog = new EnterSelectionDialog(shell, Tablenames, BaseMessages.getString(PKG, "JobTruncateTables.SelectTables.Title"), BaseMessages.getString(PKG, "JobTruncateTables.SelectTables.Message"));
				dialog.setMulti(true);
				dialog.setAvoidQuickSearch();
				if (dialog.open()!=null)
				{
					int idx[] = dialog.getSelectionIndeces();
					for (int i=0;i<idx.length;i++)
					{
						TableItem tableItem = new TableItem(wFields.table, SWT.NONE);
						tableItem.setText(1, Tablenames[idx[i]]);
					}
				}
			}
			catch(KettleDatabaseException e)
			{
				new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "JobEntryTruncateTables.ConnectionError.DialogMessage"), e);
			}
			finally
			{
				if(database!=null) database.disconnect();
			}
		    wFields.removeEmptyRows();
		    wFields.setRowNums();
		    wFields.optWidth(true);
		 
		}
		
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:39,代码来源:JobEntryTruncateTablesDialog.java

示例6: getTableName

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void getTableName() {
  DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() );
  if ( databaseMeta != null ) {
    Database database = new Database( loggingObject, databaseMeta );
    try {
      database.connect();
      String[] Tablenames = database.getTablenames();
      Arrays.sort( Tablenames );
      EnterSelectionDialog dialog = new EnterSelectionDialog( shell, Tablenames,
        BaseMessages.getString( PKG, "JobTruncateTables.SelectTables.Title" ),
        BaseMessages.getString( PKG, "JobTruncateTables.SelectTables.Message" ) );
      dialog.setMulti( true );
      dialog.setAvoidQuickSearch();
      if ( dialog.open() != null ) {
        int[] idx = dialog.getSelectionIndeces();
        for ( int i = 0; i < idx.length; i++ ) {
          TableItem tableItem = new TableItem( wFields.table, SWT.NONE );
          tableItem.setText( 1, Tablenames[idx[i]] );
        }
      }
    } catch ( KettleDatabaseException e ) {
      new ErrorDialog( shell,
        BaseMessages.getString( PKG, "System.Dialog.Error.Title" ),
        BaseMessages.getString( PKG, "JobEntryTruncateTables.ConnectionError.DialogMessage" ), e );
    } finally {
      if ( database != null ) {
        database.disconnect();
      }
    }
    wFields.removeEmptyRows();
    wFields.setRowNums();
    wFields.optWidth( true );

  }

}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:37,代码来源:JobEntryTruncateTablesDialog.java

示例7: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 */
private void getListColumns()
{
	if (!Const.isEmpty(wTablename.getText()))
	{
		DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
		if (databaseMeta!=null)
		{
			Database database = new Database(databaseMeta);
			database.shareVariablesWith(jobMeta);
			try
			{
				database.connect();
				String schemaTable = databaseMeta.getQuotedSchemaTableCombination(wSchemaname.getText(), wTablename.getText());
				RowMetaInterface row = database.getTableFields(schemaTable);
				String available[] = row.getFieldNames();
                   
				String source[] = wListattribut.getText().split(",");
				for (int i=0;i<source.length;i++) source[i] = Const.trim(source[i]);
				int idxSource[] = Const.indexsOfStrings(source, available);
				EnterSelectionDialog dialog = new EnterSelectionDialog(shell, available, Messages.getString("JobMysqlBulkLoad.SelectColumns.Title"), Messages.getString("JobMysqlBulkLoad.SelectColumns.Message"));
				dialog.setMulti(true);
				dialog.setSelectedNrs(idxSource);
				if (dialog.open()!=null)
				{
					String columns="";
					int idx[] = dialog.getSelectionIndeces();
					for (int i=0;i<idx.length;i++)
					{
						if (i>0) columns+=", ";
						columns+=available[idx[i]];
					}
					wListattribut.setText(columns);
				}
			}
			catch(KettleDatabaseException e)
			{
				new ErrorDialog(shell, Messages.getString("System.Dialog.Error.Title"), Messages.getString("JobMysqlBulkLoad.ConnectionError2.DialogMessage"), e);
			}
			finally
			{
				database.disconnect();
			}
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:49,代码来源:JobEntryMysqlBulkLoadDialog.java

示例8: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 *
 */
private void getListColumns()
{
    if (!Const.isEmpty(wTablename.getText()))
    {
        DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
        if (databaseMeta!=null)
        {
            Database database = new Database(databaseMeta);
            database.shareVariablesWith(jobMeta);
            try
            {
                database.connect();
                String schemaTable = databaseMeta.getQuotedSchemaTableCombination(wSchemaname.getText(), wTablename.getText());
                RowMetaInterface row = database.getTableFields(schemaTable);
                String available[] = row.getFieldNames();
                
                String source[] = wListColumn.getText().split(",");
                for (int i=0;i<source.length;i++) source[i] = Const.trim(source[i]);
                int idxSource[] = Const.indexsOfStrings(source, available);
                EnterSelectionDialog dialog = new EnterSelectionDialog(shell, available, Messages.getString("JobMysqlBulkFile.SelectColumns.Title"), Messages.getString("JobMysqlBulkFile.SelectColumns.Message"));
                dialog.setMulti(true);
                dialog.setSelectedNrs(idxSource);
                if (dialog.open()!=null)
                {
                    String columns="";
                    int idx[] = dialog.getSelectionIndeces();
                    for (int i=0;i<idx.length;i++)
                    {
                        if (i>0) columns+=", ";
                        columns+=available[idx[i]];
                    }
                    wListColumn.setText(columns);
                }
            }
            catch(KettleDatabaseException e)
            {
                new ErrorDialog(shell, Messages.getString("System.Dialog.Error.Title"), Messages.getString("JobMysqlBulkFile.ConnectionError2.DialogMessage"), e);
            }
            finally
            {
                database.disconnect();
            }
        }
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:50,代码来源:JobEntryMysqlBulkFileDialog.java

示例9: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 */
private void getListColumns()
{
	if (!Const.isEmpty(wTablename.getText()))
	{
		DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
		if (databaseMeta!=null)
		{
			Database database = new Database(databaseMeta);
			database.shareVariablesWith(jobMeta);
			try
			{
				database.connect();
				String schemaTable = databaseMeta.getQuotedSchemaTableCombination(wSchemaname.getText(), wTablename.getText());
				RowMetaInterface row = database.getTableFields(schemaTable);
				String available[] = row.getFieldNames();
                   
				String source[] = wOrderBy.getText().split(",");
				for (int i=0;i<source.length;i++) source[i] = Const.trim(source[i]);
				int idxSource[] = Const.indexsOfStrings(source, available);
				EnterSelectionDialog dialog = new EnterSelectionDialog(shell, available, Messages.getString("JobMssqlBulkLoad.SelectColumns.Title"), Messages.getString("JobMssqlBulkLoad.SelectColumns.Message"));
				dialog.setMulti(true);
				dialog.setSelectedNrs(idxSource);
				if (dialog.open()!=null)
				{
					String columns="";
					int idx[] = dialog.getSelectionIndeces();
					for (int i=0;i<idx.length;i++)
					{
						if (i>0) columns+=", ";
						columns+=available[idx[i]];
					}
					wOrderBy.setText(columns);
				}
			}
			catch(KettleDatabaseException e)
			{
				new ErrorDialog(shell, Messages.getString("System.Dialog.Error.Title"), Messages.getString("JobMssqlBulkLoad.ConnectionError2.DialogMessage"), e);
			}
			finally
			{
				database.disconnect();
			}
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:49,代码来源:JobEntryMssqlBulkLoadDialog.java

示例10: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 */
private void getListColumns()
{
	if (!Const.isEmpty(wTablename.getText()))
	{
		DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
		if (databaseMeta!=null)
		{
			Database database = new Database(loggingObject, databaseMeta);
			database.shareVariablesWith(jobMeta);
			try
			{
				database.connect();
				String schemaTable = databaseMeta.getQuotedSchemaTableCombination(wSchemaname.getText(), wTablename.getText());
				RowMetaInterface row = database.getTableFields(schemaTable);
				String available[] = row.getFieldNames();
                   
				String source[] = wListattribut.getText().split(",");
				for (int i=0;i<source.length;i++) source[i] = Const.trim(source[i]);
				int idxSource[] = Const.indexsOfStrings(source, available);
				EnterSelectionDialog dialog = new EnterSelectionDialog(shell, available, BaseMessages.getString(PKG, "JobMysqlBulkLoad.SelectColumns.Title"), BaseMessages.getString(PKG, "JobMysqlBulkLoad.SelectColumns.Message"));
				dialog.setMulti(true);
				dialog.setAvoidQuickSearch();
				dialog.setSelectedNrs(idxSource);
				if (dialog.open()!=null)
				{
					String columns="";
					int idx[] = dialog.getSelectionIndeces();
					for (int i=0;i<idx.length;i++)
					{
						if (i>0) columns+=", ";
						columns+=available[idx[i]];
					}
					wListattribut.setText(columns);
				}
			}
			catch(KettleDatabaseException e)
			{
				new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "JobMysqlBulkLoad.ConnectionError2.DialogMessage"), e);
			}
			finally
			{
				database.disconnect();
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:50,代码来源:JobEntryMysqlBulkLoadDialog.java

示例11: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 *
 */
private void getListColumns()
{
    if (!Const.isEmpty(wTablename.getText()))
    {
        DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
        if (databaseMeta!=null)
        {
            Database database = new Database(loggingObject, databaseMeta);
            database.shareVariablesWith(jobMeta);
            try
            {
                database.connect();
                String schemaTable = databaseMeta.getQuotedSchemaTableCombination(wSchemaname.getText(), wTablename.getText());
                RowMetaInterface row = database.getTableFields(schemaTable);
                String available[] = row.getFieldNames();
                
                String source[] = wListColumn.getText().split(",");
                for (int i=0;i<source.length;i++) source[i] = Const.trim(source[i]);
                int idxSource[] = Const.indexsOfStrings(source, available);
                EnterSelectionDialog dialog = new EnterSelectionDialog(shell, available, BaseMessages.getString(PKG, "JobMysqlBulkFile.SelectColumns.Title"), BaseMessages.getString(PKG, "JobMysqlBulkFile.SelectColumns.Message"));
                dialog.setMulti(true);
                dialog.setAvoidQuickSearch();
                dialog.setSelectedNrs(idxSource);
                if (dialog.open()!=null)
                {
                    String columns="";
                    int idx[] = dialog.getSelectionIndeces();
                    for (int i=0;i<idx.length;i++)
                    {
                        if (i>0) columns+=", ";
                        columns+=available[idx[i]];
                    }
                    wListColumn.setText(columns);
                }
            }
            catch(KettleDatabaseException e)
            {
                new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "JobMysqlBulkFile.ConnectionError2.DialogMessage"), e);
            }
            finally
            {
                database.disconnect();
            }
        }
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:51,代码来源:JobEntryMysqlBulkFileDialog.java

示例12: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 */
private void getListColumns()
{
	if (!Const.isEmpty(wTablename.getText()))
	{
		DatabaseMeta databaseMeta = jobMeta.findDatabase(wConnection.getText());
		if (databaseMeta!=null)
		{
			Database database = new Database(loggingObject, databaseMeta);
			database.shareVariablesWith(jobMeta);
			try
			{
				database.connect();
				String schemaTable = databaseMeta.getQuotedSchemaTableCombination(wSchemaname.getText(), wTablename.getText());
				RowMetaInterface row = database.getTableFields(schemaTable);
				String available[] = row.getFieldNames();
                   
				String source[] = wOrderBy.getText().split(",");
				for (int i=0;i<source.length;i++) source[i] = Const.trim(source[i]);
				int idxSource[] = Const.indexsOfStrings(source, available);
				EnterSelectionDialog dialog = new EnterSelectionDialog(shell, available, BaseMessages.getString(PKG, "JobMssqlBulkLoad.SelectColumns.Title"), BaseMessages.getString(PKG, "JobMssqlBulkLoad.SelectColumns.Message"));
				dialog.setMulti(true);
				dialog.setAvoidQuickSearch();
				dialog.setSelectedNrs(idxSource);
				if (dialog.open()!=null)
				{
					String columns="";
					int idx[] = dialog.getSelectionIndeces();
					for (int i=0;i<idx.length;i++)
					{
						if (i>0) columns+=", ";
						columns+=available[idx[i]];
					}
					wOrderBy.setText(columns);
				}
			}
			catch(KettleDatabaseException e)
			{
				new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "JobMssqlBulkLoad.ConnectionError2.DialogMessage"), e);
			}
			finally
			{
				database.disconnect();
			}
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:50,代码来源:JobEntryMssqlBulkLoadDialog.java

示例13: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 */
private void getListColumns() {
  if ( !Utils.isEmpty( wTablename.getText() ) ) {
    DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() );
    if ( databaseMeta != null ) {
      Database database = new Database( loggingObject, databaseMeta );
      database.shareVariablesWith( jobMeta );
      try {
        database.connect();
        String schemaTable =
          databaseMeta.getQuotedSchemaTableCombination( wSchemaname.getText(), wTablename.getText() );
        RowMetaInterface row = database.getTableFields( schemaTable );
        String[] available = row.getFieldNames();

        String[] source = wListattribut.getText().split( "," );
        for ( int i = 0; i < source.length; i++ ) {
          source[i] = Const.trim( source[i] );
        }
        int[] idxSource = Const.indexsOfStrings( source, available );
        EnterSelectionDialog dialog = new EnterSelectionDialog( shell, available,
          BaseMessages.getString( PKG, "JobMysqlBulkLoad.SelectColumns.Title" ),
          BaseMessages.getString( PKG, "JobMysqlBulkLoad.SelectColumns.Message" ) );
        dialog.setMulti( true );
        dialog.setAvoidQuickSearch();
        dialog.setSelectedNrs( idxSource );
        if ( dialog.open() != null ) {
          String columns = "";
          int[] idx = dialog.getSelectionIndeces();
          for ( int i = 0; i < idx.length; i++ ) {
            if ( i > 0 ) {
              columns += ", ";
            }
            columns += available[idx[i]];
          }
          wListattribut.setText( columns );
        }
      } catch ( KettleDatabaseException e ) {
        new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
          .getString( PKG, "JobMysqlBulkLoad.ConnectionError2.DialogMessage" ), e );
      } finally {
        database.disconnect();
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:48,代码来源:JobEntryMysqlBulkLoadDialog.java

示例14: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 *
 */
private void getListColumns() {
  if ( !Utils.isEmpty( wTablename.getText() ) ) {
    DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() );
    if ( databaseMeta != null ) {
      Database database = new Database( loggingObject, databaseMeta );
      database.shareVariablesWith( jobMeta );
      try {
        database.connect();
        String schemaTable =
          databaseMeta.getQuotedSchemaTableCombination( wSchemaname.getText(), wTablename.getText() );
        RowMetaInterface row = database.getTableFields( schemaTable );
        String[] available = row.getFieldNames();

        String[] source = wListColumn.getText().split( "," );
        for ( int i = 0; i < source.length; i++ ) {
          source[i] = Const.trim( source[i] );
        }
        int[] idxSource = Const.indexsOfStrings( source, available );
        EnterSelectionDialog dialog = new EnterSelectionDialog( shell, available,
          BaseMessages.getString( PKG, "JobMysqlBulkFile.SelectColumns.Title" ),
          BaseMessages.getString( PKG, "JobMysqlBulkFile.SelectColumns.Message" ) );
        dialog.setMulti( true );
        dialog.setAvoidQuickSearch();
        dialog.setSelectedNrs( idxSource );
        if ( dialog.open() != null ) {
          String columns = "";
          int[] idx = dialog.getSelectionIndeces();
          for ( int i = 0; i < idx.length; i++ ) {
            if ( i > 0 ) {
              columns += ", ";
            }
            columns += available[idx[i]];
          }
          wListColumn.setText( columns );
        }
      } catch ( KettleDatabaseException e ) {
        new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
          .getString( PKG, "JobMysqlBulkFile.ConnectionError2.DialogMessage" ), e );
      } finally {
        database.disconnect();
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:49,代码来源:JobEntryMysqlBulkFileDialog.java

示例15: getListColumns

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
 * Get a list of columns, comma separated, allow the user to select from it.
 */
private void getListColumns() {
  if ( !Utils.isEmpty( wTablename.getText() ) ) {
    DatabaseMeta databaseMeta = jobMeta.findDatabase( wConnection.getText() );
    if ( databaseMeta != null ) {
      Database database = new Database( loggingObject, databaseMeta );
      database.shareVariablesWith( jobMeta );
      try {
        database.connect();
        String schemaTable =
          databaseMeta.getQuotedSchemaTableCombination( wSchemaname.getText(), wTablename.getText() );
        RowMetaInterface row = database.getTableFields( schemaTable );
        String[] available = row.getFieldNames();

        String[] source = wOrderBy.getText().split( "," );
        for ( int i = 0; i < source.length; i++ ) {
          source[i] = Const.trim( source[i] );
        }
        int[] idxSource = Const.indexsOfStrings( source, available );
        EnterSelectionDialog dialog = new EnterSelectionDialog( shell, available,
          BaseMessages.getString( PKG, "JobMssqlBulkLoad.SelectColumns.Title" ),
          BaseMessages.getString( PKG, "JobMssqlBulkLoad.SelectColumns.Message" ) );
        dialog.setMulti( true );
        dialog.setAvoidQuickSearch();
        dialog.setSelectedNrs( idxSource );
        if ( dialog.open() != null ) {
          String columns = "";
          int[] idx = dialog.getSelectionIndeces();
          for ( int i = 0; i < idx.length; i++ ) {
            if ( i > 0 ) {
              columns += ", ";
            }
            columns += available[idx[i]];
          }
          wOrderBy.setText( columns );
        }
      } catch ( KettleDatabaseException e ) {
        new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
          .getString( PKG, "JobMssqlBulkLoad.ConnectionError2.DialogMessage" ), e );
      } finally {
        database.disconnect();
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:48,代码来源:JobEntryMssqlBulkLoadDialog.java


注:本文中的org.pentaho.di.ui.core.dialog.EnterSelectionDialog.getSelectionIndeces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。