Ejemplo n.º 1
0
  @Override
  public void mouseUp(MouseEvent event) {
    TreeItem item = xViewer.getItemUnderMouseClick(new Point(event.x, event.y));
    if (item == null) {
      return;
    }

    try {
      TreeColumn column = xViewer.getColumnUnderMouseClick(new Point(event.x, event.y));
      if (column == null) {
        return;
      }
      if (isLeftClick(event) && controlNotBeingHeld(event)) {

        if (altIsBeingHeld(event)) {
          // System.out.println("Column " + colNum);
          xViewer.handleAltLeftClick(column, item);
        } else if (clickOccurredInIconArea(event, item)) {
          xViewer.handleLeftClickInIconArea(column, item);
        } else {
          // System.out.println("Column " + colNum);
          xViewer.handleLeftClick(column, item);
        }
      }
      xViewer.updateStatusLabel();
    } catch (ArrayIndexOutOfBoundsException ex) {
      // mouse clicked outside of last/valid column
      return;
    }
  }
Ejemplo n.º 2
0
  @Override
  public void mouseDoubleClick(MouseEvent event) {
    Point point = new Point(event.x, event.y);
    TreeColumn column = xViewer.getColumnUnderMouseClick(point);
    TreeItem itemToReturn = xViewer.getItemUnderMouseClick(point);

    xViewer.handleDoubleClick(column, itemToReturn);
  }