本文整理了Java中org.eclipse.swt.widgets.Table.computeSize()
方法的一些代码示例,展示了Table.computeSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.computeSize()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:computeSize
暂无
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
Table table = (Table) composite;
Point result = table.computeSize(wHint, hHint, flushCache);
return result;
}
代码示例来源:origin: com.diffplug.durian/durian-swt
@Override
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
return table.computeSize(wHint, hHint);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
return table.computeSize (wHint, hHint, changed);
}
@Override
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
return table.computeSize (wHint, hHint, changed);
}
public Rectangle computeTrim (int x, int y, int width, int height) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
return table.computeSize (wHint, hHint, changed);
}
@Override
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
return table.computeSize (wHint, hHint, changed);
}
@Override
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
return table.computeSize (wHint, hHint, changed);
}
@Override
代码示例来源:origin: oyse/yedit
Point computeTableSize(Table table) {
Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor
private Point computeTableSize(Table table, int wHint, int hHint) {
Point result= table.computeSize(wHint, hHint);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse.xtext/ui
private Point computeTableSize(Table table) {
Point result = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width = 0;
int size = columns.size();
for (int i = 0; i < size; ++i) {
ColumnLayoutData layoutData = (ColumnLayoutData) columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col = (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col = (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x = width;
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.workbench.texteditor
private Point computeTableSize(Table table, int wHint, int hHint) {
Point result= table.computeSize(wHint, hHint);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private Point computeTableSize(Table table) {
Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
private Point computeTableSize(Table table, int wHint, int hHint) {
Point result= table.computeSize(wHint, hHint);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private Point computeTableSize(Table table) {
Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private Point computeTableSize(Table table) {
Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
ColumnLayoutData layoutData= columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
if (col.addTrim) {
width += COLUMN_TRIM;
}
} else if (layoutData instanceof ColumnWeightData) {
ColumnWeightData col= (ColumnWeightData) layoutData;
width += col.minimumWidth;
} else {
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x= width;
return result;
}
代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui
private Point computeTableSize(Table table)
{
Point result = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width = 0;
int size = _columns.size();
for (int i = 0; i < size; ++i)
{
ColumnLayoutData layoutData = (ColumnLayoutData) _columns.get(i);
if (layoutData instanceof ColumnPixelData)
{
ColumnPixelData col = (ColumnPixelData) layoutData;
width += col.width;
}
else if (layoutData instanceof ColumnWeightData)
{
ColumnWeightData col = (ColumnWeightData) layoutData;
width += col.minimumWidth;
}
else
{
Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
}
}
if (width > result.x)
result.x = width;
return result;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
private void resizeProposalSelector(boolean adjustWidth) {
int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
fProposalTable.setLayoutData(data);
fProposalShell.layout(true);
fProposalShell.pack();
if (adjustWidth) {
fProposalShell.setLocation(getLocation());
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
private void resizeProposalSelector(boolean adjustWidth) {
int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
GridData data= new GridData(GridData.FILL_BOTH);
data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
fProposalTable.setLayoutData(data);
fProposalShell.layout(true);
fProposalShell.pack();
if (adjustWidth) {
fProposalShell.setLocation(getLocation());
}
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public Point computeSizeHint() {
// Resize the table's height accordingly to the new input
Table viewerTable = fTableViewer.getTable();
Point tableSize = viewerTable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int tableMaxHeight = fComposite.getDisplay().getBounds().height / 2;
// removes padding if necessary
int tableHeight = (tableSize.y <= tableMaxHeight) ? tableSize.y
- viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
: tableMaxHeight;
((GridData) viewerTable.getLayoutData()).heightHint = tableHeight;
Point fCompSize = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
fComposite.setSize(fCompSize);
return fCompSize;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt
public Point computeSizeHint() {
// Resize the table's height accordingly to the new input
Table viewerTable = fTableViewer.getTable();
Point tableSize = viewerTable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int tableMaxHeight = fComposite.getDisplay().getBounds().height / 2;
// removes padding if necessary
int tableHeight = (tableSize.y <= tableMaxHeight) ? tableSize.y
- viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
: tableMaxHeight;
((GridData) viewerTable.getLayoutData()).heightHint = tableHeight;
Point fCompSize = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
fComposite.setSize(fCompSize);
return fCompSize;
}
内容来源于网络,如有侵权,请联系作者删除!