本文整理匯總了Java中org.eclipse.swt.widgets.TableColumn.pack方法的典型用法代碼示例。如果您正苦於以下問題:Java TableColumn.pack方法的具體用法?Java TableColumn.pack怎麽用?Java TableColumn.pack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.TableColumn
的用法示例。
在下文中一共展示了TableColumn.pack方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public void init (Listener listener,GridData gd) {
getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
getTable().setLayoutData(gd);
setContentProvider(new IStructuredContentProvider() {
@Override
public Object[] getElements(Object inputElement) {
BuildPolicy[] ret = (BuildPolicy[]) inputElement;
return ret;
}
});
setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
BuildPolicy bp = (BuildPolicy) element;
return bp.getPathGenerator();
}
});
getTable().addListener(SWT.Resize, new Listener() {
@Override
public void handleEvent(Event event) {
TableHelper.handleEvent(event);
}
});
TableColumn column = new TableColumn(getTable(), SWT.LEFT);
column.setText("");
column.pack();
getTable().setHeaderVisible(true);
getTable().setLinesVisible(true);
getTable().addListener(SWT.Selection, listener);
}
示例2: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public static void createTableColumns(Table table, String[] fields) {
for (String field : fields) {
TableColumn tableColumn = new TableColumn(table, SWT.FILL);
tableColumn.setText(field);
tableColumn.setWidth(100);
tableColumn.pack();
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例3: createTableColumns
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public static void createTableColumns(Table table, String[] fields) {
for (String field : fields) {
TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
tableColumn.setText(field);
tableColumn.setWidth(100);
tableColumn.pack();
}
table.setHeaderVisible(true);
table.setLinesVisible(true);
}
示例4: run
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
@Override
public void run() {
for(TableColumn tableColumn : this.debugDataViewer.getTableViewer().getTable().getColumns()){
tableColumn.pack();
}
}
示例5: adjustWidth
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
protected int adjustWidth(TableColumn column, int defaultWidth){
column.pack();
int width = column.getWidth();
if( width < defaultWidth ){
width = defaultWidth;
column.setWidth( width );
}
return width;
}
示例6: createTableColumn
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public static TableColumn createTableColumn(final Table table, final String title, final int width, final int align) {
final TableColumn column = new TableColumn(table, align);
column.setText(ResourceString.getResourceString(title));
if (width >= 0) {
column.setWidth(width);
} else {
column.pack();
}
return column;
}
示例7: createRightComposite
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
private void createRightComposite(final Composite parent) {
final Composite composite = new Composite(parent, SWT.BORDER);
final GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
composite.setLayoutData(gridData);
final GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = 8;
composite.setLayout(gridLayout);
final GridData tableGridData = new GridData();
tableGridData.heightHint = GROUP_LIST_HEIGHT;
tableGridData.verticalIndent = 15;
testDataTable = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION);
testDataTable.setHeaderVisible(true);
testDataTable.setLayoutData(tableGridData);
testDataTable.setLinesVisible(true);
final TableColumn nameColumn = new TableColumn(testDataTable, SWT.NONE);
nameColumn.setWidth(300);
nameColumn.setResizable(false);
nameColumn.setText(ResourceString.getResourceString("label.testdata.table.name"));
final TableColumn dataNumColumn = new TableColumn(testDataTable, SWT.RIGHT);
dataNumColumn.setResizable(false);
dataNumColumn.setText(ResourceString.getResourceString("label.testdata.table.test.num"));
dataNumColumn.pack();
}
示例8: build
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
/**
* Creates the View
* @param parent The Parent Composite
*/
private void build(Composite parent) {
this.root = new Composite(parent, SWT.NONE);
this.root.setLayout(new FillLayout());
this.root.setLayoutData(SWTUtil.createFillGridDataBoth());
table = SWTUtil.createTableDynamic(root, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setMenu(new ClipboardHandlerTable(table).getMenu());
DynamicTableColumn c = new DynamicTableColumn(table, SWT.LEFT);
c.setWidth("70%"); //$NON-NLS-1$ //$NON-NLS-2$
c.setText(Resources.getMessage("RiskAnalysis.19")); //$NON-NLS-1$
c.setResizable(true);
c = new DynamicTableColumn(table, SWT.LEFT);
SWTUtil.createColumnWithBarCharts(table, c);
c.setWidth("10%"); //$NON-NLS-1$ //$NON-NLS-2$
c.setText(Resources.getMessage("RiskAnalysis.20")); //$NON-NLS-1$
c.setResizable(true);
c = new DynamicTableColumn(table, SWT.LEFT);
SWTUtil.createColumnWithBarCharts(table, c);
c.setWidth("10%"); //$NON-NLS-1$ //$NON-NLS-2$
c.setText(Resources.getMessage("RiskAnalysis.21")); //$NON-NLS-1$
c.setResizable(true);
c = new DynamicTableColumn(table, SWT.LEFT);
SWTUtil.createColumnWithBarCharts(table, c);
c.setWidth("10%"); //$NON-NLS-1$ //$NON-NLS-2$
c.setText(Resources.getMessage("RiskAnalysis.22")); //$NON-NLS-1$
c.setResizable(true);
for (final TableColumn col : table.getColumns()) {
col.pack();
}
SWTUtil.createGenericTooltip(table);
update("SAMPLE_UNIQUENESS");
}
示例9: setWordGraphMatrix
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
/**
* Sets the data for the word graph editor.
* @param line The current value of the line.
* @param wordGraphMatrix The matrix of the n-best transcripted lines.
* @param editIndex The index of the column that was edited. Set to -1 if whole data is reset.
*/
public void setWordGraphMatrix(String line, String[][] wordGraphMatrix, boolean fromCache) {
if (false) return;
wgMatrix = wordGraphMatrix;
lineText = line==null ? "" : line;
if (wgMatrix==null) {
initColumns(null);
tableViewer.setInput(null);
return;
}
lineText.split("\\s");
ArrayList<List<String> > data = matrix2ArrayList(lineText, wgMatrix, true);
// tableViewer.setInput(null);
initColumns(data);
tableViewer.setInput(data);
if (!fromCache) {
editedIndices.clear();
}
// tableViewer.refresh();
// resize all columns to max text size of row:
for (TableColumn tc : tableViewer.getTable().getColumns())
tc.pack();
}
示例10: createTableColumn
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public static TableColumn createTableColumn(Table table, String title,
int width, int align) {
TableColumn column = new TableColumn(table, align);
column.setText(ResourceString.getResourceString(title));
if (width >= 0) {
column.setWidth(width);
} else {
column.pack();
}
return column;
}
示例11: createRightComposite
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
private void createRightComposite(Composite parent) {
Composite composite = new Composite(parent, SWT.BORDER);
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
composite.setLayoutData(gridData);
GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = 8;
composite.setLayout(gridLayout);
GridData tableGridData = new GridData();
tableGridData.heightHint = GROUP_LIST_HEIGHT;
tableGridData.verticalIndent = 15;
this.testDataTable = new Table(composite, SWT.BORDER
| SWT.FULL_SELECTION);
this.testDataTable.setHeaderVisible(true);
this.testDataTable.setLayoutData(tableGridData);
this.testDataTable.setLinesVisible(true);
TableColumn nameColumn = new TableColumn(testDataTable, SWT.NONE);
nameColumn.setWidth(300);
nameColumn.setResizable(false);
nameColumn.setText(ResourceString
.getResourceString("label.testdata.table.name"));
TableColumn dataNumColumn = new TableColumn(testDataTable, SWT.RIGHT);
dataNumColumn.setResizable(false);
dataNumColumn.setText(ResourceString
.getResourceString("label.testdata.table.test.num"));
dataNumColumn.pack();
}
示例12: resizeColumns
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public static void resizeColumns(TableViewer viewer)
{
for (TableColumn tc : viewer.getTable().getColumns())
tc.pack();
}
示例13: packTable
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
public static void packTable(Table table) {
for (TableColumn tc : table.getColumns()) {
tc.pack();
}
}
示例14: createDialogArea
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
// GridLayout layout = new GridLayout(1, false);
Layout layout = new FillLayout();
container.setLayout(layout);
if (anomalyCausingConstraints == null) {
return container;
}
Label whitespaceLabel = new Label(parent, SWT.VERTICAL);
whitespaceLabel.setText("Anomaly Causing Constraints:");
// TableViewer viewer = new TableViewer(parent, SWT.H_SCROLL
// | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
//
// TableViewerColumn colConstraint = new TableViewerColumn(viewer, SWT.NONE);
// colConstraint.getColumn().setWidth(360);
// colConstraint.getColumn().setText("Constraint");
// colConstraint.setLabelProvider(new ColumnLabelProvider() {
// @Override
// public String getText(Object element) {
// return (String) element;
// }
// });
//
// colConstraint.getColumn().setResizable(true);
Table table = new Table(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
table.setLayoutData(GridDataFactory.swtDefaults().hint(360, 100).create());
TableColumn tc1 = new TableColumn(table, SWT.LEFT);
tc1.setText("Constraint");
tc1.setWidth(360);
table.setHeaderVisible(true);
for (String constraintString : anomalyCausingConstraints) {
TableItem tableItem = new TableItem(table, SWT.NONE);
tableItem.setText(new String[] { constraintString});
// viewer.add(constraintString);
}
tc1.pack();
return container;
}
示例15: createTableColumn
import org.eclipse.swt.widgets.TableColumn; //導入方法依賴的package包/類
private void createTableColumn(final Table table, final String text) {
final TableColumn col = new TableColumn(table, SWT.NONE);
col.setText(text);
col.pack();
}