本文整理汇总了Java中org.pentaho.di.ui.core.widget.ComboVar.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java ComboVar.removeAll方法的具体用法?Java ComboVar.removeAll怎么用?Java ComboVar.removeAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.ui.core.widget.ComboVar
的用法示例。
在下文中一共展示了ComboVar.removeAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: setEncodings
import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
private void setEncodings(ComboVar var)
{
// Encoding of the text file:
String encoding=Const.NVL(var.getText(),Const.getEnvironmentVariable("file.encoding", "UTF-8"));
var.removeAll();
ArrayList<Charset> values = new ArrayList<Charset>(Charset.availableCharsets().values());
for (int i=0;i<values.size();i++)
{
Charset charSet = (Charset)values.get(i);
var.add( charSet.displayName() );
}
// Now select the default!
int idx = Const.indexOfString(encoding, var.getItems() );
if (idx>=0) var.select( idx );
}
示例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);
}
}
示例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);
}
}
示例5: setEncodings
import org.pentaho.di.ui.core.widget.ComboVar; //导入方法依赖的package包/类
private void setEncodings( ComboVar var ) {
// Encoding of the text file:
String encoding = Const.NVL( var.getText(), Const.getEnvironmentVariable( "file.encoding", "UTF-8" ) );
var.removeAll();
ArrayList<Charset> values = new ArrayList<Charset>( Charset.availableCharsets().values() );
for ( int i = 0; i < values.size(); i++ ) {
Charset charSet = values.get( i );
var.add( charSet.displayName() );
}
// Now select the default!
int idx = Const.indexOfString( encoding, var.getItems() );
if ( idx >= 0 ) {
var.select( idx );
}
}
示例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);
}
}
示例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 );
}
}
示例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 );
}
}