예제 #1
0
  protected void processMouseEvent(final MouseEvent e) {
    if (e.isPopupTrigger() && e.getComponent().isShowing()) {
      super.processMouseEvent(e);
      return;
    }

    if (UIUtil.isCloseClick(e)) {
      myDecorator.fireHiddenSide();
      return;
    }

    if (e.getButton() == MouseEvent.BUTTON1) {
      if (MouseEvent.MOUSE_PRESSED == e.getID()) {
        myPressedPoint = e.getPoint();
        myPressedWhenSelected = isSelected();
        myDragCancelled = false;
      } else if (MouseEvent.MOUSE_RELEASED == e.getID()) {
        finishDragging();
        myPressedPoint = null;
        myDragButtonImage = null;
      }
    }

    super.processMouseEvent(e);
  }
 @Override
 public void mouseReleased(MouseEvent e) {
   if (UIUtil.isCloseClick(e, MouseEvent.MOUSE_RELEASED)) {
     final TabInfo info = myTabs.findInfo(e);
     if (info != null) {
       IdeEventQueue.getInstance().blockNextEvents(e);
       FileEditorManagerEx.getInstanceEx(myProject)
           .closeFile((VirtualFile) info.getObject(), myWindow);
     }
   }
 }