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


Java CheckboxTableViewer.setSorter方法代码示例

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


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

示例1: createPartControl

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
/**
 * Callback to create the viewer and initialize it.
 */
public void createPartControl(Composite parent) {
	table = new Table(parent, SWT.CHECK | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION );
	viewer = new CheckboxTableViewer(table);
	ICheckStateListener listener = new CheckStateListener();
	viewer.addCheckStateListener(listener);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	qrSorter = new RowSorter(viewer, this);
	viewer.setSorter(qrSorter);
	String[] properties = setColumnHeaders();

	// define a property name for each column (which is the column header)
	viewer.setColumnProperties(properties);
	// define the cell editors for each column (only the business name and value column editors work)
	editors = editors(table, properties.length);
	viewer.setCellEditors(editors);
	// define how the editors get and change the values shown in the cells
	viewer.setCellModifier(new CellModifier());

	// make the actions that will be items on the menu of this view
	makeActions();

	// attach the menu to this view
	contributeToActionBars();
}
 
开发者ID:openmapsoftware,项目名称:mappingtools,代码行数:29,代码来源:FeatureView.java

示例2: createTableViewer

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
protected CheckboxTableViewer createTableViewer(Composite parent) {

			final CheckboxTableViewer result= CheckboxTableViewer.newCheckList(parent, SWT.BORDER | SWT.MULTI);
			result.addCheckStateListener(new ICheckStateListener() {
				public void checkStateChanged(CheckStateChangedEvent event) {
					GrayedCheckedModelElement element= (GrayedCheckedModelElement)event.getElement();
					result.setGrayed(element, false);
					if (event.getChecked()) {
						element.select();
					} else {
						element.deselect();
					}
					result.update(element, null);
				}
			});
			GridData data= new GridData(GridData.FILL_BOTH);
			data.heightHint= convertHeightInCharsToPixels(20);
			data.widthHint= convertWidthInCharsToPixels(50);
			result.getTable().setLayoutData(data);

			result.addFilter(new Filter());
			result.setLabelProvider(new GrayedCheckedModelLabelProvider());
			result.setSorter(new GrayedCheckModelElementSorter());
			result.setContentProvider(new GrayedCheckedModelContentProvider());

			result.setInput(fModel);
			result.setCheckedElements(fModel.getChecked());
			result.setGrayedElements(fModel.getGrayed());

			return result;
		}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:32,代码来源:ConfigureWorkingSetAssignementAction.java

示例3: createDialogArea

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
@Override
   protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);

container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);
/*
 * 
 * createFirstName(container); createLastName(container);
 */
table = new Table(container, SWT.CHECK | SWT.SINGLE | SWT.H_SCROLL
	| SWT.V_SCROLL | SWT.FULL_SELECTION);

String[] colLabels = getColumnLabels();
int columnWidth[] = getColumnWidth();
SortListener sortListener = new SortListener();
TableColumn[] cols = new TableColumn[colLabels.length];
for (int i = 0; i < colLabels.length; i++) {
    cols[i] = new TableColumn(table, SWT.NONE);
    cols[i].setWidth(columnWidth[i]);
    cols[i].setText(colLabels[i]);
    cols[i].setData(new Integer(i));
    cols[i].addSelectionListener(sortListener);
}
GridData gridDataTable = new GridData();
gridDataTable.horizontalAlignment = GridData.FILL;
gridDataTable.verticalAlignment = GridData.FILL;
gridDataTable.grabExcessHorizontalSpace = true;
gridDataTable.grabExcessVerticalSpace = true;
table.setLayoutData(gridDataTable);

table.setHeaderVisible(true);
table.setLinesVisible(true);

tableViewer = new CheckboxTableViewer(table);
tableViewer.setContentProvider(new ViewContentProvider());
tableViewer.setLabelProvider(new ViewLabelProvider());
tableViewer.setSorter(new Sorter());

tableViewer.setInput(this);

return area;
   }
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:47,代码来源:CstGroupSelectionDialog.java

示例4: createDialogArea

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
@Override
   protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);

container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);

table = new Table(container, SWT.CHECK | SWT.SINGLE | SWT.H_SCROLL
	| SWT.V_SCROLL | SWT.FULL_SELECTION);

String[] colLabels = getColumnLabels();
int columnWidth[] = getColumnWidth();
SortListener sortListener = new SortListener();
TableColumn[] cols = new TableColumn[colLabels.length];
for (int i = 0; i < colLabels.length; i++) {
    cols[i] = new TableColumn(table, SWT.NONE);
    cols[i].setWidth(columnWidth[i]);
    cols[i].setText(colLabels[i]);
    cols[i].setData(new Integer(i));
    cols[i].addSelectionListener(sortListener);
}
GridData gridDataTable = new GridData();
gridDataTable.horizontalAlignment = GridData.FILL;
gridDataTable.verticalAlignment = GridData.FILL;
gridDataTable.grabExcessHorizontalSpace = true;
gridDataTable.grabExcessVerticalSpace = true;
table.setLayoutData(gridDataTable);

table.setHeaderVisible(true);
table.setLinesVisible(true);

tableViewer = new CheckboxTableViewer(table);
tableViewer.setContentProvider(new ViewContentProvider());
tableViewer.setLabelProvider(new ViewLabelProvider());
tableViewer.setSorter(new PatientSorter());

tableViewer.setInput(this);

return area;
   }
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:44,代码来源:CstCopyProfileDialog.java

示例5: createDialogArea

import org.eclipse.jface.viewers.CheckboxTableViewer; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite area = (Composite) super.createDialogArea(parent);
	Composite container = new Composite(area, SWT.NONE);
	
	container.setLayoutData(new GridData(GridData.FILL_BOTH));
	GridLayout layout = new GridLayout(2, false);
	container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	container.setLayout(layout);
	/*
	 * 
	 * createFirstName(container); createLastName(container);
	 */
	table = new Table(container, SWT.CHECK | SWT.SINGLE | SWT.H_SCROLL
			| SWT.V_SCROLL | SWT.FULL_SELECTION);

	String[] colLabels = getColumnLabels();
	int columnWidth[] = getColumnWidth();
	SortListener sortListener = new SortListener();
	TableColumn[] cols = new TableColumn[colLabels.length];
	for (int i = 0; i < colLabels.length; i++) {
		cols[i] = new TableColumn(table, SWT.NONE);
		cols[i].setWidth(columnWidth[i]);
		cols[i].setText(colLabels[i]);
		cols[i].setData(new Integer(i));
		cols[i].addSelectionListener(sortListener);
	}
	GridData gridDataTable = new GridData();
	gridDataTable.horizontalAlignment = GridData.FILL;
	gridDataTable.verticalAlignment = GridData.FILL;
	gridDataTable.grabExcessHorizontalSpace = true;
	gridDataTable.grabExcessVerticalSpace = true;
	table.setLayoutData(gridDataTable);

	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	tableViewer = new CheckboxTableViewer(table);
	tableViewer.setContentProvider(new ViewContentProvider());
	tableViewer.setLabelProvider(new ViewLabelProvider());
	tableViewer.setSorter(new Sorter());

	tableViewer.setInput(this);

	return area;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:47,代码来源:CstLabItemSelectionDialog.java


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