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

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

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

Table.getBounds介绍

暂无

代码示例

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

  1. resizeEvent.type = SWT.Resize;
  2. resizeEvent.display = getDisplay();
  3. resizeEvent.setBounds( table.getBounds() );
  4. table.notifyListeners( SWT.Resize, resizeEvent );

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

  1. protected int getVisibleItemCount(int top) {
  2. int itemCount = fTable.getItemCount();
  3. return Math.min((fTable.getBounds().height / fTable.getItemHeight()) + 2, itemCount - top);
  4. }

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

  1. @Override
  2. protected void printTable(TableItem[] itemList, GC printGC, Printer printer) {
  3. Table table = null;
  4. if (itemList.length > 0) {
  5. table = itemList[0].getParent();
  6. int topIndex = table.getTopIndex();
  7. int itemCount = table.getItemCount();
  8. int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
  9. ArrayList<TableItem> items = new ArrayList<>();
  10. // start at top index until there is no more data in the table
  11. for (int i = topIndex; i < topIndex + numVisibleLines; i++) {
  12. if (itemList[i].getData() != null) {
  13. items.add(itemList[i]);
  14. } else {
  15. break;
  16. }
  17. }
  18. super.printTable(items.toArray(new TableItem[items.size()]), printGC, printer);
  19. }
  20. }
  21. }

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

  1. @Override
  2. protected String concatenateTableAsString(TableItem[] itemList) {
  3. Table table = null;
  4. if (itemList.length > 0) {
  5. table = itemList[0].getParent();
  6. int topIndex = table.getTopIndex();
  7. int itemCount = table.getItemCount();
  8. int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
  9. ArrayList<TableItem> items = new ArrayList<>();
  10. // start at top index until there is no more data in the table
  11. for (int i = topIndex; i < topIndex + numVisibleLines; i++) {
  12. if (itemList[i].getData() != null) {
  13. items.add(itemList[i]);
  14. } else {
  15. break;
  16. }
  17. }
  18. return super.concatenateTableAsString(items.toArray(new TableItem[items.size()]));
  19. }
  20. return IInternalDebugCoreConstants.EMPTY_STRING;
  21. }
  22. }

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

  1. private String getSeparatorLabel(String separatorLabel) {
  2. Rectangle rect = list.getTable().getBounds();
  3. int borderWidth = list.getTable().computeTrim(0, 0, 0, 0).width;
  4. int imageWidth = WorkbenchImages.getImage(
  5. IWorkbenchGraphicConstants.IMG_OBJ_SEPARATOR).getBounds().width;
  6. int width = rect.width - borderWidth - imageWidth;
  7. GC gc = new GC(list.getTable());
  8. gc.setFont(list.getTable().getFont());
  9. int fSeparatorWidth = gc.getAdvanceWidth('-');
  10. int fMessageLength = gc.textExtent(separatorLabel).x;
  11. gc.dispose();
  12. StringBuilder dashes = new StringBuilder();
  13. int chars = (((width - fMessageLength) / fSeparatorWidth) / 2) - 2;
  14. for (int i = 0; i < chars; i++) {
  15. dashes.append('-');
  16. }
  17. StringBuilder result = new StringBuilder();
  18. result.append(dashes);
  19. result.append(" " + separatorLabel + " "); //$NON-NLS-1$//$NON-NLS-2$
  20. result.append(dashes);
  21. return result.toString().trim();
  22. }

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

  1. private void fillDashLine(TableItem item) {
  2. Rectangle bounds= item.getImageBounds(0);
  3. Rectangle area= fTable.getBounds();
  4. boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
  5. item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
  6. (willHaveScrollBar ? fScrollbarWidth : 0)));
  7. item.setImage(fSeparatorIcon);
  8. item.setForeground(fDashLineColor);
  9. item.setData(fDashLine);
  10. }

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

  1. private void fillDashLine(TableItem item) {
  2. Rectangle bounds= item.getImageBounds(0);
  3. Rectangle area= fTable.getBounds();
  4. boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
  5. item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
  6. (willHaveScrollBar ? fScrollbarWidth : 0)));
  7. item.setImage(fSeparatorIcon);
  8. item.setForeground(fDashLineColor);
  9. item.setData(fDashLine);
  10. }

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

  1. private void fillDashLine(TableItem item) {
  2. Rectangle bounds= item.getImageBounds(0);
  3. Rectangle area= fTable.getBounds();
  4. boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
  5. item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
  6. (willHaveScrollBar ? fScrollbarWidth : 0)));
  7. item.setImage(fSeparatorIcon);
  8. item.setForeground(fDashLineColor);
  9. item.setData(fDashLine);
  10. }

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

  1. private void fillDashLine(TableItem item) {
  2. Rectangle bounds= item.getImageBounds(0);
  3. Rectangle area= fTable.getBounds();
  4. boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
  5. item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
  6. (willHaveScrollBar ? fScrollbarWidth : 0)));
  7. item.setImage(fSeparatorIcon);
  8. item.setForeground(fDashLineColor);
  9. item.setData(fDashLine);
  10. }

代码示例来源:origin: net.sf.okapi.steps/okapi-step-searchandreplace-ui

  1. public void controlResized(ControlEvent e) {
  2. int tableWidth = table.getBounds().width;
  3. int remaining = tableWidth - table.getColumn(0).getWidth();
  4. table.getColumn(1).setWidth(remaining/2-2);
  5. table.getColumn(2).setWidth(remaining/2-2);
  6. }
  7. });

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

  1. fTable.setSelection(new TableItem[] { fLastItem });
  2. } else if (e.y > fTable.getBounds().height - fTable.getItemHeight() / 4) {

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

  1. fTable.setSelection(new TableItem[] { fLastItem });
  2. } else if (e.y > fTable.getBounds().height - fTable.getItemHeight() / 4) {

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

  1. @Override
  2. protected void computeInformation() {
  3. if (fProposalTable == null || fProposalTable.isDisposed())
  4. return;
  5. TableItem[] selection= fProposalTable.getSelection();
  6. if (selection != null && selection.length > 0) {
  7. TableItem item= selection[0];
  8. // compute information
  9. String information= null;
  10. Object d= item.getData();
  11. if (d instanceof ICompletionProposal) {
  12. ICompletionProposal p= (ICompletionProposal) d;
  13. information= p.getAdditionalProposalInfo();
  14. }
  15. if (d instanceof ICompletionProposalExtension3)
  16. setCustomInformationControlCreator(((ICompletionProposalExtension3) d).getInformationControlCreator());
  17. else
  18. setCustomInformationControlCreator(null);
  19. // compute subject area
  20. setMargins(4, -1);
  21. Rectangle area= fProposalTable.getBounds();
  22. area.x= 0; // subject area is the whole subject control
  23. area.y= 0;
  24. // set information & subject area
  25. setInformation(information, area);
  26. }
  27. }

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

  1. @Override
  2. protected void computeInformation() {
  3. if (fProposalTable == null || fProposalTable.isDisposed())
  4. return;
  5. TableItem[] selection= fProposalTable.getSelection();
  6. if (selection != null && selection.length > 0) {
  7. TableItem item= selection[0];
  8. // compute information
  9. String information= null;
  10. Object d= item.getData();
  11. if (d instanceof ICompletionProposal) {
  12. ICompletionProposal p= (ICompletionProposal) d;
  13. information= p.getAdditionalProposalInfo();
  14. }
  15. if (d instanceof ICompletionProposalExtension3)
  16. setCustomInformationControlCreator(((ICompletionProposalExtension3) d).getInformationControlCreator());
  17. else
  18. setCustomInformationControlCreator(null);
  19. // compute subject area
  20. setMargins(4, -1);
  21. Rectangle area= fProposalTable.getBounds();
  22. area.x= 0; // subject area is the whole subject control
  23. area.y= 0;
  24. // set information & subject area
  25. setInformation(information, area);
  26. }
  27. }

代码示例来源:origin: openaudible/openaudible

  1. w = t.getBounds().width;
  2. int amt = 23;

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

  1. int lastY = 0;
  2. int itemHeightdiv4 = table.getItemHeight() / 4;
  3. int tableHeight = table.getBounds().height;
  4. Point tableLoc = table.toDisplay(0, 0);
  5. int divCount = 0;

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

  1. dialog.pack();
  2. Rectangle tableBounds = table.getBounds();
  3. tableBounds.height = Math.min(tableBounds.height, table.getItemHeight() * MAX_ITEMS);
  4. table.setBounds(tableBounds);

代码示例来源:origin: openaudible/openaudible

  1. w = t.getBounds().width;
  2. int amt = 23;

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

  1. int lastY = 0;
  2. int itemHeightdiv4 = table.getItemHeight() / 4;
  3. int tableHeight = table.getBounds().height;
  4. Point tableLoc = table.toDisplay(0, 0);
  5. int divCount = 0;

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

  1. dialog.pack();
  2. Rectangle tableBounds = table.getBounds();
  3. tableBounds.height = Math.min(tableBounds.height, table.getItemHeight()

相关文章

Table类方法