本文整理匯總了Java中org.eclipse.jface.viewers.CheckboxTableViewer.setColumnProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckboxTableViewer.setColumnProperties方法的具體用法?Java CheckboxTableViewer.setColumnProperties怎麽用?Java CheckboxTableViewer.setColumnProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.CheckboxTableViewer
的用法示例。
在下文中一共展示了CheckboxTableViewer.setColumnProperties方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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();
}
示例2: createSummaryFiledViewer
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
private void createSummaryFiledViewer( Composite dialogArea )
{
Table table = new Table( dialogArea, SWT.BORDER
| SWT.SINGLE
| SWT.H_SCROLL
| SWT.V_SCROLL
| SWT.FULL_SELECTION
| SWT.CHECK );
table.setLinesVisible( true );
table.setHeaderVisible( true );
GridData gd = new GridData( GridData.FILL_BOTH );
gd.heightHint = 250;
table.setLayoutData( gd );
summaryFieldViewer = new CheckboxTableViewer( table );
SummaryFieldProvider provider = new SummaryFieldProvider( );
for ( int i = 0; i < columnNames.length; i++ )
{
TableColumn column = new TableColumn( table, SWT.LEFT );
column.setText( columnNames[i] );
column.setWidth( columnWidth[i] );
}
ComboBoxCellEditor comboCell = new ComboBoxCellEditor( table,
new String[0],
SWT.READ_ONLY );
// TextCellEditor textCell = new TextCellEditor(table, SWT.NONE);
cellEditor = new CellEditor[]{
null, comboCell
};
summaryFieldViewer.setColumnProperties( columnNames );
summaryFieldViewer.setCellEditors( cellEditor );
summaryFieldViewer.setCellModifier( cellModifier );
summaryFieldViewer.setUseHashlookup( true );
summaryFieldViewer.setContentProvider( provider );
summaryFieldViewer.setLabelProvider( provider );
summaryFieldViewer.addCheckStateListener( new ICheckStateListener( ) {
public void checkStateChanged( CheckStateChangedEvent event )
{
MeasureInfo info = (MeasureInfo) event.getElement( );
if ( event.getChecked( ) )
{
info.setShow( true );
}
else
{
info.setShow( false );
}
checkOKButtonStatus( );
}
} );
}
示例3: createGrandTotalArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
private void createGrandTotalArea( Composite content )
{
CLabel grandTotalLabel = new CLabel( content, SWT.NONE );
grandTotalLabel.setText( Messages.getString( "AggregationDialog.Label.Grand" ) ); //$NON-NLS-1$
if ( axis == ICrosstabConstants.ROW_AXIS_TYPE )
{
grandTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.ROW_GRAND_TOTAL_IMAGE ) );
}
else if ( axis == ICrosstabConstants.COLUMN_AXIS_TYPE )
{
grandTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.COLUMN_GRAND_TOTAL_IMAGE ) );
}
Table table = new Table( content, SWT.SINGLE
| SWT.BORDER
| SWT.H_SCROLL
| SWT.V_SCROLL
| SWT.FULL_SELECTION
| SWT.CHECK );
table.setLinesVisible( false );
table.setHeaderVisible( true );
GridData gd = new GridData( GridData.FILL_BOTH );
gd.minimumHeight = 200;
table.setLayoutData( gd );
grandTableViewer = new CheckboxTableViewer( table );
GrandTotalProvider provider = new GrandTotalProvider( grandTableViewer,crosstab, axis );
String[] columnNames = provider.getColumnNames( );
int[] columnWidths = provider.columnWidths( );
for ( int i = 0; i < columnNames.length; i++ )
{
TableColumn column = new TableColumn( table, SWT.LEFT );
column.setText( columnNames[i] );
column.setWidth( columnWidths[i] );
}
grandTableViewer.setUseHashlookup( true );
grandTableViewer.setColumnProperties( provider.getColumnNames( ) );
grandTableViewer.setCellEditors( provider.getCellEditors( ) );
grandTableViewer.setCellModifier( provider );
grandTableViewer.setCellEditors( provider.getCellEditors() );
grandTableViewer.setContentProvider( provider );
grandTableViewer.setLabelProvider( provider );
grandTableViewer.setCellModifier( provider );
}
示例4: createSubTotalArea
import org.eclipse.jface.viewers.CheckboxTableViewer; //導入方法依賴的package包/類
private void createSubTotalArea( Composite content )
{
CLabel subTotalLabel = new CLabel( content, SWT.NONE );
subTotalLabel.setText( Messages.getString( "AggregationDialog.Label.Sub" ) ); //$NON-NLS-1$
if ( axis == ICrosstabConstants.ROW_AXIS_TYPE )
{
subTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.ROW_SUB_TOTAL_IMAGE ) );
}
else if ( axis == ICrosstabConstants.COLUMN_AXIS_TYPE )
{
subTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.COLUMN_SUB_TOTAL_IMAGE ) );
}
Table table = new Table( content, SWT.SINGLE
| SWT.BORDER
| SWT.H_SCROLL
| SWT.V_SCROLL
| SWT.FULL_SELECTION
| SWT.CHECK );
table.setLinesVisible( false );
table.setHeaderVisible( true );
GridData gd = new GridData( GridData.FILL_BOTH );
gd.minimumHeight = 200;
table.setLayoutData( gd );
subTableViewer = new CheckboxTableViewer( table );
SubTotalProvider provider = new SubTotalProvider( subTableViewer,crosstab,axis );
String[] columnNames = provider.getColumnNames( );
int[] columnWidths = provider.columnWidths( );
for ( int i = 0; i < columnNames.length; i++ )
{
TableColumn column = new TableColumn( table, SWT.LEFT );
column.setText( columnNames[i] );
column.setWidth( columnWidths[i] );
}
subTableViewer.setUseHashlookup( true );
subTableViewer.setColumnProperties( provider.getColumnNames( ) );
subTableViewer.setCellEditors( provider.getCellEditors( ) );
subTableViewer.setContentProvider( provider );
subTableViewer.setLabelProvider( provider );
subTableViewer.setCellModifier( provider );
}