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


Java CCombo.getText方法代码示例

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


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

示例1: 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

示例2: insertControlContents

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void insertControlContents(Control control, String text,
		int cursorPosition) {
	CCombo combo = (CCombo) control;
	String contents = combo.getText();
	Point selection = combo.getSelection();
	StringBuffer sb = new StringBuffer();
	sb.append(contents.substring(0, selection.x));
	sb.append(text);
	if (selection.y < contents.length()) {
		sb.append(contents.substring(selection.y, contents.length()));
	}
	combo.setText(sb.toString());
	selection.x = selection.x + cursorPosition;
	selection.y = selection.x;
	combo.setSelection(selection);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:17,代码来源:CComboContentAdapter.java

示例3: getInsertionBounds

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public Rectangle getInsertionBounds(Control control) {
	// This doesn't take horizontal scrolling into affect. 
	// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=204599
	CCombo combo = (CCombo) control;
	int position = combo.getSelection().y;
	String contents = combo.getText();
	GC gc = new GC(combo);
	gc.setFont(combo.getFont());
	Point extent = gc.textExtent(contents.substring(0, Math.min(position,
			contents.length())));
	gc.dispose();
	if (COMPUTE_TEXT_USING_CLIENTAREA) {
		return new Rectangle(combo.getClientArea().x + extent.x, combo
			.getClientArea().y, 1, combo.getClientArea().height);
	}
	return new Rectangle(extent.x, 0, 1, combo.getSize().y);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:CComboContentAdapter.java

示例4: keyPressed

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void keyPressed(KeyEvent e) {
    if (e.keyCode == UICoreConstant.UMLSECTION_CONSTANTS__KEYCODE_ENTER
        || e.keyCode == UICoreConstant.UMLSECTION_CONSTANTS__KEYCODE_ENTER_SECOND) {
        CCombo combo = (CCombo) e.getSource();
        String text = combo.getText();

        try {
            final int value = new Integer(text).intValue();
            final Property property = this.property;
            if (value > 0) {

                DomainUtil.run(new TransactionalAction() {
                    @Override
                    public void doExecute() {
                        property.setLower(value);
                        property.setUpper(value);
                    }
                });
            }
        } catch (Exception e2) {
            // TODO: handle exception
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:25,代码来源:AssociationGeneralSection.java

示例5: focusLost

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public void focusLost(FocusEvent e) {
    CCombo combo = (CCombo) e.getSource();
    String text = combo.getText();

    try {
        final int value = new Integer(text).intValue();
        final Property property = this.property;
        if (value > 0) {

            DomainUtil.run(new TransactionalAction() {
                @Override
                public void doExecute() {
                    property.setLower(value);
                    property.setUpper(value);
                }
            });
        }
    } catch (Exception e2) {
        // TODO: handle exception
    }

}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:AssociationGeneralSection.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: doSetFocus

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
@Override
public void doSetFocus() {
	final CCombo combo = (CCombo)getControl();
	if (!combo.isDisposed()) {
		String text = combo.getText();
		if (text.length() == 0 && CommonUtils.isWSCocoa()) {
			combo.getDisplay().timerExec(1000, new Runnable() {
				@Override
				public void run() {
					focusIt(combo);
				}
			});
		} else {
			focusIt(combo);
		}
	}	
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:18,代码来源:EReferenceCellEditor.java

示例8: createComboCommand

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
/**
     * DOC nrousseau Comment method "createComboCommand".
     * 
     * @param source
     * @return
     */
    private PropertyChangeCommand createComboCommand(CCombo combo) {
        String paramName = (String) combo.getData(PARAMETER_NAME);

        IElementParameter param = elem.getElementParameter(paramName);

        String value = combo.getText();

//        for (int j = 0; j < param.getListItemsValue().length; j++) {
//            if (combo.getText().equals(param.getListItemsDisplayName()[j])) {
//                value = (String) param.getListItemsValue()[j];
//            }
//        }
        if (value.equals(param.getValue())) {
            return null;
        }

        return new PropertyChangeCommand(elem, paramName, value);
    }
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:25,代码来源:RouteResourceController.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, "HazelcastInputDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "HazelcastInputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-hazelcast-plugin,代码行数:23,代码来源:HazelcastInputDialog.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, "HazelcastOutputDialog.FailedToGetFields.DialogTitle" ),
      BaseMessages.getString( PKG, "HazelcastOutputDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
开发者ID:mattyb149,项目名称:pdi-hazelcast-plugin,代码行数:23,代码来源:HazelcastOutputDialog.java

示例11: 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

示例12: 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

示例13: 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

示例14: modify

import org.eclipse.swt.custom.CCombo; //导入方法依赖的package包/类
public boolean modify( Object data, String property, Object value )
		throws NameException, SemanticException
{
	int index = Arrays.asList( columnNames ).indexOf( property );
	String key = columnKeys[index];

	String strValue;
	if ( value instanceof Integer )
	{
		int intValue = ( (Integer) value ).intValue( );
		if ( intValue == -1 )
		{
			CCombo combo = (CCombo) editors[index].getControl( );
			strValue = combo.getText( );
		}
		else
		{
			String[] choices = modelAdapter.getChoiceSet( input.get( 0 ),
					columnKeys[index] );
			strValue = choices[intValue];
		}
	}
	else
		strValue = (String) value;
	return modelAdapter.setStringValue( input.get( 0 ), data, key, strValue );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:GroupHandleProvider.java

示例15: 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


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