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


Java CCombo.setItems方法代码示例

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


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

示例1: createControl

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
protected Control createControl() {
  m_Combo = new CCombo(m_Table, SWT.READ_ONLY);
  m_Combo.setBackground(Display.getCurrent().getSystemColor(
      SWT.COLOR_LIST_BACKGROUND));
  if (m_Items != null)
    m_Combo.setItems(m_Items);
  m_Combo.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  /*
   * m_Combo.addTraverseListener(new TraverseListener() { public void
   * keyTraversed(TraverseEvent arg0) { onTraverse(arg0); } });
   */
  return m_Combo;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:KTableCellEditorCombo.java

示例2: addComboInTable

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo addComboInTable(TableViewer tableViewer, TableItem tableItem, String comboName, String comboPaneName, 
		String editorName, int columnIndex,	String[] relationalOperators, SelectionListener dropDownSelectionListener,
		ModifyListener modifyListener,FocusListener focusListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final CCombo combo = new CCombo(buttonPane, SWT.NONE);
	combo.setItems(relationalOperators);
	combo.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(comboName, combo);
	tableItem.setData(comboPaneName, buttonPane);
	combo.addSelectionListener(dropDownSelectionListener);
	combo.addModifyListener(modifyListener);
	combo.addFocusListener(focusListener);
	new AutoCompleteField(combo, new CComboContentAdapter(), combo.getItems());
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	combo.setData(editorName, editor);
	return combo;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:FilterConditionsDialog.java

示例3: getFieldNameModifyListener

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
 * Gets the field name modify listener.
 * 
 * @param tableViewer
 *            the table viewer
 * @param conditionsList
 *            the conditions list
 * @param fieldsAndTypes
 *            the fields and types
 * @param fieldNames
 *            the field names
 * @param saveButton
 *            the save button
 * @param displayButton
 *            the display button
 * @return the field name modify listener
 */
public ModifyListener getFieldNameModifyListener(final TableViewer tableViewer, final List<Condition> conditionsList,
		final Map<String, String> fieldsAndTypes, final String[] fieldNames, final Button saveButton, final Button displayButton) {
	ModifyListener listener = new ModifyListener() {
		
		@Override
		public void modifyText(ModifyEvent e) {
			CCombo source = (CCombo) e.getSource();
			int index = (int) source.getData(FilterConstants.ROW_INDEX);
			Condition filterConditions = conditionsList.get(index);
			String fieldName = source.getText();
			filterConditions.setFieldName(fieldName);
			
			if(StringUtils.isNotBlank(fieldName)){
				String fieldType = fieldsAndTypes.get(fieldName);
				TableItem item = tableViewer.getTable().getItem(index);
				CCombo conditionalCombo = (CCombo) item.getData(FilterConditionsDialog.CONDITIONAL_OPERATORS);
				if(conditionalCombo != null && StringUtils.isNotBlank(fieldType)){
					conditionalCombo.setText(filterConditions.getConditionalOperator());
					conditionalCombo.setItems(FilterHelper.INSTANCE.getTypeBasedOperatorMap().get(fieldType));
					new AutoCompleteField(conditionalCombo, new CComboContentAdapter(), conditionalCombo.getItems());
				}
			}
			validateCombo(source);
			toggleSaveDisplayButton(conditionsList, fieldsAndTypes, fieldNames, saveButton, displayButton);
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:46,代码来源:FilterHelper.java

示例4: createCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
protected CCombo createCombo(Composite parent, String label, IJSONPath path, String[] values, String defaultValue) {
	FormToolkit toolkit = getToolkit();
	Composite composite = toolkit.createComposite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	GridLayout layout = new GridLayout(2, false);
	layout.marginWidth = 0;
	layout.marginBottom = 0;
	layout.marginTop = 0;
	layout.marginHeight = 0;
	layout.verticalSpacing = 0;
	composite.setLayout(layout);

	toolkit.createLabel(composite, label);

	CCombo combo = new CCombo(composite, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
	combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	combo.setItems(values);
	toolkit.adapt(combo, true, false);

	bind(combo, path, defaultValue);
	return combo;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:23,代码来源:AbstractFormPage.java

示例5: createMatchModeCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void createMatchModeCombo(Composite parent) {
    // draw label
    Label comboLabel = new Label(parent,SWT.LEFT);
    comboLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    comboLabel.setText(LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.label")); //$NON-NLS-1$
    // draw combo
    matchModeCombo = new CCombo(parent,SWT.BORDER);
    matchModeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    matchModeCombo.setEditable(false);
    String[] matchModes = {LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.entry.find"), LogViewerPlugin.getResourceString("preferences.ruleseditor.dialog.matchmode.entry.match")};
    matchModeCombo.setItems(matchModes);
    if(edit) {
        String[] items = matchModeCombo.getItems();
        for(int i = 0 ; i < items.length ; i++) {
            if(items[i].toLowerCase().indexOf(this.data.getMatchMode())!=-1) {
            	matchModeCombo.select(i);
                return;
            }
        }
    }
}
 
开发者ID:anb0s,项目名称:LogViewer,代码行数:22,代码来源:RuleDialog.java

示例6: PopulateFields

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void PopulateFields( CCombo cc ) {
  if ( cc.isDisposed() ) {
    return;
  }
  try {
    String initValue = cc.getText();
    cc.removeAll();
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      cc.setItems( r.getFieldNames() );
    }
    if ( !Const.isEmpty( initValue ) ) {
      cc.setText( initValue );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "XsltDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "XsltDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
开发者ID:griddynamics,项目名称:xml-dom-kettle-etl-plugin,代码行数:22,代码来源:DOMXsltDialog.java

示例7: getFieldsInto

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void getFieldsInto( CCombo fieldCombo ) {
  try {
    if ( !gotPreviousFields ) {
      previousFields = transMeta.getPrevStepFields( stepname );
    }

    String field = fieldCombo.getText();

    if ( previousFields != null ) {
      fieldCombo.setItems( previousFields.getFieldNames() );
    }

    if ( field != null ) {
      fieldCombo.setText( field );
    }
    gotPreviousFields = true;

  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "HazelcastInputDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "HazelcastInputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-hazelcast-plugin,代码行数:23,代码来源:HazelcastInputDialog.java

示例8: getFieldsInto

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void getFieldsInto( CCombo fieldCombo ) {
  try {
    if ( !gotPreviousFields ) {
      previousFields = transMeta.getPrevStepFields( stepname );
    }

    String field = fieldCombo.getText();

    if ( previousFields != null ) {
      fieldCombo.setItems( previousFields.getFieldNames() );
    }

    if ( field != null ) {
      fieldCombo.setText( field );
    }
    gotPreviousFields = true;

  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "HazelcastOutputDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "HazelcastOutputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-hazelcast-plugin,代码行数:23,代码来源:HazelcastOutputDialog.java

示例9: getFieldsInto

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void getFieldsInto( CCombo fieldCombo ) {
  try {
    if ( !gotPreviousFields ) {
      previousFields = transMeta.getPrevStepFields( stepname );
    }

    String field = fieldCombo.getText();

    if ( previousFields != null ) {
      fieldCombo.setItems( previousFields.getFieldNames() );
    }

    if ( field != null )
      fieldCombo.setText( field );
    gotPreviousFields = true;

  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "MemcachedInputDialog.FailedToGetFields.DialogTitle" ),
        BaseMessages.getString( PKG, "MemcachedInputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-memcached-plugin,代码行数:22,代码来源:MemcachedInputDialog.java

示例10: getFieldsInto

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void getFieldsInto( CCombo fieldCombo ) {
  try {
    if ( !gotPreviousFields ) {
      previousFields = transMeta.getPrevStepFields( stepname );
    }

    String field = fieldCombo.getText();

    if ( previousFields != null ) {
      fieldCombo.setItems( previousFields.getFieldNames() );
    }

    if ( field != null )
      fieldCombo.setText( field );
    gotPreviousFields = true;

  } catch ( KettleException ke ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "MemcachedOutputDialog.FailedToGetFields.DialogTitle" ),
        BaseMessages.getString( PKG, "MemcachedOutputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-memcached-plugin,代码行数:22,代码来源:MemcachedOutputDialog.java

示例11: PopulateFields

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void PopulateFields(CCombo cc)
{
 if(cc.isDisposed()) return;
 try{
	String initValue=cc.getText();
	cc.removeAll();
	RowMetaInterface r = transMeta.getPrevStepFields(stepname);
	if (r!=null) {
            cc.setItems(r.getFieldNames());
	}
	if(!Const.isEmpty(initValue)) cc.setText(initValue);
 }catch(KettleException ke){
		new ErrorDialog(shell, BaseMessages.getString(PKG, "XsltDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "XsltDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
	}
 
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:17,代码来源:XsltDialog.java

示例12: createLabelledCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo createLabelledCombo(Composite content, String slabel) {

		Label label = new Label(content, SWT.NONE);
		label.setBackground(content.getDisplay().getSystemColor(SWT.COLOR_WHITE));
		label.setText("    "+slabel+" ");
		label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true));

		CCombo ret = new CCombo(content, SWT.READ_ONLY|SWT.BORDER);
		ret.setItems(getNames());
		GridData fill = new GridData(SWT.FILL, SWT.CENTER, true, true);
		fill.widthHint=100;
		ret.setLayoutData(fill);

		return ret;
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:16,代码来源:AxesCellEditor.java

示例13: createTopComposite

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private void createTopComposite(Composite main_composite) {
	top_composite = new Composite(main_composite, SWT.NONE);
	top_composite.setLayout(new GridLayout(4, false));
	GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1);
	gd_composite_1.heightHint = 45;
	top_composite.setLayoutData(gd_composite_1);

	Label applyAllLabel = new Label(top_composite, SWT.NONE);
	applyAllLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	applyAllLabel.setText(Messages.REMAINING_FIELDS);
	applyAllLabel.setToolTipText(Messages.REMAINING_FIELDS_TOOLTIP);

	combo = new CCombo(top_composite, SWT.NONE);
	GridData gd_combo = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
	gd_combo.widthHint = 143;
	combo.setLayoutData(gd_combo);
	draggedFields.add(0,"Select");
	combo.setItems(convertToArray(draggedFields));
	combo.select(0);
	
	Composite composite_2 = new Composite(top_composite, SWT.NONE);
	composite_2.setLayout(new GridLayout(3, false));
	composite_2.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true, 1, 1));

	deleteButton = new Button(composite_2, SWT.NONE);
	deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, false, 1, 1));
	deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry()); 
	attachDeleteButtonListener(deleteButton);

	deleteButton.setEnabled(false);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:ExcelFormattingDialog.java

示例14: createLogLevelGroup

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
 * @param logLevel 
 * 
 */
private void createLogLevelGroup(String logLevel) {
	
	HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
	
	hydroGroup.setHydroGroupText(Messages.LOG_LEVEL_PREF_MESSAGE);
	hydroGroup.setLayout(new GridLayout(1, false));
	hydroGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	hydroGroup.getHydroGroupClientArea().setLayout(new GridLayout(2, false));
	
	Label label = new Label(hydroGroup.getHydroGroupClientArea(), SWT.NONE);
	
	label.setText(Messages.LOG_LEVEL_CONSOLE_PREF_MESSAGE);
	
	ccLogLevels=new CCombo(hydroGroup.getHydroGroupClientArea(), SWT.BORDER);
	GridData gd_ccLogLevels = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_ccLogLevels.widthHint = 300;
	if(OSValidator.isMac()){
		gd_ccLogLevels.heightHint=20;
	}
	ccLogLevels.setLayoutData(gd_ccLogLevels);
	
	ccLogLevels.setItems(Messages.COMBO_LOG_LEVELS.split(HASH_REGEX));
	
	ccLogLevels.setText(logLevel);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:31,代码来源:JobRunPreferenceComposite.java

示例15: createCCombo

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
private CCombo createCCombo(Composite parent, String[] values, TabbedPropertySheetWidgetFactory factory, Control top) {
  CCombo combo = factory.createCCombo(parent, SWT.NONE);
  combo.setItems(values);
  FormData data = new FormData();
  data.left = new FormAttachment(0, 160);
  data.right = new FormAttachment(100, 0);
  if(top == null) {
    data.top = new FormAttachment(0, VSPACE);
  } else {
    data.top = new FormAttachment(top, VSPACE);
  }
  combo.setLayoutData(data);
  combo.addFocusListener(listener);
  return combo;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:16,代码来源:PropertyUserTaskSection.java


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