code: @Override
    public void fillContextMenu(IMenuManager menu) {
      /*
       * Actions on multiple selections
       */
      menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, new DFSAction(
          DFSActions.DELETE));
  
      menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction(
          DFSActions.REFRESH));
  
      menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction(
          DFSActions.DOWNLOAD));
  
      if (site == null)
        return;
  
      ISelection isel = site.getStructuredViewer().getSelection();
      if (!(isel instanceof IStructuredSelection))
        return;
  
      /*
       * Actions on single selections only
       */
  
      IStructuredSelection issel = (IStructuredSelection) isel;
      if (issel.size() != 1)
        return;
      Object element = issel.getFirstElement();
  
      if (element instanceof DFSFile) {
        menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction(
            DFSActions.OPEN));
  
      } else if (element instanceof DFSFolder) {
        menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction(
            DFSActions.MKDIR));
        menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction(
            DFSActions.UPLOAD_FILES));
        menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction(
            DFSActions.UPLOAD_DIR));
  
      } else if (element instanceof DFSLocation) {
        menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction(
            DFSActions.RECONNECT));
  
      } else if (element instanceof DFSLocationsRoot) {
        menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction(
            DFSActions.DISCONNECT));
      }
  
    }
docs: /* @inheritDoc