}
private void onMouseDown(Event event) {
boolean disableTrackerTemporary = false;
Point p = new Point(event.x, event.y);
TreeItem item = fCustomTree.getControl().getItem(p);
/* Problem - return */
if (item == null || item.isDisposed())
return;
/* Don't run Tracker if other Mouse Button is used */
if (event.button != 1)
disableTrackerTemporary = true;
/* Mouse-Up over Read-State-Column */
if (event.button == 1 && item.getImageBounds(COL_TITLE).contains(p)) {
Object data = item.getData();
/* Toggle State between Read / Unread */
if (data instanceof INews) {
INews news = (INews) data;
disableTrackerTemporary = (news.getState() == INews.State.READ);
INews.State newState = (news.getState() == INews.State.READ) ? INews.State.UNREAD : INews.State.READ;
setNewsState(new ArrayList<INews>(Arrays.asList(new INews[] { news })), newState);
}
}
/* Mouse-Up over Sticky-State-Column */
else if (event.button == 1 && item.getImageBounds(COL_STICKY).contains(p)) {
Object data = item.getData();
/* Toggle State between Sticky / Not Sticky */
if (data instanceof INews) {
disableTrackerTemporary = false;
new MakeNewsStickyAction(new StructuredSelection(data)).run();