org.eclipse.swt.widgets.Table.getBorderWidth()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中org.eclipse.swt.widgets.Table.getBorderWidth()方法的一些代码示例,展示了Table.getBorderWidth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getBorderWidth()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getBorderWidth

Table.getBorderWidth介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. Rectangle area= getClientArea();
  4. Table table= (Table)getChildren()[0];
  5. Point preferredSize= computeTableSize(table);
  6. int width= area.width - 2 * table.getBorderWidth();
  7. if (preferredSize.y > area.height) {
  8. // Subtract the scrollbar width from the total column width
  9. // if a vertical scrollbar will be required
  10. Point vBarSize = table.getVerticalBar().getSize();
  11. width -= vBarSize.x;
  12. }
  13. layoutTable(table, width, area, table.getSize().x < area.width);
  14. }
  15. });

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

  1. public void controlResized(ControlEvent e) {
  2. Rectangle area= getClientArea();
  3. Table table= (Table)getChildren()[0];
  4. Point preferredSize= computeTableSize(table);
  5. int width= area.width - 2 * table.getBorderWidth();
  6. if (preferredSize.y > area.height) {
  7. // Subtract the scrollbar width from the total column width
  8. // if a vertical scrollbar will be required
  9. Point vBarSize = table.getVerticalBar().getSize();
  10. width -= vBarSize.x;
  11. }
  12. layoutTable(table, width, area, table.getSize().x < area.width);
  13. }
  14. });

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. Rectangle area= getClientArea();
  4. Table table= (Table)getChildren()[0];
  5. Point preferredSize= computeTableSize(table);
  6. int width= area.width - 2 * table.getBorderWidth();
  7. if (preferredSize.y > area.height) {
  8. // Subtract the scrollbar width from the total column width
  9. // if a vertical scrollbar will be required
  10. Point vBarSize = table.getVerticalBar().getSize();
  11. width -= vBarSize.x;
  12. }
  13. layoutTable(table, width, area, table.getSize().x < area.width);
  14. }
  15. });

代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui

  1. public void controlResized(ControlEvent e)
  2. {
  3. Rectangle area = getClientArea();
  4. Table table = (Table) getChildren()[0];
  5. Point preferredSize = computeTableSize(table);
  6. int width = area.width - 2 * table.getBorderWidth();
  7. if (preferredSize.y > area.height)
  8. {
  9. // Subtract the scrollbar width from the total column width
  10. // if a vertical scrollbar will be required
  11. Point vBarSize = table.getVerticalBar().getSize();
  12. width -= vBarSize.x;
  13. }
  14. layoutTable(table, width, area, table.getSize().x < area.width);
  15. }
  16. }

代码示例来源:origin: org.eclipse.xtext/ui

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. Rectangle area = getClientArea();
  4. Table table = (Table) getChildren()[0];
  5. Point preferredSize = computeTableSize(table);
  6. int width = area.width - 2 * table.getBorderWidth();
  7. if (preferredSize.y > area.height) {
  8. // Subtract the scrollbar width from the total column
  9. // width
  10. // if a vertical scrollbar will be required
  11. Point vBarSize = table.getVerticalBar().getSize();
  12. width -= vBarSize.x;
  13. }
  14. layoutTable(table, width, area,
  15. table.getSize().x < area.width);
  16. }
  17. });

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.workbench.texteditor

  1. private int computeTrim(Rectangle area, Table table, int tableWidth) {
  2. Point preferredSize= computeTableSize(table, area.width, area.height);
  3. int trim;
  4. if (tableWidth > 1) {
  5. trim= tableWidth - table.getClientArea().width;
  6. } else {
  7. // initially, the table has no extend and no client area - use the border with
  8. // plus some padding as educated guess
  9. trim= 2 * table.getBorderWidth() + 1 ;
  10. }
  11. if (preferredSize.y > area.height) {
  12. // Subtract the scrollbar width from the total column width
  13. // if a vertical scrollbar will be required, but is not currently showing
  14. // (in which case it is already subtracted above)
  15. ScrollBar vBar= table.getVerticalBar();
  16. if (!vBar.isVisible()) {
  17. Point vBarSize= vBar.getSize();
  18. trim += vBarSize.x;
  19. }
  20. }
  21. return trim;
  22. }

代码示例来源:origin: org.eclipse/org.eclipse.ui.workbench.texteditor

  1. private int computeTrim(Rectangle area, Table table, int tableWidth) {
  2. Point preferredSize= computeTableSize(table, area.width, area.height);
  3. int trim;
  4. if (tableWidth > 1) {
  5. trim= tableWidth - table.getClientArea().width;
  6. } else {
  7. // initially, the table has no extend and no client area - use the border with
  8. // plus some padding as educated guess
  9. trim= 2 * table.getBorderWidth() + 1 ;
  10. }
  11. if (preferredSize.y > area.height) {
  12. // Subtract the scrollbar width from the total column width
  13. // if a vertical scrollbar will be required, but is not currently showing
  14. // (in which case it is already subtracted above)
  15. ScrollBar vBar= table.getVerticalBar();
  16. if (!vBar.isVisible()) {
  17. Point vBarSize= vBar.getSize();
  18. trim += vBarSize.x;
  19. }
  20. }
  21. return trim;
  22. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

  1. private int computeTrim(Rectangle area, Table table, int tableWidth) {
  2. Point preferredSize= computeTableSize(table, area.width, area.height);
  3. int trim;
  4. if (tableWidth > 1) {
  5. trim= tableWidth - table.getClientArea().width;
  6. } else {
  7. // initially, the table has no extend and no client area - use the border with
  8. // plus some padding as educated guess
  9. trim= 2 * table.getBorderWidth() + 1 ;
  10. }
  11. if (preferredSize.y > area.height) {
  12. // Subtract the scrollbar width from the total column width
  13. // if a vertical scrollbar will be required, but is not currently showing
  14. // (in which case it is already subtracted above)
  15. ScrollBar vBar= table.getVerticalBar();
  16. if (!vBar.isVisible()) {
  17. Point vBarSize= vBar.getSize();
  18. trim += vBarSize.x;
  19. }
  20. }
  21. return trim;
  22. }

代码示例来源:origin: oyse/yedit

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. Rectangle area= getClientArea();
  4. Table table= (Table)getChildren()[0];
  5. Point preferredSize= computeTableSize(table);
  6. int width= area.width - 2 * table.getBorderWidth();
  7. if (preferredSize.y > area.height) {
  8. // Subtract the scrollbar width from the total column width
  9. // if a vertical scrollbar will be required
  10. Point vBarSize = table.getVerticalBar().getSize();
  11. width -= vBarSize.x;
  12. }
  13. layoutTable(table, width, area, table.getSize().x < area.width);
  14. }
  15. });

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

  1. public void renderInitialization( final Widget widget ) throws IOException {
  2. final Table table = ( Table )widget;
  3. JSWriter writer = JSWriter.getWriterFor( table );
  4. String style = "";
  5. if( ( table.getStyle() & SWT.CHECK ) != 0 ) {
  6. style = "check";
  7. }
  8. if( ( table.getStyle() & SWT.MULTI ) != 0 ) {
  9. style += "|multi";
  10. }
  11. if( ( table.getStyle() & SWT.HIDE_SELECTION ) != 0 ) {
  12. style += "|hideSelection";
  13. }
  14. if( ( table.getStyle() & SWT.NO_SCROLL ) != 0 ) {
  15. style += "|noScroll";
  16. }
  17. Object[] args = new Object[] { WidgetUtil.getId( table ), style };
  18. writer.newWidget( "org.eclipse.swt.widgets.Table", args );
  19. ControlLCAUtil.writeStyleFlags( table );
  20. writer.set( "borderWidth", table.getBorderWidth() );
  21. }

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

  1. public void controlResized(ControlEvent e) {
  2. Rectangle area = parent.getClientArea();
  3. Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  4. int width = area.width - 2 * table.getBorderWidth();
  5. if (preferredSize.y > area.height) {
  6. // Subtract the scrollbar width from the total column
  7. // width
  8. // if a vertical scrollbar will be required
  9. Point vBarSize = table.getVerticalBar().getSize();
  10. width -= vBarSize.x;
  11. }
  12. Point oldSize = table.getSize();
  13. if (oldSize.x > width) {
  14. // table is getting smaller so make the columns
  15. // smaller first and then resize the table to
  16. // match the client area width
  17. column1.setWidth(width / 2);
  18. column2.setWidth(width / 2);
  19. table.setSize(width, area.height);
  20. }
  21. else {
  22. // table is getting bigger so make the table
  23. // bigger first and then make the columns wider
  24. // to match the client area width
  25. table.setSize(width, area.height);
  26. column1.setWidth(width / 2);
  27. column2.setWidth(width / 2);
  28. }
  29. }
  30. });

代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

  1. public void controlResized(ControlEvent e) {
  2. Rectangle area = handlersComp.getClientArea();
  3. Point preferredSize = handlersTable_.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  4. int width = area.width - 2*handlersTable_.getBorderWidth()-10;
  5. if (preferredSize.y > area.height + handlersTable_.getHeaderHeight()) {
  6. // Subtract the scrollbar width from the total column width
  7. // if a vertical scrollbar will be required
  8. Point vBarSize = handlersTable_.getVerticalBar().getSize();
  9. width -= vBarSize.x;
  10. }
  11. Point oldSize = handlersTable_.getSize();
  12. if (oldSize.x > area.width) {
  13. // table is getting smaller so make the columns
  14. // smaller first and then resize the table to
  15. // match the client area width
  16. tableCols[0].setWidth(width/2);
  17. tableCols[1].setWidth(width - tableCols[0].getWidth());
  18. handlersTable_.setSize(area.width, area.height);
  19. } else {
  20. // table is getting bigger so make the table
  21. // bigger first and then make the columns wider
  22. // to match the client area width
  23. handlersTable_.setSize(area.width, area.height);
  24. tableCols[0].setWidth(width/2);
  25. tableCols[1].setWidth(width - tableCols[0].getWidth());
  26. }
  27. }
  28. });

代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

  1. public void controlResized(ControlEvent e) {
  2. Rectangle area = handlersComp.getClientArea();
  3. Point preferredSize = handlersTable_.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  4. int width = area.width - 2 * handlersTable_.getBorderWidth() - 10;
  5. if (preferredSize.y > area.height + handlersTable_.getHeaderHeight()) {

相关文章

Table类方法