public ClipboardHistoryAction(String name, Icon icon, String desc, Integer mnemonic, KeyStroke accelerator) { super(name, icon, desc, mnemonic, accelerator); clipboardHistory = ClipboardHistory.get(); }
public ClipboardHistoryAction() { super(clipboardHistoryAction); clipboardHistory = ClipboardHistory.get(); }
/** * Inserts the selected item into the editor and disposes of this popup. */ private void insertSelectedItem() { Object lvp = list.getSelectedValue(); if (lvp!=null) { listener.uninstallAndHide(); String text = ((LabelValuePair)lvp).value; textArea.replaceSelection(text); ClipboardHistory.get().add(text); // Move this item to the top } }
/** * This method is called after data has been exported. This method should * remove the data that was transfered if the action was MOVE. * * @param source The component that was the source of the data. * @param data The data that was transferred or possibly null * if the action is <code>NONE</code>. * @param action The actual action that was performed. */ @Override protected void exportDone(JComponent source, Transferable data, int action) { // only remove the text if shouldRemove has not been set to // false by importData and only if the action is a move if (shouldRemove && action == MOVE) { TextTransferable t = (TextTransferable)data; t.removeText(); if (withinSameComponent) { ((RTextArea)source).endAtomicEdit(); withinSameComponent = false; } } exportComp = null; if (data instanceof TextTransferable) { ClipboardHistory.get().add(((TextTransferable)data).getPlainData()); } }
public ClipboardHistoryAction(String name, Icon icon, String desc, Integer mnemonic, KeyStroke accelerator) { super(name, icon, desc, mnemonic, accelerator); clipboardHistory = ClipboardHistory.get(); }
public ClipboardHistoryAction() { super(clipboardHistoryAction); clipboardHistory = ClipboardHistory.get(); }
/** * Inserts the selected item into the editor and disposes of this popup. */ private void insertSelectedItem() { Object lvp = list.getSelectedValue(); if (lvp!=null) { listener.uninstallAndHide(); String text = ((LabelValuePair)lvp).value; textArea.replaceSelection(text); ClipboardHistory.get().add(text); // Move this item to the top } }
/** * This method is called after data has been exported. This method should * remove the data that was transfered if the action was MOVE. * * @param source The component that was the source of the data. * @param data The data that was transferred or possibly null * if the action is <code>NONE</code>. * @param action The actual action that was performed. */ @Override protected void exportDone(JComponent source, Transferable data, int action) { // only remove the text if shouldRemove has not been set to // false by importData and only if the action is a move if (shouldRemove && action == MOVE) { TextTransferable t = (TextTransferable)data; t.removeText(); if (withinSameComponent) { ((RTextArea)source).endAtomicEdit(); withinSameComponent = false; } } exportComp = null; if (data instanceof TextTransferable) { ClipboardHistory.get().add(((TextTransferable)data).getPlainData()); } }