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


Java ComboBoxCellEditor.setStyle方法代碼示例

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


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

示例1: setupCellEditors

import org.eclipse.jface.viewers.ComboBoxCellEditor; //導入方法依賴的package包/類
private void setupCellEditors(final Table table) {
	final ComboBoxCellEditor editor= new ComboBoxCellEditor();
	editor.setStyle(SWT.READ_ONLY);
	fTableViewer.setCellEditors(new CellEditor[] { null, editor});
	fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {

		public void selectionChanged(final SelectionChangedEvent event) {
			if (editor.getControl() == null & !table.isDisposed())
				editor.create(table);
			final ISelection sel= event.getSelection();
			if (!(sel instanceof IStructuredSelection))
				return;
			final IStructuredSelection structured= (IStructuredSelection) sel;
			if (structured.size() != 1)
				return;
			final MemberActionInfo info= (MemberActionInfo) structured.getFirstElement();
			editor.setItems(info.getAllowedLabels());
			editor.setValue(new Integer(info.getAction()));
		}
	});

	final ICellModifier cellModifier= new MemberActionCellModifier();
	fTableViewer.setCellModifier(cellModifier);
	fTableViewer.setColumnProperties(new String[] { MEMBER_PROPERTY, ACTION_PROPERTY});
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:26,代碼來源:PullUpMemberPage.java

示例2: setupCellEditors

import org.eclipse.jface.viewers.ComboBoxCellEditor; //導入方法依賴的package包/類
private void setupCellEditors(final Table table) {
	final ComboBoxCellEditor comboBoxCellEditor= new ComboBoxCellEditor();
	comboBoxCellEditor.setStyle(SWT.READ_ONLY);
	fTableViewer.setCellEditors(new CellEditor[] { null, comboBoxCellEditor});
	fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {

		public void selectionChanged(final SelectionChangedEvent event) {
			if (comboBoxCellEditor.getControl() == null & !table.isDisposed())
				comboBoxCellEditor.create(table);
			Assert.isTrue(event.getSelection() instanceof IStructuredSelection);
			final IStructuredSelection ss= (IStructuredSelection) event.getSelection();
			if (ss.size() != 1)
				return;
			final MemberActionInfo mac= (MemberActionInfo) ss.getFirstElement();
			comboBoxCellEditor.setItems(MemberActionInfoLabelProvider.getAvailableActionLabels(mac));
			comboBoxCellEditor.setValue(new Integer(mac.getAction()));
		}
	});

	final ICellModifier cellModifier= new PushDownCellModifier();
	fTableViewer.setCellModifier(cellModifier);
	fTableViewer.setColumnProperties(new String[] { MEMBER_PROPERTY, ACTION_PROPERTY});
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:24,代碼來源:PushDownWizard.java

示例3: getCellEditor

import org.eclipse.jface.viewers.ComboBoxCellEditor; //導入方法依賴的package包/類
@Override
  protected CellEditor getCellEditor(Object element)
  {
DataVariable var = (DataVariable) element;
switch(m_forItem)
{
case VALUE:
    return new TextCellEditor(m_viewer.getTable());
case CONFIRM:
	if (var.isTyped())
	{
		String[] confirm = new String[2];
		confirm[0] = "True";
		confirm[1] = "False";
		ComboBoxCellEditor editor = new ComboBoxCellEditor(m_viewer.getTable(), confirm);
		editor.setStyle( SWT.READ_ONLY );
		if (var.getConfirmGet().equals("True"))
		{
			editor.setValue(0);
		}
		else
		{
			editor.setValue(1);
		}
		return editor;
	}
}
return null;
  }
 
開發者ID:Spacecraft-Code,項目名稱:SPELL,代碼行數:30,代碼來源:VariableEditSupport.java


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