Java Code Examples for org.eclipse.swt.widgets.TableItem#getBounds()
The following examples show how to use
org.eclipse.swt.widgets.TableItem#getBounds() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UiUtils.java From xds-ide with Eclipse Public License 1.0 | 6 votes |
public static int getClickedItemColumnIndex(Table table, TableItem item, Point point){ int column = -1; if (item != null) { // Determine which column was selected for (int i = 0, n = table.getColumnCount(); i < n; i++) { Rectangle rect = item.getBounds(i); if (rect.contains(point)) { // This is the selected column column = i; break; } } } return column; }
Example 2
Source File: SwtUtils.java From xds-ide with Eclipse Public License 1.0 | 6 votes |
public static int getClickedItemColumnIndex(Table table, TableItem item, Point point) { int column = -1; if (item != null) { // Determine which column was selected for (int i = 0, n = table.getColumnCount(); i < n; i++) { Rectangle rect = item.getBounds(i); if (rect.contains(point)) { // This is the selected column column = i; break; } } } return column; }
Example 3
Source File: ComponentFilterTable.java From arx with Apache License 2.0 | 6 votes |
/** * Returns the item at the given location. * * @param x * @param y * @return */ private int getItemColumnAt(int x, int y) { Point pt = new Point(x, y); int index = table.getTopIndex(); while (index < table.getItemCount()) { final TableItem item = table.getItem(index); for (int i = 0; i < table.getColumns().length; i++) { final Rectangle rect = item.getBounds(i); if (rect.contains(pt)) { return i; } } index++; } return -1; }
Example 4
Source File: ComponentFilterTable.java From arx with Apache License 2.0 | 6 votes |
/** * Returns the item at the given location. * * @param x * @param y * @return */ private int getItemRowAt(int x, int y) { Point pt = new Point(x, y); int index = table.getTopIndex(); while (index < table.getItemCount()) { final TableItem item = table.getItem(index); for (int i = 0; i < table.getColumns().length; i++) { final Rectangle rect = item.getBounds(i); if (rect.contains(pt)) { return index; } } index++; } return -1; }
Example 5
Source File: ViewClipboard.java From arx with Apache License 2.0 | 5 votes |
/** * Returns the item at the given location. * * @param x * @param y * @return */ private TableItem getItemAt(int x, int y) { Point pt = new Point(x, y); int index = table.getTopIndex(); while (index < table.getItemCount()) { final TableItem item = table.getItem(index); for (int i = 0; i < table.getColumnCount(); i++) { final Rectangle rect = item.getBounds(i); if (rect.contains(pt)) { return item; } } index++; } return null; }
Example 6
Source File: CompletionProposalPopup.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
private void setDetailCompositeContent(FontData fontData, Event event) { TableItem item = (TableItem) event.item; ICompletionProposal curProposal = (ICompletionProposal) item.getData(); if (curProposal == selectedProposal) { return; } selectedProposal = curProposal; descriptionPanel.execute("setDocFont(\"" + fontData.getName() + "\",\"" + fontData.getHeight() + "\")"); GridData gd = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); int itemHeight = item.getBounds().height; int rightHeight = itemHeight * PROPOSAL_ITEMS_VISIBLE; gd.heightHint = rightHeight; detailProposalComposite.setLayoutData(gd); detailProposalComposite.setBounds(fProposalTable.getSize().x + 2, 1, 320, rightHeight); Rectangle rect = detailProposalComposite.getBounds(); descriptionPanel.setBounds(0, 0, rect.width, rightHeight - 1); if (curProposal instanceof ICommonCompletionProposal) { ICommonCompletionProposal proposal = (ICommonCompletionProposal)curProposal; String location = ""; String title = proposal.getDisplayString(); title = title.replace("<", "<"); title = title.replace(">", ">"); descriptionPanel.execute("setTitle(\"" + title + "\")"); String info = proposal.getAdditionalProposalInfo(); descriptionPanel.execute("cleanAddition()"); if(info == null) { info = ""; } info = info.replace("\"", "'"); info = info.replaceAll("(\n|\r)\\s*", "<br/>"); descriptionPanel.execute("setAddition(\"" + info + "\")"); descriptionPanel.execute("clearLocation()"); descriptionPanel.execute("setLocation(\"" + location + "\")"); } fProposalShell.pack(); }