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


Java CCombo.addTraverseListener方法代碼示例

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


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

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

示例2: 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.addTraverseListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。