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


Java CheckboxCellEditor类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.CheckboxCellEditor的典型用法代码示例。如果您正苦于以下问题:Java CheckboxCellEditor类的具体用法?Java CheckboxCellEditor怎么用?Java CheckboxCellEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createTableViewer

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
private void createTableViewer() {
	
	tableViewer = new TableViewer(table);
	tableViewer.setUseHashlookup(true);
	
	tableViewer.setColumnProperties(columnNames);
	
	// Create the cell editors
	CellEditor[] editors = new CellEditor[columnNames.length];
	
	// Column 1 : nothing
	editors[0] = null;
	// Columns 2 : checkbox
	editors[1] = new CheckboxCellEditor(table);
	
	// Assign the cell editors to the viewer 
	tableViewer.setCellEditors(editors);
	// Set the cell modifier for the viewer
	tableViewer.setCellModifier(new ExtensionCellModifier(this));
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:21,代码来源:ModuleTableViewer.java

示例2: createTableViewer

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
private void createTableViewer() {
	
	tableViewer = new TableViewer(table);
	tableViewer.setUseHashlookup(true);
	
	tableViewer.setColumnProperties(columnNames);
	
	// Create the cell editors
	CellEditor[] editors = new CellEditor[columnNames.length];
	
	// Column 1 : nothing
	editors[0] = null;
	// Columns 2,3,4 : checkboxes
	editors[1] = new CheckboxCellEditor(table);
	editors[2] = new CheckboxCellEditor(table);
	editors[3] = new CheckboxCellEditor(table);
	
	// Assign the cell editors to the viewer 
	tableViewer.setCellEditors(editors);
	// Set the cell modifier for the viewer
	tableViewer.setCellModifier(new ExtensionCellModifier(this));
	// Set the default sorter for the viewer 
	//tableViewer.setSorter(new ExtensionSorter(ExtensionSorter.NAME));
	
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:26,代码来源:ModuleTableViewer.java

示例3: createPropertyEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
public CellEditor createPropertyEditor(Composite parent)
{
	final Class type = getter.getReturnType();
	if (!type.isPrimitive() && type != String.class) return null;
	
	if (type == boolean.class) return new CheckboxCellEditor(parent);
	
	TextCellEditor editor = new TextCellEditor(parent);
	if (type == String.class) return editor;
	
	if (isNumeric(type))
	{
		editor.setValidator(new NumberValidator(type));
	}
	return editor;
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:18,代码来源:BeanPropertyDescriptor.java

示例4: setEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
private void setEditor(ICellModifier<T> modifier, int index) {
	switch (modifier.getCellEditingType()) {
	case TEXTBOX:
		if (modifier.getStyle() != SWT.NONE)
			editors[index] = new TextCellEditor(getComponent(), modifier.getStyle());
		else
			editors[index] = new TextCellEditor(getComponent());
		break;
	case COMBOBOX:
		editors[index] = new ComboEditor(getComponent(), new String[0]);
		break;
	case CHECKBOX:
		if (modifier.getStyle() != SWT.NONE)
			editors[index] = new CheckboxCellEditor(getComponent(), modifier.getStyle());
		else
			editors[index] = new CheckboxCellEditor(getComponent());
		break;
	default:
		break;
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:22,代码来源:ModifySupport.java

示例5: createPropertyEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
public CellEditor createPropertyEditor(Composite parent) {
	CellEditor editor = new CheckboxCellEditor(parent);
	if (getValidator() != null) {
		editor.setValidator(getValidator());
	}
	return editor;
}
 
开发者ID:NineWorlds,项目名称:xstreamer,代码行数:9,代码来源:CheckboxPropertyDescriptor.java

示例6: createTreeViewer

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected TreeViewer createTreeViewer(Composite parent) {
  TreeViewer result = super.createTreeViewer(parent);

  // Initialize the table.
  Tree tree = result.getTree();
  tree.setHeaderVisible(true);
  tree.setToolTipText("Node Display Properties");
  EditColTableDef.setupTree(TABLE_DEF, tree);

  // Configure cell editing.
  CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
  cellEditors[INDEX_NAME] = null;
  cellEditors[INDEX_SELECTED] = new CheckboxCellEditor(tree);
  cellEditors[INDEX_XPOS] = new TextCellEditor(tree);
  cellEditors[INDEX_YPOS] = new TextCellEditor(tree);
  cellEditors[INDEX_VISIBLE] = new CheckboxCellEditor(tree);
  cellEditors[INDEX_SIZE] = new ComboBoxCellEditor(
      tree, buildSizeOptions());
  cellEditors[INDEX_COLOR] = new ColorCellEditor(tree);

  result.setCellEditors(cellEditors);
  result.setLabelProvider(new PartLabelProvider());
  result.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
  result.setCellModifier(new PartCellModifier());

  return result;
}
 
开发者ID:google,项目名称:depan,代码行数:29,代码来源:NodeDisplayTableControl.java

示例7: EdgeMatcherTableControl

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public EdgeMatcherTableControl(Composite parent) {
  super(parent, SWT.NONE);
  setLayout(Widgets.buildContainerLayout(1));

  viewer = new TableViewer(this,
      SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);

  // Layout embedded table
  Table relationTable = viewer.getTable();
  relationTable.setLayoutData(Widgets.buildGrabFillData());

  // initialize the table
  relationTable.setHeaderVisible(true);
  relationTable.setToolTipText("Edge Matcher Definition");
  EditColTableDef.setupTable(TABLE_DEF, relationTable);

  CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
  cellEditors[INDEX_RELATION] = null;
  cellEditors[INDEX_FORWARD] = new CheckboxCellEditor(relationTable);
  cellEditors[INDEX_BACKWARD] = new CheckboxCellEditor(relationTable);

  // cell content
  viewer.setCellEditors(cellEditors);
  viewer.setLabelProvider(new CellLabelProvider());
  viewer.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
  viewer.setCellModifier(new CellModifier());
  viewer.setContentProvider(ArrayContentProvider.getInstance());

  viewer.setComparator(new AlphabeticSorter(new ViewerObjectToString() {

    @Override
    public String getString(Object object) {
        if (object instanceof Relation) {
          return ((Relation) object).toString();
        }
        return object.toString();
      }
    }));
}
 
开发者ID:google,项目名称:depan,代码行数:40,代码来源:EdgeMatcherTableControl.java

示例8: RelationSetTableControl

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public RelationSetTableControl(Composite parent) {
  super(parent, SWT.NONE);
  setLayout(Widgets.buildContainerLayout(1));

  // Layout embedded table
  relSetViewer = new TableViewer(this,
      SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);

  // Set up layout properties
  Table relSetTable = relSetViewer.getTable();
  relSetTable.setLayoutData(Widgets.buildGrabFillData());

  // initialize the table
  relSetTable.setHeaderVisible(true);
  relSetTable.setToolTipText("List of Relations");
  EditColTableDef.setupTable(TABLE_DEF, relSetTable);

  // Configure cell editing
  CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
  cellEditors[INDEX_NAME] = null;
  cellEditors[INDEX_SOURCE] = null;
  cellEditors[INDEX_VISIBLE] = new CheckboxCellEditor(relSetTable);

  // Configure table properties.
  relSetViewer.setCellEditors(cellEditors);
  relSetViewer.setLabelProvider(new ControlLabelProvider());
  relSetViewer.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
  relSetViewer.setCellModifier(new ControlCellModifier());
  relSetViewer.setContentProvider(ArrayContentProvider.getInstance());

  configSorters(relSetTable);
}
 
开发者ID:google,项目名称:depan,代码行数:33,代码来源:RelationSetTableControl.java

示例9: createPropertyEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public CellEditor createPropertyEditor(Composite parent)
{
  CellEditor editor = new CheckboxCellEditor(parent);
  if (getValidator() != null)
  {
    editor.setValidator(getValidator());
  }
  return editor;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:10,代码来源:CheckboxPropertyDescriptor.java

示例10: ParameterEditingSupport

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
public ParameterEditingSupport( ColumnViewer viewer, Map isSelectedMap )
{
	super( viewer );
	this.viewer = viewer;
	editor = new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY);
	this.selectedStatusMap = isSelectedMap;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:PromptParameterDialog.java

示例11: getCellEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected CellEditor getCellEditor(Object element) {
    if (this.column == PRIORITY_PROP) {
        this.editor = new TextCellEditor(this.viewer.getTable());
        editor.setValidator(new ICellEditorValidator() {

            @Override
            public String isValid(Object value) {
                boolean valid = true;
                if (!"".equals(value)) {
                    try {
                        int val = Integer.parseInt((String) value);
                        if (val <= 0) {
                            valid = false;
                        }
                    } catch (NumberFormatException | ClassCastException e) {
                        valid = false;
                    }
                }
                editor.getControl()
                        .setBackground(valid ? null : Display.getDefault().getSystemColor(SWT.COLOR_RED));
                return (valid ? null : "positive integer required");
            }
        });
        ((Text) ((TextCellEditor) editor).getControl()).selectAll();
    } else if (this.column == PREEMPT_PROP) {
        this.editor = new CheckboxCellEditor(viewer.getTable());
    }
    return this.editor;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:31,代码来源:PyEditorHoverConfigurationBlock.java

示例12: createDialogArea

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new FillLayout());
	FormToolkit toolkit = new FormToolkit(Display.getCurrent());
	Section selectObjectSection = toolkit.createSection(container, ExpandableComposite.TITLE_BAR
			| ExpandableComposite.FOCUS_TITLE);
	selectObjectSection.setText(selectProvider ? M.SelectProviders : M.SelectRecipients);
	Composite composite = toolkit.createComposite(selectObjectSection, SWT.NONE);
	UI.gridLayout(composite, 1);
	selectObjectSection.setClient(composite);
	toolkit.adapt(composite);
	viewer = Tables.createViewer(composite, LABELS.ALL);
	viewer.setLabelProvider(new ConnectionLabelProvider(this));
	Table table = viewer.getTable();
	createInternalModel();
	if (availableConnections.size() > 0)
		viewer.setInput(availableConnections.toArray(new AvailableConnection[availableConnections.size()]));
	CellEditor[] editors = new CellEditor[5];
	editors[1] = new CheckboxCellEditor(table);
	editors[2] = new CheckboxCellEditor(table);
	viewer.setColumnProperties(LABELS.ALL);
	viewer.setCellModifier(new ConnectionCellModifier(this));
	viewer.setCellEditors(editors);
	toolkit.paintBordersFor(composite);
	return container;
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:28,代码来源:ConnectionDialog.java

示例13: getCellEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
public CellEditor getCellEditor(AvroNode node, ColumnViewer viewer) {
	return new CheckboxCellEditor((Composite) viewer.getControl());
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:5,代码来源:EditingSupportFactory.java

示例14: getCellEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected CellEditor getCellEditor(Object element) {
	return new CheckboxCellEditor(viewer.getTable(), SWT.CHECK);
}
 
开发者ID:Pardus-LiderAhenk,项目名称:lider-ahenk-installer,代码行数:5,代码来源:EnableEditingSupport.java

示例15: getCellEditor

import org.eclipse.jface.viewers.CheckboxCellEditor; //导入依赖的package包/类
@Override
protected CellEditor getCellEditor(final Object element) {
	return new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY);

}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:6,代码来源:ImportEditingSupport.java


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