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


Java CCombo.add方法代码示例

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


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

示例1: initServerCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void initServerCombo(Composite container) {
	Label serverLabel = new Label(container, SWT.FLAT);
	serverLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
	serverLabel.setText("Server: ");

	serverCombo = new CCombo(container, SWT.DROP_DOWN);
	serverCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1));
	for (String s : serverProposals)
		serverCombo.add(s);
	if (serverProposals.length > 0)
		serverCombo.select(0);
	if (defaultUriIndex >= 0 && defaultUriIndex < serverProposals.length)
		serverCombo.select(defaultUriIndex);

	// serverCombo.pack();
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:17,代码来源:LoginDialog.java

示例2: setInfos

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void setInfos(CCombo combo){
	try{
        String field=  combo.getText();
        combo.removeAll();
			
		RowMetaInterface r =  transMeta.getPrevStepFields(stepname);
		if (combo.equals(wFeatureNameField) || combo.equals(wFeatureDescField))
			combo.add(Messages.getString("KMLFileOutputDialog.NoField.Text"));
		if (r!=null){
	    	r.getFieldNames();
		    for (int i=0;i<r.getFieldNames().length;i++){	
		    	combo.add(r.getFieldNames()[i]);									
			}
		}
		if(field!=null) 
			combo.setText(field);
	}catch(KettleException ke){
		new ErrorDialog(shell, Messages.getString("KMLFileOutputDialog.FailedToGetFields.DialogTitle"), Messages.getString("KMLFileOutputDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:21,代码来源:KMLFileOutputDialog.java

示例3: PopulateFields

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void PopulateFields(CCombo cc)
{
 try{
          
		cc.removeAll();
		RowMetaInterface r = transMeta.getPrevStepFields(stepname);
		if (r!=null)
		{
             r.getFieldNames();
             
             for (int i=0;i<r.getFieldNames().length;i++)
				{	
					cc.add(r.getFieldNames()[i]);					
					
				}
		}

 }catch(KettleException ke){
		new ErrorDialog(shell, Messages.getString("XsltDialog.FailedToGetFields.DialogTitle"), Messages.getString("XsltDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
	}

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:23,代码来源:XsltDialog.java

示例4: PopulateFields

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void PopulateFields(CCombo cc)
{
 try{
          
		cc.removeAll();
		RowMetaInterface r = transMeta.getPrevStepFields(stepname);
		if (r!=null)
		{
             r.getFieldNames();
             
             for (int i=0;i<r.getFieldNames().length;i++)
				{	
					cc.add(r.getFieldNames()[i]);					
					
				}
		}

 }catch(KettleException ke){
		new ErrorDialog(shell, Messages.getString("XsdValidatorDialog.FailedToGetFields.DialogTitle"), Messages.getString("XsdValidatorDialogMod.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
	}
	


}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:25,代码来源:XsdValidatorDialog.java

示例5: appendBlankRowToTable

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private static void appendBlankRowToTable(Table table, TableItem item,
		int index) {

	item.setText(new String[] { String.format("%d", index), "Element name",
			"Action keyword", "", "Selector value" });

	TableEditor keywordChoiceEditor = new TableEditor(table);
	CCombo keywordChoiceCombo = new CCombo(table, SWT.NONE);
	keywordChoiceCombo.setText("Choose..");
	for (String keyword : keywordTable.keySet()) {
		keywordChoiceCombo.add(keyword);
	}
	// NOTE: none of options is initially selected
	keywordChoiceEditor.grabHorizontal = true;
	int keywordChoiceColumn = 2;
	keywordChoiceCombo.setData("column", keywordChoiceColumn);
	keywordChoiceCombo.setData("item", item);
	keywordChoiceEditor.setEditor(keywordChoiceCombo, item,
			keywordChoiceColumn);
	keywordChoiceCombo.addModifyListener(new keywordChoiceListener());

	TableEditor selectorChoiceEditor = new TableEditor(table);
	CCombo selectorChoiceCombo = new CCombo(table, SWT.NONE);
	selectorChoiceCombo.setText("Choose");
	for (String locator : selectorFromSWD.values()) {
		selectorChoiceCombo.add(locator);
	}
	// NOTE: none of options is initially selected
	selectorChoiceEditor.grabHorizontal = true;
	int selectorChoiceColumn = 3;
	selectorChoiceCombo.setData("item", item);
	selectorChoiceCombo.setData("column", selectorChoiceColumn);
	selectorChoiceEditor.setEditor(selectorChoiceCombo, item,
			selectorChoiceColumn);
	selectorChoiceCombo.addModifyListener(new selectorChoiceListener());
	return;
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:38,代码来源:TableEditorEx.java

示例6: createDialogArea

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	GridLayout gridLayout = (GridLayout) container.getLayout();
	gridLayout.numColumns = 2;
	
	Label lblNewAlternativeName = new Label(container, SWT.NONE);
	lblNewAlternativeName.setText("New alternative name:");
	
	text = new Text(container, SWT.BORDER);
	text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	
	Label lblAlternativeType = new Label(container, SWT.NONE);
	lblAlternativeType.setText("Alternative type:");
	
	combo = new CCombo(container, SWT.BORDER);
	GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
	gd_combo.widthHint = 115;
	combo.setLayoutData(gd_combo);
	
	for(ConfAlternative.Type type : ConfAlternative.Type.values()){
		combo.add(type.toString());
	}
	combo.select(0);
	
	return container;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:28,代码来源:NewConfigAlternativeDialog.java

示例7: addDatabases

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void addDatabases(CCombo wConnection, int databaseType) {
  for (int i = 0; i < jobMeta.nrDatabases(); i++) {
    DatabaseMeta ci = jobMeta.getDatabase(i);
    if (ci.getDatabaseType()==databaseType || databaseType<0)
    {
  	  wConnection.add(ci.getName());
    }
  }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:JobEntryDialog.java

示例8: setComboFields

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void setComboFields(CCombo c){
	c.removeAll();
	getPrevStepFields();
	if (prevStepFields!=null){
		prevStepFields.getFieldNames();
		for (int i=0;i<prevStepFields.getFieldNames().length;i++){	
			c.add(prevStepFields.getFieldNames()[i]);									
		}
	}	
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:11,代码来源:OGRFileOutputDialog.java

示例9: addDatabases

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void addDatabases(CCombo wConnection, int databaseType) {
  for (int i = 0; i < transMeta.nrDatabases(); i++) {
    DatabaseMeta ci = transMeta.getDatabase(i);
    if (ci.getDatabaseType()==databaseType || databaseType<0)
    {
  	  wConnection.add(ci.getName());
    }
  }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:BaseStepDialog.java

示例10: addDatabases

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void addDatabases(CCombo wConnection, Class<? extends DatabaseInterface> databaseType) {
  for (int i = 0; i < transMeta.nrDatabases(); i++) {
    DatabaseMeta ci = transMeta.getDatabase(i);
    if (databaseType==null || ci.getDatabaseInterface().getClass().equals(databaseType))
    {
  	  wConnection.add(ci.getName());
    }
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:10,代码来源:BaseStepDialog.java

示例11: appendRowToTable

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private static void appendRowToTable(Table table, List<String> stepIds) {

		TableItem[] tableItems = table.getItems();
		int cnt = 0;
		for (String stepId : stepIds) {

			// get element data
			TableItem tableItem = tableItems[cnt];
			Map<String, String> elementData = testData.get(stepId);
			String selectorChoice = selectorFromSWD
					.get(elementData.get("ElementSelectedBy"));

			String selectorValue = elementData
					.get(elementData.get("ElementSelectedBy"));

			// Append row into the TableEditor
			tableItem.setText(new String[] { elementData.get("ElementStepNumber"),
					elementData.get("ElementCodeName"), String.format("Action %d", cnt),
					selectorChoice, selectorValue });
			// some columns need to be converted to selects

			TableEditor keywordChoiceEditor = new TableEditor(table);
			CCombo keywordChoiceCombo = new CCombo(table, SWT.NONE);
			keywordChoiceCombo.setText("Choose..");
			for (String keyword : keywordTable.keySet()) {
				keywordChoiceCombo.add(keyword);
			}
			// NOTE: none of options is initially selected
			keywordChoiceEditor.grabHorizontal = true;
			int keywordChoiceColumn = 2;
			keywordChoiceCombo.setData("column", keywordChoiceColumn);
			keywordChoiceCombo.setData("item", tableItem);
			keywordChoiceEditor.setEditor(keywordChoiceCombo, tableItem,
					keywordChoiceColumn);
			keywordChoiceCombo.addModifyListener(new keywordChoiceListener());

			TableEditor selectorChoiceEditor = new TableEditor(table);
			CCombo selectorChoiceCombo = new CCombo(table, SWT.NONE);
			for (String locator : selectorFromSWD.values()) {
				selectorChoiceCombo.add(locator);
			}
			int currentSelector = new ArrayList<String>(selectorFromSWD.values())
					.indexOf(selectorFromSWD.get(elementData.get("ElementSelectedBy")));

			selectorChoiceCombo.select(currentSelector);
			selectorChoiceEditor.grabHorizontal = true;
			int selectorChoiceColumn = 3;
			selectorChoiceCombo.setData("item", tableItem);
			selectorChoiceCombo.setData("column", selectorChoiceColumn);
			selectorChoiceEditor.setEditor(selectorChoiceCombo, tableItem,
					selectorChoiceColumn);
			selectorChoiceCombo.addModifyListener(new selectorChoiceListener());
			cnt = cnt + 1;
		}
		return;
	}
 
开发者ID:sergueik,项目名称:SWET,代码行数:57,代码来源:TableEditorEx.java

示例12: setStepNames

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void setStepNames(CCombo combo){
		List<StepMeta> prevSteps = transMeta.findPreviousSteps(transMeta.findStep(stepname));
	for (StepMeta prevStep : prevSteps){
		combo.add(prevStep.getName());
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:7,代码来源:SpatialAnalysisDialog.java

示例13: editCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void editCombo(TableItem row, int rownr, int colnr)
{
	before_edit = getItemText(row);
	field_changed = false;
	ColumnInfo colinfo = columns[colnr-1];

       if (columns[colnr-1].isReadOnly() && columns[colnr-1].getSelectionAdapter()!=null) 
       {
           return;
       }
       
	combo   = new CCombo(table, colinfo.isReadOnly()?SWT.READ_ONLY:SWT.NONE );
       props.setLook(combo, Props.WIDGET_STYLE_TABLE);
	combo.addTraverseListener(lsTraverse);
	combo.addModifyListener(lsModCombo);
	combo.addFocusListener(lsFocusCombo);
	String opt[] = colinfo.getComboValues();
	if (colinfo.getComboValuesSelectionListener()!=null) {
		opt = colinfo.getComboValuesSelectionListener().getComboValues(row, rownr, colnr);
	}
	
	for (int i=0;i<opt.length;i++) combo.add(opt[i]);
	combo.setText(row.getText(colnr));
	if (lsMod!=null) combo.addModifyListener(lsMod);	
	combo.addModifyListener(lsUndo);
	String tooltip = colinfo.getToolTip();
	if (tooltip!=null) combo.setToolTipText(tooltip); else combo.setToolTipText("");			
	combo.setVisible(true);		
	combo.addKeyListener(lsKeyCombo);
       
       if (columns[colnr-1].getSelectionAdapter()!=null)
       {
           combo.addSelectionListener(columns[colnr-1].getSelectionAdapter());
       }

	editor.horizontalAlignment = SWT.LEFT;
	editor.layout();
       
	// Open the text editor in the correct column of the selected row.
	editor.setEditor (combo, row, colnr);
	combo.setFocus();

       combo.layout();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:45,代码来源:TableView.java

示例14: createExpressionValue

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo createExpressionValue( Composite parent )
{
	final CCombo expressionValue = new CCombo( parent, SWT.BORDER );
	expressionValue.add( CHOICE_SELECT_VALUE );
	expressionValue.addListener( SWT.Verify, expValueVerifyListener );
	expressionValue.addListener( SWT.Selection, expValueSelectionListener );
	Listener listener = new Listener( ) {

		public void handleEvent( Event event )
		{
			updateButtons( );
		}

	};
	expressionValue.addListener( SWT.Modify, listener );
	expressionValue.addListener( SWT.MouseDown, new Listener( ) {

		public void handleEvent( Event arg0 )
		{
			if ( isMeasureSelected( ) )
			{
				if ( expressionValue.getItemCount( ) > 0 )
				{
					expressionValue.remove( 0 );
				}
				expressionValue.setVisibleItemCount( 0 );
			}
			else
			{
				if ( expressionValue.getItemCount( ) == 0 )
				{
					expressionValue.add( CHOICE_SELECT_VALUE );
				}
				expressionValue.setVisibleItemCount( 1 );
			}
		}
	} );
	
	IExpressionButton ceb = ChartExpressionButtonUtil.createExpressionButton( parent,
			expressionValue,
			(ExtendedItemHandle) designHandle,
			expressionProvider );
	ceb.addListener( listener );

	return expressionValue;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:47,代码来源:ChartCubeFilterConditionBuilder.java

示例15: addDatabases

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void addDatabases(CCombo wConnection) {
  for (int i = 0; i < jobMeta.nrDatabases(); i++) {
    DatabaseMeta ci = jobMeta.getDatabase(i);
 wConnection.add(ci.getName());
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:7,代码来源:JobEntryDialog.java


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