ControlContribution Does not fire MouseTrackListener [message #1016316] |
Wed, 06 March 2013 01:38 |
Mark Leone Messages: 69 Registered: April 2012 |
Member |
|
|
I've subclassed ControlContribution, and added a MouseTrackListener to the Control that is created in ControlContribution#createControl. When I move the mouse over the ControlContribution on the toolbar, the listener does not fire. I also tried adding a MouseListener to the Control, and a SelectionListener as well (the Control is a Button). In all these cases the listener does not fire. The strange thing is this used to work, and suddenly it's not. I've looked all through my code for the regression and scoured SVN logs, to no avail. Does anyone have any idea what could be preventing this from working? My RCP app is running on a Juno target.
Here's an idea of what I'm doing:
class MyView extends ViewPart {
...
public void createPartControl(Composite parent) {
...
ToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
MyControlContribution cc = new MyControlContribution("MyLabel");
mgr.add(cc);
getViewSite().getActionBars().updateActionBars();
cc.getControl().addMouseTrackListener(new MouseTrackAdapter() {
pubic void mouseEnter(MouseEvent event) {
System.err.println("Mouse Enter"); //does not fire
}
pubic void mouseHover(MouseEvent event) {
System.err.println("Mouse Hover"); //does not fire
}
});
cc.getControl().addMouseListener(new MouseAdapter() {
pubic void mouseDown(MouseEvent event) {
System.err.println("Mouse Down"); //does not fire
}
});
((Button) cc.getControl()).addSelectionListener(new SelectionAdapter() {
pubic void widgetSelected(SelectionEvent event) {
System.err.println("Button Selected"); //does not fire
}
});
...
}
}
class MyControlContribution extends ControlContribution {
Button control;
public Control createControl(Composite parent) {
this.control = new Button(parent, SWT.PUSH);
...
return this.control;
}
public Control getControl() {
return this.control;
}
}
[Updated on: Wed, 06 March 2013 01:51] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03121 seconds