本文整理汇总了Java中org.eclipse.jface.viewers.ColumnWeightData类的典型用法代码示例。如果您正苦于以下问题:Java ColumnWeightData类的具体用法?Java ColumnWeightData怎么用?Java ColumnWeightData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColumnWeightData类属于org.eclipse.jface.viewers包,在下文中一共展示了ColumnWeightData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyInitialColWidth
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
protected void applyInitialColWidth ( final TableLayout tableLayout )
{
if ( this.initialColWidth != null && !this.initialColWidth.isEmpty () && this.viewer != null && this.initialColWidth.size () != this.viewer.getTree ().getColumnCount () )
{
for ( final Integer w : this.initialColWidth )
{
tableLayout.addColumnData ( new ColumnPixelData ( w, true ) );
}
}
else
{
tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 100, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 100, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) );
tableLayout.addColumnData ( new ColumnWeightData ( 200, true ) );
}
}
示例2: setTableLayoutToMappingTable
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的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));
}
}
}
}
示例3: addColumns
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private void addColumns() {
// Columns
final TableLayout mergeTableLayout = new TableLayout();
table.setLayout(mergeTableLayout);
mergeTableLayout.addColumnData(new ColumnWeightData(15, 10, true));
final TableColumn changesetTableColumn = new TableColumn(table, SWT.NONE);
changesetTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameChangeset")); //$NON-NLS-1$
mergeTableLayout.addColumnData(new ColumnWeightData(25, 10, true));
final TableColumn changeTableColumn = new TableColumn(table, SWT.NONE);
changeTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameDate")); //$NON-NLS-1$
mergeTableLayout.addColumnData(new ColumnWeightData(15, 10, true));
final TableColumn userTableColumn = new TableColumn(table, SWT.NONE);
userTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameUser")); //$NON-NLS-1$
mergeTableLayout.addColumnData(new ColumnWeightData(35, 10, true));
final TableColumn commentTableColumn = new TableColumn(table, SWT.FILL);
commentTableColumn.setText(Messages.getString("SelectChangesetsWizardPage.ColumnNameComment")); //$NON-NLS-1$
}
示例4: createTableColumns
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private void createTableColumns(final Table table) {
final TableLayout tableLayout = new TableLayout();
table.setLayout(tableLayout);
tableLayout.addColumnData(new ColumnWeightData(5, true));
final TableColumn column1 = new TableColumn(table, SWT.NONE);
column1.setText(Messages.getString("BranchesPropertiesControl.ColumNameFileName")); //$NON-NLS-1$
column1.setResizable(true);
tableLayout.addColumnData(new ColumnWeightData(3, true));
final TableColumn column2 = new TableColumn(table, SWT.NONE);
column2.setText(Messages.getString("BranchesPropertiesControl.ColumnNameChange")); //$NON-NLS-1$
column2.setResizable(true);
tableLayout.addColumnData(new ColumnWeightData(1, true));
final TableColumn column3 = new TableColumn(table, SWT.NONE);
column3.setText(Messages.getString("BranchesPropertiesControl.ColumnNameBranchedFrom")); //$NON-NLS-1$
column3.setResizable(true);
}
示例5: createTableColumns
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private void createTableColumns(final Table table) {
final TableLayout tableLayout = new TableLayout();
table.setLayout(tableLayout);
tableLayout.addColumnData(new ColumnWeightData(1, true));
final TableColumn column1 = new TableColumn(table, SWT.NONE);
column1.setText(Messages.getString("StatusPropertiesTab.ColumNameUser")); //$NON-NLS-1$
column1.setResizable(true);
tableLayout.addColumnData(new ColumnWeightData(1, true));
final TableColumn column2 = new TableColumn(table, SWT.NONE);
column2.setText(Messages.getString("StatusPropertiesTab.ChangeNameChangeType")); //$NON-NLS-1$
column2.setResizable(true);
tableLayout.addColumnData(new ColumnWeightData(1, true));
final TableColumn column3 = new TableColumn(table, SWT.NONE);
column3.setText(Messages.getString("StatusPropertiesTab.ColumnNameWorkspace")); //$NON-NLS-1$
column3.setResizable(true);
}
示例6: createTableColumns
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private void createTableColumns(final Table table) {
final TableLayout tableLayout = new TableLayout();
table.setLayout(tableLayout);
tableLayout.addColumnData(new ColumnWeightData(5, true));
final TableColumn column1 = new TableColumn(table, SWT.NONE);
column1.setText(Messages.getString("BranchHistoryTreeControl.ColumnHeaderFileName")); //$NON-NLS-1$
column1.setResizable(true);
tableLayout.addColumnData(new ColumnWeightData(1, true));
final TableColumn column2 = new TableColumn(table, SWT.NONE);
column2.setText(Messages.getString("BranchHistoryTreeControl.ColumnHeaderBranchedFromVersion")); //$NON-NLS-1$
column2.setResizable(true);
if (displayLatestVersion) {
tableLayout.addColumnData(new ColumnWeightData(1, true));
final TableColumn column3 = new TableColumn(table, SWT.NONE);
column3.setText(Messages.getString("BranchHistoryTreeControl.ColumnHeaderLatestVersion")); //$NON-NLS-1$
column3.setResizable(true);
}
}
示例7: createTable
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
protected TableViewer createTable(Composite parent, int span) {
Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
data.horizontalSpan = span;
data.heightHint = 125;
table.setLayoutData(data);
TableLayout layout = new TableLayout();
layout.addColumnData(new ColumnWeightData(100, true));
table.setLayout(layout);
TableColumn col = new TableColumn(table, SWT.NONE);
col.setResizable(true);
col.setText(Policy.bind("SVNFoldersExistWarningPage.folders")); //$NON-NLS-1$
table.setHeaderVisible(true);
return new TableViewer(table);
}
示例8: createTableViewer
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewer createTableViewer(Composite parent, String[] columnNames, int[] columnWeights) {
Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).hint(600, 200).applyTo(container);
TableColumnLayout layout = new TableColumnLayout();
container.setLayout(layout);
Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
table.setHeaderVisible(true);
for (int i = 0; i < columnNames.length; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(columnNames[i]);
layout.setColumnData(column, new ColumnWeightData(columnWeights[i]));
}
TableViewer tableViewer = new TableViewer(table);
tableViewer.setColumnProperties(columnNames);
return tableViewer;
}
示例9: createColumns
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的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()));
}
}
示例10: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) tableViewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例11: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width,
int alignment, boolean resizable, boolean moveable,
final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, 20,
resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
sorter.setColumn(column);
}
});
return viewerColumn;
}
示例12: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, 10, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例13: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例14: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable,
boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(width, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}
示例15: createTableViewerColumn
import org.eclipse.jface.viewers.ColumnWeightData; //导入依赖的package包/类
private TableViewerColumn createTableViewerColumn(String title, int width, int alignment, boolean resizable, boolean moveable, final boolean isNumber) {
final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
column.setText(title);
column.setAlignment(alignment);
column.setMoveable(moveable);
tableColumnLayout.setColumnData(column, new ColumnWeightData(30, width, resizable));
column.setData("isNumber", isNumber);
column.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ColumnLabelSorter sorter = (ColumnLabelSorter) viewer.getComparator();
TableColumn selectedColumn = (TableColumn) e.widget;
sorter.setColumn(selectedColumn);
}
});
return viewerColumn;
}