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


Java Table类代码示例

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


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

示例1: createViewer

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
protected TableViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout, final int style) {
	final TableViewer viewer = new TableViewer(parent, style);
	final Table table = viewer.getTable();
	table.setLinesVisible(linesVisible);
	table.setHeaderVisible(headerVisible);

	int columnIndex = 0;
	for (final String columnLabel : columnLabels) {

		final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, NONE);
		final TableColumn column = viewerColumn.getColumn();
		columnLayout.setColumnData(column, createColumnLayoutData(columnIndex));
		column.setText(columnLabel);
		column.setMoveable(moveable);

		columnIndex++;
	}

	return viewer;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:22,代码来源:TableViewerBuilder.java

示例2: createTableSection

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
protected Section createTableSection(ScrolledForm form, Composite client, FormToolkit toolkit, String title,
        Image image, int sectionStyle, int tableStyle, String[] columnTitles, int[] columnAlignments) {

    Section section = createSection(form, client, toolkit, title, image, sectionStyle);
    Table table = toolkit.createTable(section, tableStyle);

    for (int i = 0; i < columnTitles.length; i++) {
        TableColumn column = new TableColumn(table, SWT.NONE);
        column.setText(columnTitles[i]);
        column.setAlignment(columnAlignments[i]);
    }

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

    section.setClient(table);

    return section;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:20,代码来源:DataModelFormPage.java

示例3: selectAllInTable

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
private void selectAllInTable(TableViewer debugDataViewer, TableCursor tableCursor){
	Table table = debugDataViewer.getTable();
	TableItem[] tableItems = table.getItems();
	int recordCount = 0;
	
	for(int rowIndex = 0; rowIndex < tableItems.length; rowIndex++){
		TableItem tableItem = tableItems[rowIndex];
		for(int colIndex = 1; colIndex <= table.getColumnCount(); colIndex++){
			if(StringUtils.containsIgnoreCase(tableItem.getText(colIndex), findText.getText())){
				label.setVisible(false);
				tableItem.setBackground(colIndex, Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY));
				recordCount++;
			}
		}
		findColIndex=1;
	}
	
	findRowIndex = 0;
	findColIndex = 0;
	
	if(recordCount > 0){
		label.setVisible(true);
		label.setText("Match count - " + recordCount);
	}else{ label.setVisible(false); }
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:FindViewDataDialog.java

示例4: packTable

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
public void packTable(Table table) {
    table.pack();

    TableColumn[] columns = table.getColumns();
    int[] columnWidths = getColumnWidths();
    for (int i = 0; i < columns.length; i++) {

        int columnWidth = columnWidths[i];
        if (columnWidth == SWT.DEFAULT) {
            columns[i].pack();
        }
        else {
            columns[i].setWidth(columnWidth);
        }
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:18,代码来源:BaseElementType.java

示例5: fixLayout

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
private void fixLayout() {

        Table table = getTable();

        // HACK to get the removed item to disappear.
        table.pack();
        layout(true);

        int[] columnWidths = TABLE_COLUMN_WIDTHS;
        TableColumn[] columns = table.getColumns();
        for (int i = 0; i < columns.length; i++) {

            if (columnWidths == null) {
                columns[i].pack();
            }
            else {
                int columnWidth = columnWidths[i];
                if (columnWidth == SWT.DEFAULT) {
                    columns[i].pack();
                }
                else {
                    columns[i].setWidth(columnWidth);
                }
            }
        }
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:27,代码来源:ZnodeAclComposite.java

示例6: createCellEditorList

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
public CellEditor[] createCellEditorList(Table table,
		Map<String, Integer> columns) {
	CellEditor[] cellEditor = createCellEditor(columns.size());
	addTextEditor(table, cellEditor, columns, (Messages.FIELDNAME));
	addComboBox(table, cellEditor, getDataTypeKey(), 1);
	addTextEditor(table, cellEditor, columns, Messages.DATEFORMAT);
	addTextEditor(table, cellEditor, columns, Messages.PRECISION);
	addTextEditor(table, cellEditor, columns, Messages.SCALE);
	addComboBox(table, cellEditor, getScaleTypeKey(), 5);
	addTextEditor(table, cellEditor, columns, Messages.FIELD_DESCRIPTION);
	addTextEditor(table, cellEditor, columns, Messages.LENGTH);
	addTextEditor(table, cellEditor, columns, Messages.RANGE_FROM);
	addTextEditor(table, cellEditor, columns, Messages.RANGE_TO);
	addTextEditor(table, cellEditor, columns, Messages.DEFAULT_VALUE);
	return cellEditor;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:GenerateRecordsGridWidgetBuilder.java

示例7: createModelFormContent

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {
    final ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();

    _EditSection = createEditSection(form, client, toolkit);
    GridData editSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _EditSection.setLayoutData(editSectionGridData);

    _PropertiesSection = createPropertiesTableSection(form, client, toolkit);
    GridData propertiesSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _PropertiesSection.setLayoutData(propertiesSectionGridData);

    _ZnodeSection = createZnodeSection(form, client, toolkit);
    GridData znodeSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _ZnodeSection.setLayoutData(znodeSectionGridData);

    Table propertiesSectionTable = getPropertiesSectionTable();
    initTableEdit(propertiesSectionTable, null, 1);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:21,代码来源:ZooKeeperConnectionModelMainFormPage.java

示例8: createTableColumns

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
protected void createTableColumns() {
    Table table = getTable();
    if (table == null) {
        return;
    }

    String[] titles = getTableColumnTitles();
    if (titles != null && titles.length > 0) {

        int[] columnAlignments = getTableColumnAlignments();

        for (int i = 0; i < titles.length; i++) {
            TableColumn column = new TableColumn(table, SWT.NONE);
            column.setText(titles[i]);

            if (columnAlignments != null) {
                column.setAlignment(columnAlignments[i]);
            }
        }

        table.setHeaderVisible(true);
    }
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:24,代码来源:BaseZnodeModelTableFormPage.java

示例9: createModelFormContent

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {
    final ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();

    _EditSection = createEditSection(form, client, toolkit);
    GridData editSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _EditSection.setLayoutData(editSectionGridData);

    _PropertiesSection = createPropertiesTableSection(form, client, toolkit);
    GridData propertiesSectionGridData = new GridData(GridData.FILL_HORIZONTAL);
    _PropertiesSection.setLayoutData(propertiesSectionGridData);

    Table propertiesSectionTable = getPropertiesSectionTable();
    initTableEdit(propertiesSectionTable, null, 1);
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:JmxConnectionModelMainFormPage.java

示例10: moveRowUp

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
private void moveRowUp()
{
	Table table = mappingTableViewer.getTable();
	setValueForCellEditor();
	int[] indexes = table.getSelectionIndices();
	for (int index : indexes) {

		if (index > 0) {
			Collections.swap(
					(List<LookupMapProperty>) mappingTableItemList,
					index, index - 1);
			mappingTableViewer.refresh();
		}
	}
	refreshButtonStatus();

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:LookupMapDialog.java

示例11: initPropertiesSectionFromModel

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
/**
 * TODO: Comment.
 * 
 */
protected void initPropertiesSectionFromModel() {

    Table table = getPropertiesSectionTable();
    table.removeAll();

    Map<String, String> properties = getZooKeeperConnectionProperties();

    for (String key : properties.keySet()) {
        TableItem item = new TableItem(table, SWT.NONE);
        String value = properties.get(key);
        item.setText(0, key);
        item.setText(1, value);
    }

    packTable(table, PROPERTIES_COLUMN_WIDTHS);

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:22,代码来源:JmxConnectionModelMainFormPage.java

示例12: initDescriptorSectionFromModel

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
protected void initDescriptorSectionFromModel() {

        Descriptor descriptor = getJmxDescriptor();
        if (descriptor == null) {
            return;
        }

        Table table = getDescriptorTable();
        if (table == null) {
            return;
        }

        table.removeAll();

        for (String fieldName : descriptor.getFieldNames()) {
            TableItem item = new TableItem(table, SWT.NONE);
            Object value = descriptor.getFieldValue(fieldName);
            item.setText(0, fieldName);
            item.setText(1, String.valueOf(value));
        }

        packTable(table, DEFAULT_NAME_VALUE_COLUMN_WIDTHS);
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:24,代码来源:BaseJmxModelMainFormPage.java

示例13: selectionListenerAction

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
public void selectionListenerAction(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers, Widget... widgets) {
	propertyDialogButtonBar.enableApplyButton(true);
	table=(Table)widgets[0];
	table.getParent().getShell().setFocus();
	((Button) widgets[1]).setEnabled(true);
	ELTGridDetails eltGridDetails = (ELTGridDetails)helpers.get(HelperType.SCHEMA_GRID);
	if (eltGridDetails.getGrids().size() >= 1) {
		((Button) widgets[2]).setEnabled(true);
		((Button) widgets[3]).setEnabled(true);
	}
	GridWidgetCommonBuilder gridCommonBuilder = eltGridDetails.getGridWidgetCommonBuilder();
	gridCommonBuilder.setRowSequence(rowSequence);
	gridCommonBuilder.createDefaultSchema(eltGridDetails.getGrids(), eltGridDetails.getTableViewer(), eltGridDetails.getLabel());
	rowSequence++;
	((Component)helpers.get(HelperType.COMPONENT)).setLatestChangesInSchema(true);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:ELTGridAddSelectionListener.java

示例14: initInfoSectionFromModel

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
protected void initInfoSectionFromModel() {

    Table table = getInfoTable();
    table.removeAll();

    MBeanFeatureInfo featureInfo = getFeatureInfo();

    TableItem nameItem = new TableItem(table, SWT.NONE);
    nameItem.setText(0, FEATURE_INFO_PROPERTY_NAME_NAME);
    nameItem.setText(1, featureInfo.getName());

    TableItem descriptionItem = new TableItem(table, SWT.NONE);
    descriptionItem.setText(0, FEATURE_INFO_PROPERTY_NAME_DESCRIPTION);
    descriptionItem.setText(1, featureInfo.getDescription());
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:MBeanFeatureModeMainFormPage.java

示例15: selectionListenerAction

import org.eclipse.swt.widgets.Table; //导入依赖的package包/类
@Override
	public void selectionListenerAction(
			PropertyDialogButtonBar propertyDialogButtonBar,
			ListenerHelper helpers, Widget... widgets) {

		ELTGridDetails gridDetails = (ELTGridDetails) helpers.get(HelperType.SCHEMA_GRID);
		Table table =gridDetails.getTableViewer().getTable();
		int temp = table.getSelectionIndex();
		int[] indexs=table.getSelectionIndices();
		if (temp == -1) {
			WidgetUtility.errorMessage("Please Select row to delete");
		} else {
			table.remove(indexs);
			ArrayList tempList= new ArrayList();
			for (int index :indexs) { 
//				PropertyField test =(PropertyField) gridDetails.getGrids().get(index);
//				tempList.add(test);
			}
			 gridDetails.getGrids().removeAll(tempList); 
			
		}		
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:ELTTransformDeleteSelectionListener.java


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