本文整理了Java中org.eclipse.swt.widgets.Table.getSize()
方法的一些代码示例,展示了Table.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getSize()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getSize
暂无
代码示例来源:origin: pentaho/pentaho-kettle
protected int getTableWidth( Table table ) {
int width = table.getSize().x - 2;
if ( table.getVerticalBar() != null && table.getVerticalBar().isVisible() ) {
width -= table.getVerticalBar().getSize().x;
}
return width;
}
代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.sqm.fe.ui
public void handleEvent(Event e) {
int weights[] = new int[] { 2, 4 };
int weightsum = 0;
for (int i = 0; i < weights.length; i++) {
weightsum += weights[i];
}
TableColumn[] cols = summaryTable.getColumns();
int count = java.lang.Math.min(weights.length, cols.length);
int tablewidth = summaryTable.getSize().x;
for (int i = 0; i < count; i++) {
cols[i].setWidth(tablewidth * weights[i] / weightsum);
}
}
});
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void controlResized(ControlEvent e) {
int size = table.getSize().x;
locationColumn.setWidth(size / 6 * 5);
enabledColumn.setWidth(size / 6 * 1);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void controlResized(ControlEvent e) {
int size = table.getSize().x;
locationColumn.setWidth(size / 6 * 5);
enabledColumn.setWidth(size / 6 * 1);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void controlResized(ControlEvent e) {
int size = table.getSize().x;
column1.setWidth(size / 7 * 4);
levelColumnEditor.setWidth(size / 7 * 2);
autoColumnEditor.setWidth(size / 7 * 1);
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void handleEvent(Event event)
{
Table table = constraintsTableViewer.getTable();
if (event.type == SWT.Resize && event.widget == table)
{
TableColumn tableColumn = table.getColumn(0);
tableColumn.setWidth(table.getSize().x);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public void handleEvent(Event event)
{
Table table = enumerationsTable.getTable();
if (event.type == SWT.Resize && event.widget == table)
{
TableColumn tableColumn = table.getColumn(0);
tableColumn.setWidth(table.getSize().x);
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void controlResized(ControlEvent e) {
int size = table.getSize().x;
nameColumn.setWidth(size / 9 * 3);
valueColumn.setWidth(size / 9 * 4);
osColumn.setWidth(size / 9 * 1);
archColumn.setWidth(size / 9 * 1);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui
@Override
public void shellActivated(ShellEvent e) {
if (!table.isDisposed()) {
int tableWidth = table.getSize().x;
if (tableWidth > 0) {
int c1 = tableWidth / 3;
column1.setWidth(c1);
column2.setWidth(tableWidth - c1);
}
getShell().removeShellListener(this);
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
Table table = getTable();
if (!table.isDisposed()) {
// if table size is zero, the rendering has not been
// made visible
// cannot pack until the rendering is visible
if (table.getSize().x > 0) {
TableColumn[] columns = table.getColumns();
for (int i = 0; i < columns.length - 1; i++) {
columns[i].pack();
}
} else {
fPendingResizeColumns = true;
}
}
return Status.OK_STATUS;
}
};
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor
@Override
protected void layout(Composite composite, boolean flushCache) {
Rectangle area= composite.getClientArea();
Table table= getTable(composite);
int tableWidth= table.getSize().x;
int trim= computeTrim(area, table, tableWidth);
int width= Math.max(0, area.width - trim);
if (width > 1)
layoutTable(table, width, area, tableWidth < area.width);
if( composite.getData(RECALCULATE_LAYOUT) == null ) {
composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
composite.layout();
}
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
protected void layout(Composite composite, boolean flushCache) {
Rectangle area= composite.getClientArea();
Table table= getTable(composite);
int tableWidth= table.getSize().x;
int trim= computeTrim(area, table, tableWidth);
int width= Math.max(0, area.width - trim);
if (width > 1)
layoutTable(table, width, area, tableWidth < area.width);
if( composite.getData(RECALCULATE_LAYOUT) == null ) {
composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
composite.layout();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.workbench.texteditor
@Override
protected void layout(Composite composite, boolean flushCache) {
Rectangle area= composite.getClientArea();
Table table= getTable(composite);
int tableWidth= table.getSize().x;
int trim= computeTrim(area, table, tableWidth);
int width= Math.max(0, area.width - trim);
if (width > 1)
layoutTable(table, width, area, tableWidth < area.width);
if( composite.getData(RECALCULATE_LAYOUT) == null ) {
composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
composite.layout();
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public void controlResized(ControlEvent e) {
Rectangle area= getClientArea();
Table table= (Table)getChildren()[0];
Point preferredSize= computeTableSize(table);
int width= area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
layoutTable(table, width, area, table.getSize().x < area.width);
}
});
代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui
public void controlResized(ControlEvent e)
{
Rectangle area = getClientArea();
Table table = (Table) getChildren()[0];
Point preferredSize = computeTableSize(table);
int width = area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height)
{
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
layoutTable(table, width, area, table.getSize().x < area.width);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void controlResized(ControlEvent e) {
Rectangle area= getClientArea();
Table table= (Table)getChildren()[0];
Point preferredSize= computeTableSize(table);
int width= area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
layoutTable(table, width, area, table.getSize().x < area.width);
}
});
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public void controlResized(ControlEvent e) {
Rectangle area= getClientArea();
Table table= (Table)getChildren()[0];
Point preferredSize= computeTableSize(table);
int width= area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
layoutTable(table, width, area, table.getSize().x < area.width);
}
});
代码示例来源:origin: org.eclipse.xtext/ui
@Override
public void controlResized(ControlEvent e) {
Rectangle area = getClientArea();
Table table = (Table) getChildren()[0];
Point preferredSize = computeTableSize(table);
int width = area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column
// width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
layoutTable(table, width, area,
table.getSize().x < area.width);
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
void notifyResize( Point oldSize ) {
if( !oldSize.equals( getSize() ) && !TextSizeUtil.isTemporaryResize() ) {
if( ( style & SWT.VIRTUAL ) != 0 ) {
checkData();
}
clearItemsTextWidths();
updateScrollBars();
adjustTopIndex();
}
super.notifyResize( oldSize );
}
代码示例来源:origin: oyse/yedit
@Override
public void controlResized(ControlEvent e) {
Rectangle area= getClientArea();
Table table= (Table)getChildren()[0];
Point preferredSize= computeTableSize(table);
int width= area.width - 2 * table.getBorderWidth();
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required
Point vBarSize = table.getVerticalBar().getSize();
width -= vBarSize.x;
}
layoutTable(table, width, area, table.getSize().x < area.width);
}
});
内容来源于网络,如有侵权,请联系作者删除!