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


Java ComboVar.setItems方法代码示例

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


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

示例1: createArgumentUI

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Create the UI to enter one argument.
 * @param argumentDescriptor
 * @param lastControl
 * @param items
 * @return The combobox where the user enters the argument.
 */
private ComboVar createArgumentUI(Object[] argumentDescriptor, Control lastControl, String[] items){
  String argumentName = (String)argumentDescriptor[0];
  Label label = new Label(metadataComposite, SWT.RIGHT);
  label.setText(BaseMessages.getString(PKG, "JdbcMetadata.arguments." + argumentName + ".Label"));
  label.setToolTipText(BaseMessages.getString(PKG, "JdbcMetadata.arguments." + argumentName + ".Tooltip"));
  props.setLook(label);
  FormData labelFormData = new FormData();
  labelFormData.left = new FormAttachment(0, 0);
  labelFormData.right = new FormAttachment(middle, -margin);
  labelFormData.top = new FormAttachment(lastControl, margin);
  label.setLayoutData(labelFormData);

  ComboVar comboVar = new ComboVar(transMeta, metadataComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
  props.setLook(comboVar);
  FormData comboVarFormData = new FormData();
  comboVarFormData.left = new FormAttachment(middle, 0);
  comboVarFormData.right = new FormAttachment(100, 0);
  comboVarFormData.top = new FormAttachment(lastControl, margin);
  comboVar.setLayoutData(comboVarFormData);
  comboVar.setItems(items);

  comboVar.addModifyListener(lsMod);

  return comboVar;
}
 
开发者ID:rpbouman,项目名称:pentaho-pdi-plugin-jdbc-metadata,代码行数:33,代码来源:JdbcMetaDataDialog.java

示例2: getFieldsFromPrevious

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Gets fields from previous steps and populate a ComboVar.
 * @param comboVar the comboVar to populate
 * @param TransMeta the source transformation
 * @param StepMeta the source step 
 */
public static final void getFieldsFromPrevious(ComboVar comboVar,TransMeta transMeta,StepMeta stepMeta)
{
 String selectedField=null;
 int indexField=-1;
 try{   
	 RowMetaInterface r = transMeta.getPrevStepFields(stepMeta);
	 selectedField=comboVar.getText();
	 comboVar.removeAll();
		
	 if (r!=null && !r.isEmpty()) {
            r.getFieldNames();
            comboVar.setItems(r.getFieldNames());
            indexField=r.indexOfValue(selectedField);
	 }
	 // Select value if possible...
	 if(indexField>-1) comboVar.select(indexField); else { if(selectedField!=null) comboVar.setText(selectedField);};
 }catch(KettleException ke){
		new ErrorDialog(comboVar.getShell(),Messages.getString("BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle"),
				Messages.getString("BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage"),ke);
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:28,代码来源:BaseStepDialog.java

示例3: getFieldsFromPrevious

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Gets fields from previous steps and populate a ComboVar.
 * @param comboVar the comboVar to populate
 * @param TransMeta the source transformation
 * @param StepMeta the source step 
 */
public static final void getFieldsFromPrevious(ComboVar comboVar,TransMeta transMeta,StepMeta stepMeta)
{
 String selectedField=null;
 int indexField=-1;
 try{   
	 RowMetaInterface r = transMeta.getPrevStepFields(stepMeta);
	 selectedField=comboVar.getText();
	 comboVar.removeAll();
		
	 if (r!=null && !r.isEmpty()) {
            r.getFieldNames();
            comboVar.setItems(r.getFieldNames());
            indexField=r.indexOfValue(selectedField);
	 }
	 // Select value if possible...
	 if(indexField>-1) comboVar.select(indexField); else { if(selectedField!=null) comboVar.setText(selectedField);};
 }catch(KettleException ke){
		new ErrorDialog(comboVar.getShell(),BaseMessages.getString(PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle"),
				BaseMessages.getString(PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage"),ke);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:28,代码来源:BaseStepDialog.java

示例4: getFieldsFromPrevious

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Gets fields from previous steps and populate a ComboVar.
 *
 * @param comboVar the Combo Box (with Variables) to populate
 * @param transMeta the transformation metadata
 * @param stepMeta the step metadata
 */
public static final void getFieldsFromPrevious(ComboVar comboVar,TransMeta transMeta,StepMeta stepMeta)
{
 String selectedField=null;
 int indexField=-1;
 try{   
	 RowMetaInterface r = transMeta.getPrevStepFields(stepMeta);
	 selectedField=comboVar.getText();
	 comboVar.removeAll();
		
	 if (r!=null && !r.isEmpty()) {
            r.getFieldNames();
            comboVar.setItems(r.getFieldNames());
            indexField=r.indexOfValue(selectedField);
	 }
	 // Select value if possible...
	 if(indexField>-1) comboVar.select(indexField); else { if(selectedField!=null) comboVar.setText(selectedField);};
 }catch(KettleException ke){
		new ErrorDialog(comboVar.getShell(),BaseMessages.getString(PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle"),
				BaseMessages.getString(PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage"),ke);
	}
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:29,代码来源:BaseStepDialog.java

示例5: createWidget

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
@Override
protected ComboVar createWidget( Composite parent ) {
  ComboVar comboVar = createComboVar( this.variableSpace, parent, SWT.BORDER );
  String[] itemsArray = this.items.toArray( new String[ items.size() ] );
  comboVar.setItems( itemsArray );
  return comboVar;
}
 
开发者ID:pentaho,项目名称:pdi-platform-utils-plugin,代码行数:8,代码来源:ComboVarBuilder.java

示例6: getFieldsFromPrevious

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Gets fields from previous steps and populate a ComboVar.
 *
 * @param comboVar  the comboVar to populate
 * @param TransMeta the source transformation
 * @param StepMeta  the source step
 */
public static final void getFieldsFromPrevious( ComboVar comboVar, TransMeta transMeta, StepMeta stepMeta ) {
  String selectedField = null;
  int indexField = -1;
  try {
    RowMetaInterface r = transMeta.getPrevStepFields(stepMeta);
    selectedField = comboVar.getText();
    comboVar.removeAll();

    if (r != null && !r.isEmpty()) {
      r.getFieldNames();
      comboVar.setItems(r.getFieldNames());
      indexField = r.indexOfValue(selectedField);
    }
    // Select value if possible...
    if (indexField > -1) {
      comboVar.select(indexField);
    } else {
      if (selectedField != null) {
        comboVar.setText(selectedField);
      }
    }
    ;
  } catch (KettleException ke) {
    new ErrorDialog(comboVar.getShell(),
        BaseMessages.getString(PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle"),
        BaseMessages.getString(PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage"), ke);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:36,代码来源:BaseStepXulDialog.java

示例7: getFieldsFromPrevious

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Gets fields from previous steps and populate a ComboVar.
 *
 * @param comboVar
 *          the comboVar to populate
 * @param TransMeta
 *          the source transformation
 * @param StepMeta
 *          the source step
 */
public static final void getFieldsFromPrevious( ComboVar comboVar, TransMeta transMeta, StepMeta stepMeta ) {
  String selectedField = null;
  int indexField = -1;
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepMeta );
    selectedField = comboVar.getText();
    comboVar.removeAll();

    if ( r != null && !r.isEmpty() ) {
      r.getFieldNames();
      comboVar.setItems( r.getFieldNames() );
      indexField = r.indexOfValue( selectedField );
    }
    // Select value if possible...
    if ( indexField > -1 ) {
      comboVar.select( indexField );
    } else {
      if ( selectedField != null ) {
        comboVar.setText( selectedField );
      }
    }

  } catch ( KettleException ke ) {
    new ErrorDialog( comboVar.getShell(),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle" ),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage" ), ke );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:39,代码来源:BaseStepXulDialog.java

示例8: getFieldsFromPrevious

import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
/**
 * Gets fields from previous steps and populate a ComboVar.
 *
 * @param comboVar  the Combo Box (with Variables) to populate
 * @param transMeta the transformation metadata
 * @param stepMeta  the step metadata
 */
public static final void getFieldsFromPrevious( ComboVar comboVar, TransMeta transMeta, StepMeta stepMeta ) {
  String selectedField = null;
  int indexField = -1;
  try {
    RowMetaInterface r = transMeta.getPrevStepFields( stepMeta );
    selectedField = comboVar.getText();
    comboVar.removeAll();

    if ( r != null && !r.isEmpty() ) {
      r.getFieldNames();
      comboVar.setItems( r.getFieldNames() );
      indexField = r.indexOfValue( selectedField );
    }
    // Select value if possible...
    if ( indexField > -1 ) {
      comboVar.select( indexField );
    } else {
      if ( selectedField != null ) {
        comboVar.setText( selectedField );
      }
    }
  } catch ( KettleException ke ) {
    new ErrorDialog( comboVar.getShell(),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogTitle" ),
      BaseMessages.getString( PKG, "BaseStepDialog.FailedToGetFieldsPrevious.DialogMessage" ), ke );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:35,代码来源:BaseStepDialog.java


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