Examples of replaceSelection()


Examples of javax.swing.text.JTextComponent.replaceSelection()

      }

      // If not (in the middle of parameters), just insert the paren.
      else {
        tc.replaceSelection(Character.toString(end));
      }

    }

    public String getArgumentText(int offs) {
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

                    }

                    target.moveCaretPosition(endOffs);

                    // and then delete it
                    target.replaceSelection("");
                    beep = false;
                } catch (BadLocationException exc) {
                    // nothing to do, because we set beep to true already
                }
            }
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

                if (!failed) {
                    target.moveCaretPosition(offs);

                    // and then delete it
                    target.replaceSelection("");
                    beep = false;
                }
            }

            if (beep) {
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

      if (this._component instanceof JTextComponent) {
        JTextComponent comp = (JTextComponent)this._component;
        int start = comp.getSelectionStart();
        int end = comp.getSelectionEnd();
        if (start != end) {
              comp.replaceSelection("");
              // TF:Mar 4, 2010:If we remove a selection from a datafield, this datafield will fire
              // AfterValueChange events, even though the change is programmatic. Hence, we must mirror this.
              if (comp instanceof DataField) {
                ((DataField)comp).postAfterValueChange(false);
              }
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

    String replacement = getReplacementText(c, textComp.getDocument(), start, len);

    caret.setDot(start);
    caret.moveDot(dot);
    textComp.replaceSelection(replacement);

    if (isParameterAssistanceEnabled() &&
            (c instanceof ParameterizedCompletion)) {
      ParameterizedCompletion pc = (ParameterizedCompletion)c;
      displayDescriptionToolTip(pc, true);
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

        }
        final Transferable contents = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(this);
        if(contents.isDataFlavorSupported(DataFlavor.stringFlavor)){
          try {
            String text = (String) contents.getTransferData(DataFlavor.stringFlavor);
            target.replaceSelection(text);
          }
          catch (Exception ex) {
          }
        }
      }
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

public class UITools {
  @SuppressWarnings("serial")
    public static final class InsertEolAction extends AbstractAction {
        public void actionPerformed(ActionEvent e) {
          JTextComponent c = (JTextComponent) e.getSource();
          c.replaceSelection("\n");
        }
    }

  public static final String MAIN_FREEPLANE_FRAME = "mainFreeplaneFrame";
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

          final String newWord = sugestionWord;
          item.addActionListener(new ActionListener() {
            public void actionPerformed(final ActionEvent e) {
              jText.setSelectionStart(begOffs);
              jText.setSelectionEnd(endOffs);
              jText.replaceSelection(newWord);
            }
          });
        }
        final UserDictionaryProvider provider = SpellChecker.getUserDictionaryProvider();
        if (provider == null) {
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

      }
      final Component mostRecentFocusOwner = parentWindow.getMostRecentFocusOwner();
    if (mostRecentFocusOwner instanceof JTextComponent
            && !(mostRecentFocusOwner.getClass().getName().contains("JSpinField"))) {
        final JTextComponent textComponent = (JTextComponent) mostRecentFocusOwner;
        textComponent.replaceSelection(dateAsString);
        return;
      }
      if(mostRecentFocusOwner instanceof JTable){
        JTable table = (JTable) mostRecentFocusOwner;
        final int[] selectedRows = table.getSelectedRows();
View Full Code Here

Examples of javax.swing.text.JTextComponent.replaceSelection()

            textComponent.copy();
        } else if (e.getSource() == pasteItem) {
            textComponent.paste();
        } else if (e.getSource() == deleteItem) {
            if (!haveSelection) textComponent.selectAll();
            textComponent.replaceSelection("");
        } else if (e.getSource() == selectAllItem) {
            textComponent.selectAll();
        }
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.