• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

SWT -> TabItem -> addListener  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to implement dnd from a table to different tabItems in a TabFolder, when the mouse enters a tabItem, i want the tabItem to get selected (brought to front) so that the draged item can be dropped in the tabItem. Basically I need to receive an event when the mouse enter or hovers over a tabItem ...

I tried tabitem.addListener(SWT.MouseEnter, new Listener() { ...
but it does not seem to work.

Does anybody have any suggestions ?

regards
Daniel
 
Daniel Eriksson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the following solution :

folder.addMouseMoveListener(new MouseMoveListener() {
public void mouseMove(MouseEvent arg0) {
Point point = new Point(arg0.x, arg0.y);
TabItem[] items = folder.getItems();
for (int i = 0; i < items.length;i++) {
if (items[i].getBounds().contains(point)){
lineFolder.setSelection(items[i]);
}
}
}
});

Anyone have a better solution ?
 
Attractive, successful people love this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!