當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。