import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
if (bounds == null) {
return;
}
+ Point location = widget.toDisplay(bounds.x, bounds.y);
final Event event = new Event();
event.time = (int) System.currentTimeMillis();
event.display = control.getDisplay();
event.widget = control;
- event.x = bounds.x + widget.getTimeDataProvider().getNameSpace() / 2;
- event.y = bounds.y + bounds.height / 2;
+ event.x = location.x + widget.getTimeDataProvider().getNameSpace() / 2;
+ event.y = location.y + bounds.height / 2;
control.notifyListeners(SWT.MenuDetect, event);
}
});
+ select();
WaitForObjectCondition<Menu> waitForMenu = Conditions.waitForPopupMenu(control);
new SWTBot().waitUntilWidgetAppears(waitForMenu);
@Override
public void run() {
widget.setFocus();
- widget.selectItem(fEntry, true);
+ widget.selectItem(fEntry, false);
+ widget.fireSelectionChanged();
}
});
return this;
}
/**
- * Get the bounds of the specified entry
+ * Get the bounds of the specified entry relative to its parent time graph.
*
* @param entry the time graph entry
* @return the bounds of the entry, or null if the entry is not visible
public Rectangle getItemBounds(ITimeGraphEntry entry) {
int idx = fItemData.findItemIndex(entry);
if (idx >= 0) {
- return getItemRect(getBounds(), idx);
+ return getItemRect(getClientArea(), idx);
}
return null;
}