Handle file link clicks.
322422
def mousePressEvent(self, event):
        
        super(OutputWindow, self).mousePressEvent(event)
        if self._link_match:
            path = self._link_match.group('url')
            line = self._link_match.group('line')
            if line is not None:
                line = int(line) - 1
            else:
                line = 0
            self.open_file_requested.emit(path, line)
285701
def _handle_delete_file(self, data):
        """"""

        file = self.room.filedict.get(data)
        if file:
            self.room.filedict = data, None
            self.conn.enqueue_data("delete_file", file)
1270524
def fileBrowser(self):
        """"""
        if capable.OF_TKFD_IN_EPAR:
           fname = askopenfilename(parent=self.entry, title="Select File")
        else:
            from . import filedlg
            self.fd = filedlg.PersistLoadFileDialog(self.entry,
                              "Select File", "*")
            if self.fd.Show() != 1:
                self.fd.DialogCleanup()
                return
            fname = self.fd.GetFileName()
            self.fd.DialogCleanup()
        if not fname: return # canceled

        self.choice.set(fname)
        # don't select when we go back to widget to reduce risk of
        # accidentally typing over the filename
        self.lastSelection = None
307691
def _open(self, path, skip_to_end = True, offset = None):
      """"""
      fh = os.fdopen(os.open(path, os.O_RDONLY | os.O_NONBLOCK))

      # If the file is being opened for the first time, jump to the end.
      # Otherwise, it is being reopened after a rotation, and we want
      # content from the beginning.
      if offset is None:
         if skip_to_end:
            fh.seek(0, 2)

            self._offset = fh.tell()
         else:
            self._offset = 0
      else:
         fh.seek(offset)
         self._offset = fh.tell()
      
      self._fh = fh
      self._lastsize = fh.tell()
      self._inode = os.stat(self._path).st_ino
716023
private void handleFile(final String filePath, final AsyncFile file, final InputGroup group) {
    final AtomicLong position = new AtomicLong();
    final AtomicBoolean complete = new AtomicBoolean();
    final AtomicInteger handlerCount = new AtomicInteger();
    group.messageHandler(new Handler<Buffer>() {
      @Override
      public synchronized void handle(Buffer buffer) {
        file.write(buffer, position.get(), new Handler<AsyncResult<Void>>() {
          @Override
          public void handle(AsyncResult<Void> result) {
            if (result.failed()) {
              file.close();
              group.messageHandler(null);
              group.endHandler(null);
              try {
                input.vertx().fileSystem().deleteSync(filePath);
              } catch (Exception e) {
              }
              if (exceptionHandler != null) {
                exceptionHandler.handle(result.cause());
              }
            }

            // Decrement the handler count.
            handlerCount.decrementAndGet();

            // We need to handle for cases where the end handler was called
            // before all the data was written to the file.
            if (complete.get() && handlerCount.get() == 0) {
              closeFile(filePath, file);
            }
          }
        });
        // Increment the handler count and current buffer position.
        handlerCount.incrementAndGet();
        position.addAndGet(buffer.length());
      }
    });
    group.endHandler(new Handler<Void>() {
      @Override
      public void handle(Void event) {
        // If there are still handlers processing the data then wait for
        // those handlers to complete by simply setting the complete flag.
        complete.set(true);
        if (handlerCount.get() == 0) {
          closeFile(filePath, file);
        }
      }
    });
  }
247744
private void handleLogfile() {
        if (args.logFile != null) {
            FileUtils.close(out);
            FileUtils.close(err);
        }
    }
1014862
public void link(Name name, File file) {
    DirectoryEntry entry = new DirectoryEntry(this, checkNotReserved(name, "link"), file);
    put(entry);
    file.linked(entry);
  }
678024
function handleEvent(cmd, context, filename, callback) {
  var event = JSON.parse(cmd)
  eventline.route(event)
}
290975
def click_link(self, link_text, timeout=settings.SMALL_TIMEOUT):
        
        self.click_link_text(link_text, timeout=timeout)
1041530
function handleInputFocus(target, event) {
        if (spec.templating.isEditInput(target)) {
            var fileId = spec.templating.getFileId(target),
                status = spec.onGetUploadStatus(fileId);

            if (status === qq.status.SUBMITTED) {
                spec.log(qq.format("Detected valid filename input focus event on file '{}', ID: {}.", spec.onGetName(fileId), fileId));
                inheritedInternalApi.handleFilenameEdit(fileId, target);
            }
        }
    }
174619
function onDownloadClick() {
		const a = document.head.appendChild($('a', { download: '', href: media.src }));

		a.click();

		document.head.removeChild(a);
	}
1146040
def link(self):
    """"""
    if not self.IsLink():
      return ''

    location = getattr(self.path_spec, 'location', None)
    if location is None:
      return ''

    return self._file_system.GetDataByPath(location)
1359138
def _on_click(self, event):
        
        if callable(self.__callback):
            self.__callback(self.selection)
1033421
def tick(self, filename):
        """"""
        if self.connection_attempts < 10:
            # Trick to connect ASAP when
            # plugin is  started without
            # user interaction (CursorMove)
            self.setup(True, False)
            self.connection_attempts += 1
        self.unqueue_and_display(filename)
1107696
def handleDetailDblClick( self, item ):
        
        if ( isinstance(item, XOrbRecordItem) ):
            self.emitRecordDoubleClicked(item.record())
1140015
protected void handleAnchorActivated(HyperlinkEvent e, String anchor) {
        ((JTextPane)e.getSource()).scrollToReference(anchor);
    }
1259770
function handleFileNew() {
        //var defaultExtension = PreferencesManager.get("defaultExtension");
        //if (defaultExtension) {
        //    defaultExtension = "." + defaultExtension;
        //}
        var defaultExtension = "";  // disable preference setting for now

        var doc = DocumentManager.createUntitledDocument(_nextUntitledIndexToUse++, defaultExtension);
        MainViewManager._edit(MainViewManager.ACTIVE_PANE, doc);

        HealthLogger.sendAnalyticsData(
            HealthLogger.commonStrings.USAGE +
            HealthLogger.commonStrings.FILE_OPEN +
            HealthLogger.commonStrings.FILE_NEW,
            HealthLogger.commonStrings.USAGE,
            HealthLogger.commonStrings.FILE_OPEN,
            HealthLogger.commonStrings.FILE_NEW
        );

        return new $.Deferred().resolve(doc).promise();
    }