本文整理匯總了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});
}
示例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});
}
示例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;
}