當前位置: 首頁>>代碼示例>>Java>>正文


Java CCombo.setFocus方法代碼示例

本文整理匯總了Java中org.eclipse.swt.custom.CCombo.setFocus方法的典型用法代碼示例。如果您正苦於以下問題:Java CCombo.setFocus方法的具體用法?Java CCombo.setFocus怎麽用?Java CCombo.setFocus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.custom.CCombo的用法示例。


在下文中一共展示了CCombo.setFocus方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createMultiValueExpressionButton

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
private void createMultiValueExpressionButton( Composite parent,
		final CCombo combo )
{
	Listener listener = new Listener( ) {

		public void handleEvent( Event event )
		{
			addBtn.setEnabled( false );

			boolean change = false;

			Expression expression = ExpressionButtonUtil.getExpression( combo );
			if ( expression == null
					|| expression.getStringExpression( ).trim( ).length( ) == 0 )
				return;
			if ( valueList.indexOf( expression ) < 0 )
			{
				valueList.add( expression );
				change = true;
			}

			if ( change )
			{
				tableViewer.refresh( );
				updateButtons( );
				combo.setFocus( );
				combo.setText( "" );
			}
		}
	};

	ExpressionButtonUtil.createExpressionButton( parent,
			combo,
			getCrosstabExpressionProvider( ),
			designHandle,
			listener );

}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:39,代碼來源:CrosstabFilterConditionBuilder.java

示例2: focusIt

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
private void focusIt(final CCombo combo) {
	if (!combo.isDisposed()) {
		combo.setFocus();
		combo.setListVisible(true);
	}
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:7,代碼來源:EReferenceCellEditor.java

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

示例4: selectMultiValues

import org.eclipse.swt.custom.CCombo; //導入方法依賴的package包/類
private void selectMultiValues( CCombo CCombo )
{
	String[] retValue = null;

	List selectValueList = getSelectedValueList( );
	if ( selectValueList == null || selectValueList.size( ) == 0 )
	{
		MessageDialog.openInformation( null,
				Messages.getString( "SelectValueDialog.selectValue" ), //$NON-NLS-1$
				Messages.getString( "SelectValueDialog.messages.info.selectVauleUnavailable" ) ); //$NON-NLS-1$

	}
	else
	{
		SelectValueDialog dialog = new SelectValueDialog( PlatformUI.getWorkbench( )
				.getDisplay( )
				.getActiveShell( ),
				Messages.getString( "ExpressionValueCellEditor.title" ) ); //$NON-NLS-1$
		dialog.setSelectedValueList( selectValueList );
		dialog.setMultipleSelection( true );
		if ( dialog.open( ) == IDialogConstants.OK_ID )
		{
			retValue = dialog.getSelectedExprValues( );
		}
	}

	if ( retValue != null )
	{
		addBtn.setEnabled( false );

		if ( retValue.length == 1 )
		{
			CCombo.setText( DEUtil.resolveNull( retValue[0] ) );
		}
		else if ( retValue.length > 1 )
		{
			CCombo.setText( "" ); //$NON-NLS-1$
		}

		boolean change = false;
		List strValues = new ArrayList( );
		for ( int i = 0; i < valueList.size( ); i++ )
		{
			strValues.add( ( (Expression) valueList.get( i ) ).getStringExpression( ) );
		}
		for ( int i = 0; i < retValue.length; i++ )
		{
			if ( strValues.indexOf( DEUtil.resolveNull( retValue[i] ) ) < 0 )
			{
				valueList.add( new Expression( DEUtil.resolveNull( retValue[i] ),
						ExpressionButtonUtil.getExpressionButton( CCombo )
								.getExpressionHelper( )
								.getExpressionType( ) ) );
				change = true;
			}
		}
		if ( change )
		{
			tableViewer.refresh( );
			updateButtons( );
			CCombo.setFocus( );
		}
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:65,代碼來源:CrosstabFilterConditionBuilder.java

示例5: 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 (colinfo.isReadOnly() && colinfo.getSelectionAdapter()!=null) 
       {
           return;
       }
       
       if (colinfo.getDisabledListener()!=null) {
       	boolean disabled = colinfo.getDisabledListener().isFieldDisabled(rownr);
       	if (disabled) 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[] = getComboValues(row, colinfo);
	
	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 (colinfo.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:yintaoxue,項目名稱:read-open-source-code,代碼行數:52,代碼來源:TableView.java


注:本文中的org.eclipse.swt.custom.CCombo.setFocus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。