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

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

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

Table.getSize介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

  1. protected int getTableWidth( Table table ) {
  2. int width = table.getSize().x - 2;
  3. if ( table.getVerticalBar() != null && table.getVerticalBar().isVisible() ) {
  4. width -= table.getVerticalBar().getSize().x;
  5. }
  6. return width;
  7. }

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.sqm.fe.ui

  1. public void handleEvent(Event e) {
  2. int weights[] = new int[] { 2, 4 };
  3. int weightsum = 0;
  4. for (int i = 0; i < weights.length; i++) {
  5. weightsum += weights[i];
  6. }
  7. TableColumn[] cols = summaryTable.getColumns();
  8. int count = java.lang.Math.min(weights.length, cols.length);
  9. int tablewidth = summaryTable.getSize().x;
  10. for (int i = 0; i < count; i++) {
  11. cols[i].setWidth(tablewidth * weights[i] / weightsum);
  12. }
  13. }
  14. });

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

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. int size = table.getSize().x;
  4. locationColumn.setWidth(size / 6 * 5);
  5. enabledColumn.setWidth(size / 6 * 1);
  6. }

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

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. int size = table.getSize().x;
  4. locationColumn.setWidth(size / 6 * 5);
  5. enabledColumn.setWidth(size / 6 * 1);
  6. }

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

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. int size = table.getSize().x;
  4. column1.setWidth(size / 7 * 4);
  5. levelColumnEditor.setWidth(size / 7 * 2);
  6. autoColumnEditor.setWidth(size / 7 * 1);
  7. }

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

  1. public void handleEvent(Event event)
  2. {
  3. Table table = constraintsTableViewer.getTable();
  4. if (event.type == SWT.Resize && event.widget == table)
  5. {
  6. TableColumn tableColumn = table.getColumn(0);
  7. tableColumn.setWidth(table.getSize().x);
  8. }
  9. }

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

  1. public void handleEvent(Event event)
  2. {
  3. Table table = enumerationsTable.getTable();
  4. if (event.type == SWT.Resize && event.widget == table)
  5. {
  6. TableColumn tableColumn = table.getColumn(0);
  7. tableColumn.setWidth(table.getSize().x);
  8. }
  9. }

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

  1. @Override
  2. public void controlResized(ControlEvent e) {
  3. int size = table.getSize().x;
  4. nameColumn.setWidth(size / 9 * 3);
  5. valueColumn.setWidth(size / 9 * 4);
  6. osColumn.setWidth(size / 9 * 1);
  7. archColumn.setWidth(size / 9 * 1);
  8. }

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

  1. @Override
  2. public void shellActivated(ShellEvent e) {
  3. if (!table.isDisposed()) {
  4. int tableWidth = table.getSize().x;
  5. if (tableWidth > 0) {
  6. int c1 = tableWidth / 3;
  7. column1.setWidth(c1);
  8. column2.setWidth(tableWidth - c1);
  9. }
  10. getShell().removeShellListener(this);
  11. }
  12. }
  13. });

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

  1. @Override
  2. public IStatus runInUIThread(IProgressMonitor monitor) {
  3. Table table = getTable();
  4. if (!table.isDisposed()) {
  5. // if table size is zero, the rendering has not been
  6. // made visible
  7. // cannot pack until the rendering is visible
  8. if (table.getSize().x > 0) {
  9. TableColumn[] columns = table.getColumns();
  10. for (int i = 0; i < columns.length - 1; i++) {
  11. columns[i].pack();
  12. }
  13. } else {
  14. fPendingResizeColumns = true;
  15. }
  16. }
  17. return Status.OK_STATUS;
  18. }
  19. };

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

  1. @Override
  2. protected void layout(Composite composite, boolean flushCache) {
  3. Rectangle area= composite.getClientArea();
  4. Table table= getTable(composite);
  5. int tableWidth= table.getSize().x;
  6. int trim= computeTrim(area, table, tableWidth);
  7. int width= Math.max(0, area.width - trim);
  8. if (width > 1)
  9. layoutTable(table, width, area, tableWidth < area.width);
  10. if( composite.getData(RECALCULATE_LAYOUT) == null ) {
  11. composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
  12. composite.layout();
  13. }
  14. }

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

  1. protected void layout(Composite composite, boolean flushCache) {
  2. Rectangle area= composite.getClientArea();
  3. Table table= getTable(composite);
  4. int tableWidth= table.getSize().x;
  5. int trim= computeTrim(area, table, tableWidth);
  6. int width= Math.max(0, area.width - trim);
  7. if (width > 1)
  8. layoutTable(table, width, area, tableWidth < area.width);
  9. if( composite.getData(RECALCULATE_LAYOUT) == null ) {
  10. composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
  11. composite.layout();
  12. }
  13. }

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

  1. @Override
  2. protected void layout(Composite composite, boolean flushCache) {
  3. Rectangle area= composite.getClientArea();
  4. Table table= getTable(composite);
  5. int tableWidth= table.getSize().x;
  6. int trim= computeTrim(area, table, tableWidth);
  7. int width= Math.max(0, area.width - trim);
  8. if (width > 1)
  9. layoutTable(table, width, area, tableWidth < area.width);
  10. if( composite.getData(RECALCULATE_LAYOUT) == null ) {
  11. composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
  12. composite.layout();
  13. }
  14. }

代码示例来源: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/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.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.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.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.rap/org.eclipse.rap.rwt

  1. @Override
  2. void notifyResize( Point oldSize ) {
  3. if( !oldSize.equals( getSize() ) && !TextSizeUtil.isTemporaryResize() ) {
  4. if( ( style & SWT.VIRTUAL ) != 0 ) {
  5. checkData();
  6. }
  7. clearItemsTextWidths();
  8. updateScrollBars();
  9. adjustTopIndex();
  10. }
  11. super.notifyResize( oldSize );
  12. }

代码示例来源: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. });

相关文章

Table类方法