org.eclipse.swt.widgets.TableItem#getBounds ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.TableItem#getBounds ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: xds-ide   文件: UiUtils.java
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;
}
 
源代码2 项目: xds-ide   文件: SwtUtils.java
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;
}
 
源代码3 项目: arx   文件: ComponentFilterTable.java
/**
 * 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;
}
 
源代码4 项目: arx   文件: ComponentFilterTable.java
/**
 * 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;
}
 
源代码5 项目: arx   文件: ViewClipboard.java
/**
 * 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;
}
 
源代码6 项目: APICloud-Studio   文件: CompletionProposalPopup.java
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("<", "&lt;");
		title = title.replace(">", "&gt;");
		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();
}