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

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

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

Table.computeSize介绍

暂无

代码示例

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

  1. protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
  2. Table table = (Table) composite;
  3. Point result = table.computeSize(wHint, hHint, flushCache);
  4. return result;
  5. }

代码示例来源:origin: com.diffplug.durian/durian-swt

  1. @Override
  2. protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
  3. return table.computeSize(wHint, hHint);
  4. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. @Override
  2. public Point computeSize (int wHint, int hHint, boolean changed) {
  3. checkWidget();
  4. return table.computeSize (wHint, hHint, changed);
  5. }
  6. @Override

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. public Point computeSize (int wHint, int hHint, boolean changed) {
  2. checkWidget();
  3. return table.computeSize (wHint, hHint, changed);
  4. }
  5. public Rectangle computeTrim (int x, int y, int width, int height) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. @Override
  2. public Point computeSize (int wHint, int hHint, boolean changed) {
  3. checkWidget();
  4. return table.computeSize (wHint, hHint, changed);
  5. }
  6. @Override

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. @Override
  2. public Point computeSize (int wHint, int hHint, boolean changed) {
  3. checkWidget();
  4. return table.computeSize (wHint, hHint, changed);
  5. }
  6. @Override

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. @Override
  2. public Point computeSize (int wHint, int hHint, boolean changed) {
  3. checkWidget();
  4. return table.computeSize (wHint, hHint, changed);
  5. }
  6. @Override

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

  1. Point computeTableSize(Table table) {
  2. Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. } else if (layoutData instanceof ColumnWeightData) {
  11. ColumnWeightData col= (ColumnWeightData) layoutData;
  12. width += col.minimumWidth;
  13. } else {
  14. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  15. }
  16. }
  17. if (width > result.x)
  18. result.x= width;
  19. return result;
  20. }

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

  1. private Point computeTableSize(Table table, int wHint, int hHint) {
  2. Point result= table.computeSize(wHint, hHint);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col= (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x= width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table) {
  2. Point result = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  3. int width = 0;
  4. int size = columns.size();
  5. for (int i = 0; i < size; ++i) {
  6. ColumnLayoutData layoutData = (ColumnLayoutData) columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col = (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col = (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x = width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table, int wHint, int hHint) {
  2. Point result= table.computeSize(wHint, hHint);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col= (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x= width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table) {
  2. Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col= (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x= width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table, int wHint, int hHint) {
  2. Point result= table.computeSize(wHint, hHint);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col= (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x= width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table) {
  2. Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col= (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x= width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table) {
  2. Point result= table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  3. int width= 0;
  4. int size= columns.size();
  5. for (int i= 0; i < size; ++i) {
  6. ColumnLayoutData layoutData= columns.get(i);
  7. if (layoutData instanceof ColumnPixelData) {
  8. ColumnPixelData col= (ColumnPixelData) layoutData;
  9. width += col.width;
  10. if (col.addTrim) {
  11. width += COLUMN_TRIM;
  12. }
  13. } else if (layoutData instanceof ColumnWeightData) {
  14. ColumnWeightData col= (ColumnWeightData) layoutData;
  15. width += col.minimumWidth;
  16. } else {
  17. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  18. }
  19. }
  20. if (width > result.x)
  21. result.x= width;
  22. return result;
  23. }

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

  1. private Point computeTableSize(Table table)
  2. {
  3. Point result = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  4. int width = 0;
  5. int size = _columns.size();
  6. for (int i = 0; i < size; ++i)
  7. {
  8. ColumnLayoutData layoutData = (ColumnLayoutData) _columns.get(i);
  9. if (layoutData instanceof ColumnPixelData)
  10. {
  11. ColumnPixelData col = (ColumnPixelData) layoutData;
  12. width += col.width;
  13. }
  14. else if (layoutData instanceof ColumnWeightData)
  15. {
  16. ColumnWeightData col = (ColumnWeightData) layoutData;
  17. width += col.minimumWidth;
  18. }
  19. else
  20. {
  21. Assert.isTrue(false, "Unknown column layout data"); //$NON-NLS-1$
  22. }
  23. }
  24. if (width > result.x)
  25. result.x = width;
  26. return result;
  27. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

  1. private void resizeProposalSelector(boolean adjustWidth) {
  2. int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
  3. Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
  4. GridData data= new GridData(GridData.FILL_BOTH);
  5. data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
  6. data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
  7. fProposalTable.setLayoutData(data);
  8. fProposalShell.layout(true);
  9. fProposalShell.pack();
  10. if (adjustWidth) {
  11. fProposalShell.setLocation(getLocation());
  12. }
  13. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

  1. private void resizeProposalSelector(boolean adjustWidth) {
  2. int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint;
  3. Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true);
  4. GridData data= new GridData(GridData.FILL_BOTH);
  5. data.widthHint= adjustWidth ? Math.min(size.x, 300) : width;
  6. data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10));
  7. fProposalTable.setLayoutData(data);
  8. fProposalShell.layout(true);
  9. fProposalShell.pack();
  10. if (adjustWidth) {
  11. fProposalShell.setLocation(getLocation());
  12. }
  13. }

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

  1. public Point computeSizeHint() {
  2. // Resize the table's height accordingly to the new input
  3. Table viewerTable = fTableViewer.getTable();
  4. Point tableSize = viewerTable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  5. int tableMaxHeight = fComposite.getDisplay().getBounds().height / 2;
  6. // removes padding if necessary
  7. int tableHeight = (tableSize.y <= tableMaxHeight) ? tableSize.y
  8. - viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
  9. : tableMaxHeight;
  10. ((GridData) viewerTable.getLayoutData()).heightHint = tableHeight;
  11. Point fCompSize = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  12. fComposite.setSize(fCompSize);
  13. return fCompSize;
  14. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

  1. public Point computeSizeHint() {
  2. // Resize the table's height accordingly to the new input
  3. Table viewerTable = fTableViewer.getTable();
  4. Point tableSize = viewerTable.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  5. int tableMaxHeight = fComposite.getDisplay().getBounds().height / 2;
  6. // removes padding if necessary
  7. int tableHeight = (tableSize.y <= tableMaxHeight) ? tableSize.y
  8. - viewerTable.getItemHeight() - viewerTable.getItemHeight() / 2
  9. : tableMaxHeight;
  10. ((GridData) viewerTable.getLayoutData()).heightHint = tableHeight;
  11. Point fCompSize = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
  12. fComposite.setSize(fCompSize);
  13. return fCompSize;
  14. }

相关文章

Table类方法