本文整理了Java中org.eclipse.swt.widgets.Table.getBounds()
方法的一些代码示例,展示了Table.getBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getBounds()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:getBounds
暂无
代码示例来源:origin: pentaho/pentaho-kettle
resizeEvent.type = SWT.Resize;
resizeEvent.display = getDisplay();
resizeEvent.setBounds( table.getBounds() );
table.notifyListeners( SWT.Resize, resizeEvent );
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
protected int getVisibleItemCount(int top) {
int itemCount = fTable.getItemCount();
return Math.min((fTable.getBounds().height / fTable.getItemHeight()) + 2, itemCount - top);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
protected void printTable(TableItem[] itemList, GC printGC, Printer printer) {
Table table = null;
if (itemList.length > 0) {
table = itemList[0].getParent();
int topIndex = table.getTopIndex();
int itemCount = table.getItemCount();
int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
ArrayList<TableItem> items = new ArrayList<>();
// start at top index until there is no more data in the table
for (int i = topIndex; i < topIndex + numVisibleLines; i++) {
if (itemList[i].getData() != null) {
items.add(itemList[i]);
} else {
break;
}
}
super.printTable(items.toArray(new TableItem[items.size()]), printGC, printer);
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
protected String concatenateTableAsString(TableItem[] itemList) {
Table table = null;
if (itemList.length > 0) {
table = itemList[0].getParent();
int topIndex = table.getTopIndex();
int itemCount = table.getItemCount();
int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
ArrayList<TableItem> items = new ArrayList<>();
// start at top index until there is no more data in the table
for (int i = topIndex; i < topIndex + numVisibleLines; i++) {
if (itemList[i].getData() != null) {
items.add(itemList[i]);
} else {
break;
}
}
return super.concatenateTableAsString(items.toArray(new TableItem[items.size()]));
}
return IInternalDebugCoreConstants.EMPTY_STRING;
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private String getSeparatorLabel(String separatorLabel) {
Rectangle rect = list.getTable().getBounds();
int borderWidth = list.getTable().computeTrim(0, 0, 0, 0).width;
int imageWidth = WorkbenchImages.getImage(
IWorkbenchGraphicConstants.IMG_OBJ_SEPARATOR).getBounds().width;
int width = rect.width - borderWidth - imageWidth;
GC gc = new GC(list.getTable());
gc.setFont(list.getTable().getFont());
int fSeparatorWidth = gc.getAdvanceWidth('-');
int fMessageLength = gc.textExtent(separatorLabel).x;
gc.dispose();
StringBuilder dashes = new StringBuilder();
int chars = (((width - fMessageLength) / fSeparatorWidth) / 2) - 2;
for (int i = 0; i < chars; i++) {
dashes.append('-');
}
StringBuilder result = new StringBuilder();
result.append(dashes);
result.append(" " + separatorLabel + " "); //$NON-NLS-1$//$NON-NLS-2$
result.append(dashes);
return result.toString().trim();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private void fillDashLine(TableItem item) {
Rectangle bounds= item.getImageBounds(0);
Rectangle area= fTable.getBounds();
boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
(willHaveScrollBar ? fScrollbarWidth : 0)));
item.setImage(fSeparatorIcon);
item.setForeground(fDashLineColor);
item.setData(fDashLine);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private void fillDashLine(TableItem item) {
Rectangle bounds= item.getImageBounds(0);
Rectangle area= fTable.getBounds();
boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
(willHaveScrollBar ? fScrollbarWidth : 0)));
item.setImage(fSeparatorIcon);
item.setForeground(fDashLineColor);
item.setData(fDashLine);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private void fillDashLine(TableItem item) {
Rectangle bounds= item.getImageBounds(0);
Rectangle area= fTable.getBounds();
boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
(willHaveScrollBar ? fScrollbarWidth : 0)));
item.setImage(fSeparatorIcon);
item.setForeground(fDashLineColor);
item.setData(fDashLine);
}
代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui
private void fillDashLine(TableItem item) {
Rectangle bounds= item.getImageBounds(0);
Rectangle area= fTable.getBounds();
boolean willHaveScrollBar= fExpectedItemCount + 1 > fNumberOfVisibleItems;
item.setText(fDashLine.getText(area.width - bounds.x - bounds.width - fTableWidthDelta -
(willHaveScrollBar ? fScrollbarWidth : 0)));
item.setImage(fSeparatorIcon);
item.setForeground(fDashLineColor);
item.setData(fDashLine);
}
代码示例来源:origin: net.sf.okapi.steps/okapi-step-searchandreplace-ui
public void controlResized(ControlEvent e) {
int tableWidth = table.getBounds().width;
int remaining = tableWidth - table.getColumn(0).getWidth();
table.getColumn(1).setWidth(remaining/2-2);
table.getColumn(2).setWidth(remaining/2-2);
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
fTable.setSelection(new TableItem[] { fLastItem });
} else if (e.y > fTable.getBounds().height - fTable.getItemHeight() / 4) {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
fTable.setSelection(new TableItem[] { fLastItem });
} else if (e.y > fTable.getBounds().height - fTable.getItemHeight() / 4) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@Override
protected void computeInformation() {
if (fProposalTable == null || fProposalTable.isDisposed())
return;
TableItem[] selection= fProposalTable.getSelection();
if (selection != null && selection.length > 0) {
TableItem item= selection[0];
// compute information
String information= null;
Object d= item.getData();
if (d instanceof ICompletionProposal) {
ICompletionProposal p= (ICompletionProposal) d;
information= p.getAdditionalProposalInfo();
}
if (d instanceof ICompletionProposalExtension3)
setCustomInformationControlCreator(((ICompletionProposalExtension3) d).getInformationControlCreator());
else
setCustomInformationControlCreator(null);
// compute subject area
setMargins(4, -1);
Rectangle area= fProposalTable.getBounds();
area.x= 0; // subject area is the whole subject control
area.y= 0;
// set information & subject area
setInformation(information, area);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
@Override
protected void computeInformation() {
if (fProposalTable == null || fProposalTable.isDisposed())
return;
TableItem[] selection= fProposalTable.getSelection();
if (selection != null && selection.length > 0) {
TableItem item= selection[0];
// compute information
String information= null;
Object d= item.getData();
if (d instanceof ICompletionProposal) {
ICompletionProposal p= (ICompletionProposal) d;
information= p.getAdditionalProposalInfo();
}
if (d instanceof ICompletionProposalExtension3)
setCustomInformationControlCreator(((ICompletionProposalExtension3) d).getInformationControlCreator());
else
setCustomInformationControlCreator(null);
// compute subject area
setMargins(4, -1);
Rectangle area= fProposalTable.getBounds();
area.x= 0; // subject area is the whole subject control
area.y= 0;
// set information & subject area
setInformation(information, area);
}
}
代码示例来源:origin: openaudible/openaudible
w = t.getBounds().width;
int amt = 23;
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
int lastY = 0;
int itemHeightdiv4 = table.getItemHeight() / 4;
int tableHeight = table.getBounds().height;
Point tableLoc = table.toDisplay(0, 0);
int divCount = 0;
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
dialog.pack();
Rectangle tableBounds = table.getBounds();
tableBounds.height = Math.min(tableBounds.height, table.getItemHeight() * MAX_ITEMS);
table.setBounds(tableBounds);
代码示例来源:origin: openaudible/openaudible
w = t.getBounds().width;
int amt = 23;
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt
int lastY = 0;
int itemHeightdiv4 = table.getItemHeight() / 4;
int tableHeight = table.getBounds().height;
Point tableLoc = table.toDisplay(0, 0);
int divCount = 0;
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
dialog.pack();
Rectangle tableBounds = table.getBounds();
tableBounds.height = Math.min(tableBounds.height, table.getItemHeight()
内容来源于网络,如有侵权,请联系作者删除!