本文整理匯總了Java中org.eclipse.jface.layout.TableColumnLayout.setColumnData方法的典型用法代碼示例。如果您正苦於以下問題:Java TableColumnLayout.setColumnData方法的具體用法?Java TableColumnLayout.setColumnData怎麽用?Java TableColumnLayout.setColumnData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.layout.TableColumnLayout
的用法示例。
在下文中一共展示了TableColumnLayout.setColumnData方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setTableLayoutToMappingTable
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
private void setTableLayoutToMappingTable(TableViewer tableViewer) {
TableColumnLayout layout = new TableColumnLayout();
tableViewer.getControl().getParent().setLayout(layout);
for (int columnIndex = 0, n = tableViewer.getTable().getColumnCount(); columnIndex < n; columnIndex++) {
tableViewer.getTable().getColumn(columnIndex).pack();
}
for (int i = 0; i < tableViewer.getTable().getColumnCount(); i++) {
if(tableViewer.getData(TABLE_TYPE_KEY) == null ){
layout.setColumnData(tableViewer.getTable().getColumn(i),
new ColumnWeightData(1));
}else{
if(i!=2){
layout.setColumnData(tableViewer.getTable().getColumn(i),
new ColumnWeightData(3));
}else{
layout.setColumnData(tableViewer.getTable().getColumn(i),
new ColumnWeightData(1));
}
}
}
}
示例2: createColumns
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
private void createColumns(Table table)
{
E [] columns = columnEnumClass.getEnumConstants();
TableColumnLayout tableLayout = new TableColumnLayout();
this.setLayout(tableLayout);
for (int i = 0; i < columns.length; i++) {
E column = columns[i];
createTableViewerColumn(column.getTitle(), column.getPercentage(), column.getColumnIndex());
TableColumn tableColumn = table.getColumn(column.getColumnIndex());
tableColumn.pack();
tableLayout.setColumnData(tableColumn, new ColumnWeightData(column.getPercentage(), table.getColumn(0).getWidth()));
}
}
示例3: createPropertiesTable
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
private TableViewer createPropertiesTable(Composite parent) {
Composite cmpItemPropertiesTableViewer=new Composite(parent, SWT.NONE);
cmpItemPropertiesTableViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,1,3));
TableColumnLayout tl_itemPropertiesTableViewer = new TableColumnLayout();
cmpItemPropertiesTableViewer.setLayout(tl_itemPropertiesTableViewer);
TableViewer tv = new TableViewer(cmpItemPropertiesTableViewer,SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
tv.getTable().setHeaderVisible(true);
tv.getTable().setLinesVisible(true);
TableViewerColumn tvcName = new TableViewerColumn(tv, SWT.NONE);
tvcName.getColumn().setText(Messages.SPCVItemPropertiesList_ColName);
tvcName.setLabelProvider(new ItemPropertyNameLabelProvider());
tl_itemPropertiesTableViewer.setColumnData(tvcName.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
TableViewerColumn tvcValue = new TableViewerColumn(tv, SWT.NONE);
tvcValue.getColumn().setText(Messages.SPCVItemPropertiesList_ColValue);
tvcValue.setLabelProvider(new ItemPropertyValueLabelProvider());
tl_itemPropertiesTableViewer.setColumnData(tvcValue.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
tv.setContentProvider(new ArrayContentProvider());
return tv;
}
示例4: createPropertiesTable
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
private TableViewer createPropertiesTable(Composite parent) {
Composite cmpItemPropertiesTableViewer=new Composite(parent, SWT.NONE);
cmpItemPropertiesTableViewer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,1,3));
TableColumnLayout tl_itemPropertiesTableViewer = new TableColumnLayout();
cmpItemPropertiesTableViewer.setLayout(tl_itemPropertiesTableViewer);
TableViewer tv = new TableViewer(cmpItemPropertiesTableViewer,SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION);
tv.getTable().setHeaderVisible(true);
tv.getTable().setLinesVisible(true);
TableViewerColumn tvcName = new TableViewerColumn(tv, SWT.NONE);
tvcName.getColumn().setText(Messages.ElementItemDialog_NameColumn);
tvcName.setLabelProvider(getItemPropertyNameLabelProvider());
tl_itemPropertiesTableViewer.setColumnData(tvcName.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
TableViewerColumn tvcValue = new TableViewerColumn(tv, SWT.NONE);
tvcValue.getColumn().setText(Messages.ElementItemDialog_ValueColumn);
tvcValue.setLabelProvider(getItemPropertyValueLabelProvider());
tl_itemPropertiesTableViewer.setColumnData(tvcValue.getColumn(), new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
tv.setContentProvider(new ArrayContentProvider());
return tv;
}
示例5: defineColumn_Description
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
/**
* Column: Description
*/
private void defineColumn_Description(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.CENTER);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_Description_ShortCut);
tc.setToolTipText(Messages.Tour_Marker_Column_Description_Tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
final String description = tourMarker.getDescription();
cell.setText(description.length() == 0 ? UI.EMPTY_STRING : UI.SYMBOL_STAR);
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(4), false));
}
示例6: defineColumn_Marker
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
/**
* column: marker
*/
private void defineColumn_Marker(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.LEAD);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_remark);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
cell.setText(tourMarker.getLabel());
}
});
tableLayout.setColumnData(tc, new ColumnWeightData(1, true));
}
示例7: defineColumn_OffsetX
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
/**
* column: horizontal offset
*/
private void defineColumn_OffsetX(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.TRAIL);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_horizontal_offset);
tc.setToolTipText(Messages.Tour_Marker_Column_horizontal_offset_tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
cell.setText(Integer.toString(tourMarker.getLabelXOffset()));
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(6), false));
}
示例8: defineColumn_OffsetY
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
/**
* column: vertical offset
*/
private void defineColumn_OffsetY(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_markerViewer, SWT.TRAIL);
final TableColumn tc = tvc.getColumn();
tc.setText(Messages.Tour_Marker_Column_vertical_offset);
tc.setToolTipText(Messages.Tour_Marker_Column_vertical_offset_tooltip);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final TourMarker tourMarker = (TourMarker) cell.getElement();
cell.setText(Integer.toString(tourMarker.getLabelYOffset()));
}
});
tableLayout.setColumnData(tc, new ColumnPixelData(_pc.convertWidthInCharsToPixels(6), false));
}
示例9: defineColumn_ColumnName
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
/**
* Column: Label
*/
private void defineColumn_ColumnName(final TableColumnLayout tableLayout) {
final TableViewerColumn tvc = new TableViewerColumn(_columnViewer, SWT.LEAD);
final TableColumn tc = tvc.getColumn();
tc.setMoveable(true);
tc.setText(Messages.ColumnModifyDialog_column_column);
tvc.setLabelProvider(new CellLabelProvider() {
@Override
public void update(final ViewerCell cell) {
final ColumnDefinition colDef = (ColumnDefinition) cell.getElement();
cell.setText(colDef.getColumnLabel());
setColor(cell, colDef);
}
});
tableLayout.setColumnData(tc, new ColumnWeightData(30, true));
}
示例10: initTableView
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
public void initTableView(Composite kvCom) {
Composite tableCom = new Composite(kvCom,SWT.NONE);
tableCom.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
TableColumnLayout tclayout = new TableColumnLayout();
tableCom.setLayout(tclayout);
listValueTable = new Table(tableCom, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
listValueTable.setHeaderVisible(true);
listValueTable.setLinesVisible(true);
listValueTable.setLinesVisible(true);
TableColumn indexValue = new TableColumn(listValueTable, SWT.NONE);
indexValue.setText("索引");
tclayout.setColumnData(indexValue, new ColumnWeightData(0, 45, false));
TableColumn hashValue = new TableColumn(listValueTable, SWT.NONE);
hashValue.setText("值");
tclayout.setColumnData(hashValue, new ColumnWeightData(100, 100, true));
}
示例11: createColumns
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
private void createColumns() {
TableViewerColumn propertyColumn = new TableViewerColumn(tableViewer, SWT.None);
propertyColumn.getColumn().setText("Test Spec");
propertyColumn.getColumn().setWidth(400);
propertyColumn.setLabelProvider(new TestCaseGeneratorResultLabelProvider(Column.PROPERTY, tableViewer));
TableViewerColumn resultColumn = new TableViewerColumn(tableViewer, SWT.None);
resultColumn.getColumn().setText("Result");
resultColumn.getColumn().setWidth(200);
resultColumn.setLabelProvider(new TestCaseGeneratorResultLabelProvider(Column.RESULT));
TableColumnLayout layout = new TableColumnLayout();
composite.setLayout(layout);
layout.setColumnData(propertyColumn.getColumn(), new ColumnWeightData(3));
layout.setColumnData(resultColumn.getColumn(), new ColumnWeightData(1));
}
示例12: createColumns
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
private void createColumns() {
TableViewerColumn nameColumn = new TableViewerColumn(tableViewer, SWT.None);
nameColumn.getColumn().setText("Test Name");
nameColumn.getColumn().setWidth(200);
nameColumn.setLabelProvider(new TestSuiteLabelProvider(TestColumn.NAME));
nameColumn.setEditingSupport(new TestSuiteNameEditingSupport(tableViewer));
TableViewerColumn descriptionColumn = new TableViewerColumn(tableViewer, SWT.None);
descriptionColumn.getColumn().setText("Test Description");
descriptionColumn.getColumn().setWidth(200);
descriptionColumn.setLabelProvider(new TestSuiteLabelProvider(TestColumn.DESCRIPTION));
descriptionColumn.setEditingSupport(new TestSuiteDescriptionEditingSupport(tableViewer));
// TableViewerColumn obligationsColumn = new TableViewerColumn(tableViewer, SWT.None);
// obligationsColumn.getColumn().setText("Satisfies Coverage Obligations:");
// obligationsColumn.getColumn().setWidth(200);
// obligationsColumn.setLabelProvider(new TestSuiteLabelProvider(TestColumn.OBLIGATIONS));
TableColumnLayout layout = new TableColumnLayout();
composite.setLayout(layout);
layout.setColumnData(nameColumn.getColumn(), new ColumnWeightData(3));
layout.setColumnData(descriptionColumn.getColumn(), new ColumnWeightData(1));
// layout.setColumnData(obligationsColumn.getColumn(), new ColumnWeightData(1));
}
示例13: configureKeyTableViewer
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
public void configureKeyTableViewer(final EditingSupport editingSupport) {
final TableViewer keyTableViewer = (TableViewer)editingSupport.getViewer();
final TableViewerColumn viewerElementColumn = new TableViewerColumn(keyTableViewer, SWT.LEFT);
final TableColumn elementColumn = viewerElementColumn.getColumn();
elementColumn.setText("Y-Axis");
final TableColumnLayout tableColumnLayout = new TableColumnLayout();
tableColumnLayout.setColumnData(elementColumn, new ColumnWeightData(1, 175));
viewerElementColumn.setEditingSupport(editingSupport);
viewerElementColumn.setLabelProvider(createElementLabelProvider());
final TableViewerColumn viewerValueColumn = new TableViewerColumn(keyTableViewer, SWT.NONE);
final TableColumn valueColumn = viewerValueColumn.getColumn();
valueColumn.setText("Value");
tableColumnLayout.setColumnData(valueColumn, new ColumnWeightData(2, 140));
viewerValueColumn.setLabelProvider(createValueLabelProvider());
keyTableViewer.getTable().getParent().setLayout(tableColumnLayout);
keyTableViewer.getTable().setLinesVisible(true);
keyTableViewer.getTable().setHeaderVisible(true);
keyTableViewer.setUseHashlookup(true);
keyTableViewer.setInput(yAxisTableItems.add(createYAxisTableItem()));
keyTableViewer.getTable().getItem(yAxisTableItems.size()-1).setChecked(true);
}
示例14: createDosageColumn
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
public static TableViewerColumn createDosageColumn(TableViewer viewer,
TableColumnLayout layout, int columnIndex){
TableViewerColumn ret = new TableViewerColumn(viewer, SWT.NONE);
ret.setLabelProvider(new MedicationCellLabelProvider() {
@Override
public String getText(Object element){
MedicationTableViewerItem pres = (MedicationTableViewerItem) element;
String dosis = pres.getDosis();
return (dosis.equals(StringConstants.ZERO) ? Messages.MedicationComposite_stopped
: dosis);
}
});
TableColumn tblclmnDosage = ret.getColumn();
tblclmnDosage.setToolTipText(Messages.TherapieplanComposite_tblclmnDosage_toolTipText);
tblclmnDosage.addSelectionListener(getSelectionAdapter(viewer, tblclmnDosage, columnIndex));
layout.setColumnData(tblclmnDosage, new ColumnPixelData(60, true, true));
ret.getColumn().setText(Messages.TherapieplanComposite_tblclmnDosage_text);
return ret;
}
示例15: createBeginColumn
import org.eclipse.jface.layout.TableColumnLayout; //導入方法依賴的package包/類
public static TableViewerColumn createBeginColumn(TableViewer viewer,
TableColumnLayout layout, int columnIndex){
TableViewerColumn ret = new TableViewerColumn(viewer, SWT.CENTER);
TableColumn tblclmnEnacted = ret.getColumn();
layout.setColumnData(tblclmnEnacted, new ColumnPixelData(60, true, true));
tblclmnEnacted.setImage(Images.resize(Images.IMG_NEXT_WO_SHADOW.getImage(),
ImageSize._12x12_TableColumnIconSize));
tblclmnEnacted.setToolTipText(Messages.MedicationComposite_column_sortBy + " "
+ Messages.MedicationComposite_column_beginDate);
tblclmnEnacted
.addSelectionListener(getSelectionAdapter(viewer, tblclmnEnacted, columnIndex));
ret.setLabelProvider(new MedicationCellLabelProvider() {
@Override
public String getText(Object element){
MedicationTableViewerItem pres = (MedicationTableViewerItem) element;
return pres.getBeginDate();
}
});
return ret;
}