Writes a button with 'text' which can be used
           to copy 'text_to_copy' to clipboard when it's clicked.
335168
def write_copy_button(self, text, text_to_copy):
        """"""
        self.write_copy_script = True
        self.write('<button onclick="cp(\'{}\');">{}</button>'
                   .format(text_to_copy, text))
621254
def paste(self):
        """"""
        clipboard = QApplication.clipboard()
        cliptext = ''
        if clipboard.mimeData().hasText():
            cliptext = to_text_string(clipboard.text())
        if cliptext.strip():
            self.import_from_string(cliptext, title=_("Import from clipboard"))
        else:
            QMessageBox.warning(self, _( "Empty clipboard"),
                                _("Nothing to be imported from clipboard."))
801578
def paste(self):
        """"""
        text = to_text_string(QApplication.clipboard().text())
        if len(text.splitlines()) > 1:
            # Multiline paste
            if self.new_input_line:
                self.on_new_line()
            self.remove_selected_text() # Remove selection, eventually
            end = self.get_current_line_from_cursor()
            lines = self.get_current_line_to_cursor() + text + end
            self.clear_line()
            self.execute_lines(lines)
            self.move_cursor(-len(end))
        else:
            # Standard paste
            ShellBaseWidget.paste(self)
785506
def do_paste(self, event):
        
        # find where the user has clicked
        col_ind = self.GetGridCursorCol()
        row_ind = self.GetGridCursorRow()
        # read in clipboard text
        text_df = pd.read_clipboard(header=None, sep='\t').fillna('')
        # add extra rows if need to accomadate clipboard text
        row_length_diff = len(text_df) - (len(self.row_labels) - row_ind)
        if row_length_diff > 0:
            for n in range(row_length_diff):
                self.add_row()
        # ignore excess columns if present
        col_length_diff = len(text_df.columns) - (len(self.col_labels) - col_ind)
        if col_length_diff > 0:
            text_df = text_df.iloc[:, :-col_length_diff].copy()
        # go through copied text and parse it into the grid rows
        for label, row_data in text_df.iterrows():
            col_range = list(range(col_ind, col_ind + len(row_data)))
            if len(row_data) > 1:
                cols = list(zip(col_range, row_data.index))
                for column in cols:
                    value = row_data[column[1]]
                    this_col = column[0]
                    self.SetCellValue(row_ind, this_col, str(value))
            else:
                value = row_data[0]
                self.SetCellValue(row_ind, col_ind, str(value))
            row_ind += 1
        # could instead use wxPython clipboard here
        # see old git history for that
        self.size_grid()
        event.Skip()
1092042
def _copy_selection(self, *event):
        
        if react_to_event(self.view, self.view.editor, event):
            logger.debug("copy selection")
            global_clipboard.copy(self.model.selection)
            return True
96690
private void buttonPasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPasteActionPerformed
    try {
      this.editorPane.replaceSelection((String) Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor));
    } catch (UnsupportedFlavorException ex) {
      // no text data in clipboard
    } catch (IOException ex) {
      LOGGER.error("Error during paste from clipboard", ex); //NOI18N
    }
  }
932532
def copy(self):
        """"""
        clipboard = QApplication.clipboard()
        clipl = []
        for idx in self.selectedIndexes():
            if not idx.isValid():
                continue
            obj = self.delegate.get_value(idx)
            # Check if we are trying to copy a numpy array, and if so make sure
            # to copy the whole thing in a tab separated format
            if isinstance(obj, (ndarray, MaskedArray)) \
              and ndarray is not FakeObject:
                if PY3:
                    output = io.BytesIO()
                else:
                    output = io.StringIO()
                try:
                    np_savetxt(output, obj, delimiter='\t')
                except:
                    QMessageBox.warning(self, _("Warning"),
                                        _("It was not possible to copy "
                                          "this array"))
                    return
                obj = output.getvalue().decode('utf-8')
                output.close()
            elif isinstance(obj, (DataFrame, Series)) \
              and DataFrame is not FakeObject:
                output = io.StringIO()
                try:
                    obj.to_csv(output, sep='\t', index=True, header=True)
                except Exception:
                    QMessageBox.warning(self, _("Warning"),
                                        _("It was not possible to copy "
                                          "this dataframe"))
                    return
                if PY3:
                    obj = output.getvalue()
                else:
                    obj = output.getvalue().decode('utf-8')
                output.close()
            elif is_binary_string(obj):
                obj = to_text_string(obj, 'utf8')
            else:
                obj = to_text_string(obj)
            clipl.append(obj)
        clipboard.setText('\n'.join(clipl))
505764
def paste(self,e):
        '''
        if self.enable_win32_clipboard:
                txt=clipboard.get_clipboard_text_and_convert(False)
                self.insert_text(txt)
557496
def OnPasteAs(self, event):
        """"""

        data = self.main_window.clipboard.get_clipboard()
        key = self.main_window.grid.actions.cursor

        with undo.group(_("Paste As...")):
            self.main_window.actions.paste_as(key, data)

        self.main_window.grid.ForceRefresh()

        event.Skip()
850347
def get_clipboard_text_and_convert(paste_list=False):
    """
    txt = GetClipboardText()
    if txt:
        if paste_list and u"\t" in txt:
            array, flag = make_list_of_list(txt)
            if flag:
                txt = repr(array)
            else:
                txt = u"array(%s)"%repr(array)
            txt = u"".join([c for c in txt if c not in u" \t\r\n"])
    return txt
1047132
def _copy_cell_text(self):
        
        txt = self.currentItem().text()
        QtWidgets.QApplication.clipboard().setText(txt)
963570
function pasteText(text) {
        text = editor.dom.encode(text).replace(/\r\n/g, '\n');

        var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock);

        // Create start block html for example <p attr="value">
        var forcedRootBlockName = editor.settings.forced_root_block;
        var forcedRootBlockStartHtml;
        if (forcedRootBlockName) {
          forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs);
          forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>';
        }

        if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) {
          text = Utils.filter(text, [
            [/\n/g, "<br>"]
          ]);
        } else {
          text = Utils.filter(text, [
            [/\n\n/g, "</p>" + forcedRootBlockStartHtml],
            [/^(.*<\/p>)(<p>)$/, forcedRootBlockStartHtml + '$1'],
            [/\n/g, "<br />"]
          ]);

          if (text.indexOf('<p>') != -1) {
            text = forcedRootBlockStartHtml + text;
          }
        }

        pasteHtml(text, false);
      }
1136642
def paste_action_callback(self, *event):
        """"""
        if react_to_event(self.view, self.oc_list_ctrl.tree_view, event) and self.oc_list_ctrl.active_entry_widget is None:
            global_clipboard.paste(self.model, limited=['outcomes'])
            return True
806904
def copy(self):
        
        if self.select_line_on_copy_empty and not self.textCursor().hasSelection():
            TextHelper(self).select_whole_line()
        super(CodeEdit, self).copy()
1168526
public void clickOnButton(String text) {
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "clickOnButton(\""+text+"\")");
		}
			
		clicker.clickOn(Button.class, text);

	}
886347
public void clickButtonWithText(String text) {
        String caseInsensitiveButtonText = seleniumElementService.constructCaseInsensitiveContains("text()", text);
        By buttonPpath = By.xpath("//button[" + caseInsensitiveButtonText + "]");
        String caseInsensitiveValueText = seleniumElementService.constructCaseInsensitiveContains("@value", text);
        By submitPath = By.xpath("//input[@type='submit'][" + caseInsensitiveValueText + "]");
        By inputButtonPath = By.xpath("//input[@type='button'][" + caseInsensitiveValueText + "]");
        By inputResetPath = By.xpath("//input[@type='reset'][" + caseInsensitiveValueText + "]");
        WebElement foundButton = seleniumElementService.findExpectedFirstMatchedElement(buttonPpath, submitPath, inputButtonPath, inputResetPath);
        if (foundButton == null) {
            foundButton = seleniumElementService.findExpectedFirstMatchedElement(2, buttonPpath, submitPath, inputButtonPath, inputResetPath);
        }
        foundButton.click();
    }
250238
function _button_wrapper(str, title){
	var b = new bbop.widget.display.text_button_sim(str, title, '');
	return b.to_string();
    }