本文整理了Java中org.eclipse.swt.widgets.Table.getBorderWidth()
方法的一些代码示例,展示了Table.getBorderWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getBorderWidth()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getBorderWidth
暂无
代码示例来源: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/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.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/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.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.scout.sdk.deps/org.eclipse.ui.workbench.texteditor
private int computeTrim(Rectangle area, Table table, int tableWidth) {
Point preferredSize= computeTableSize(table, area.width, area.height);
int trim;
if (tableWidth > 1) {
trim= tableWidth - table.getClientArea().width;
} else {
// initially, the table has no extend and no client area - use the border with
// plus some padding as educated guess
trim= 2 * table.getBorderWidth() + 1 ;
}
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required, but is not currently showing
// (in which case it is already subtracted above)
ScrollBar vBar= table.getVerticalBar();
if (!vBar.isVisible()) {
Point vBarSize= vBar.getSize();
trim += vBarSize.x;
}
}
return trim;
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor
private int computeTrim(Rectangle area, Table table, int tableWidth) {
Point preferredSize= computeTableSize(table, area.width, area.height);
int trim;
if (tableWidth > 1) {
trim= tableWidth - table.getClientArea().width;
} else {
// initially, the table has no extend and no client area - use the border with
// plus some padding as educated guess
trim= 2 * table.getBorderWidth() + 1 ;
}
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required, but is not currently showing
// (in which case it is already subtracted above)
ScrollBar vBar= table.getVerticalBar();
if (!vBar.isVisible()) {
Point vBarSize= vBar.getSize();
trim += vBarSize.x;
}
}
return trim;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor
private int computeTrim(Rectangle area, Table table, int tableWidth) {
Point preferredSize= computeTableSize(table, area.width, area.height);
int trim;
if (tableWidth > 1) {
trim= tableWidth - table.getClientArea().width;
} else {
// initially, the table has no extend and no client area - use the border with
// plus some padding as educated guess
trim= 2 * table.getBorderWidth() + 1 ;
}
if (preferredSize.y > area.height) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required, but is not currently showing
// (in which case it is already subtracted above)
ScrollBar vBar= table.getVerticalBar();
if (!vBar.isVisible()) {
Point vBarSize= vBar.getSize();
trim += vBarSize.x;
}
}
return trim;
}
代码示例来源: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);
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public void renderInitialization( final Widget widget ) throws IOException {
final Table table = ( Table )widget;
JSWriter writer = JSWriter.getWriterFor( table );
String style = "";
if( ( table.getStyle() & SWT.CHECK ) != 0 ) {
style = "check";
}
if( ( table.getStyle() & SWT.MULTI ) != 0 ) {
style += "|multi";
}
if( ( table.getStyle() & SWT.HIDE_SELECTION ) != 0 ) {
style += "|hideSelection";
}
if( ( table.getStyle() & SWT.NO_SCROLL ) != 0 ) {
style += "|noScroll";
}
Object[] args = new Object[] { WidgetUtil.getId( table ), style };
writer.newWidget( "org.eclipse.swt.widgets.Table", args );
ControlLCAUtil.writeStyleFlags( table );
writer.set( "borderWidth", table.getBorderWidth() );
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
public void controlResized(ControlEvent e) {
Rectangle area = parent.getClientArea();
Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
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;
}
Point oldSize = table.getSize();
if (oldSize.x > width) {
// table is getting smaller so make the columns
// smaller first and then resize the table to
// match the client area width
column1.setWidth(width / 2);
column2.setWidth(width / 2);
table.setSize(width, area.height);
}
else {
// table is getting bigger so make the table
// bigger first and then make the columns wider
// to match the client area width
table.setSize(width, area.height);
column1.setWidth(width / 2);
column2.setWidth(width / 2);
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void controlResized(ControlEvent e) {
Rectangle area = handlersComp.getClientArea();
Point preferredSize = handlersTable_.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width = area.width - 2*handlersTable_.getBorderWidth()-10;
if (preferredSize.y > area.height + handlersTable_.getHeaderHeight()) {
// Subtract the scrollbar width from the total column width
// if a vertical scrollbar will be required
Point vBarSize = handlersTable_.getVerticalBar().getSize();
width -= vBarSize.x;
}
Point oldSize = handlersTable_.getSize();
if (oldSize.x > area.width) {
// table is getting smaller so make the columns
// smaller first and then resize the table to
// match the client area width
tableCols[0].setWidth(width/2);
tableCols[1].setWidth(width - tableCols[0].getWidth());
handlersTable_.setSize(area.width, area.height);
} else {
// table is getting bigger so make the table
// bigger first and then make the columns wider
// to match the client area width
handlersTable_.setSize(area.width, area.height);
tableCols[0].setWidth(width/2);
tableCols[1].setWidth(width - tableCols[0].getWidth());
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void controlResized(ControlEvent e) {
Rectangle area = handlersComp.getClientArea();
Point preferredSize = handlersTable_.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int width = area.width - 2 * handlersTable_.getBorderWidth() - 10;
if (preferredSize.y > area.height + handlersTable_.getHeaderHeight()) {
内容来源于网络,如有侵权,请联系作者删除!