CodeArea(CodePanel panel) { this.contentPanel = panel; this.node = panel.getNode(); setMarkOccurrences(true); setEditable(false); loadSettings(); Caret caret = getCaret(); if (caret instanceof DefaultCaret) { ((DefaultCaret) caret).setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); } caret.setVisible(true); setSyntaxEditingStyle(node.getSyntaxName()); if (node instanceof JClass) { JClass jClsNode = (JClass) this.node; ((RSyntaxDocument) getDocument()).setSyntaxStyle(new JadxTokenMaker(this, jClsNode)); setHyperlinksEnabled(true); CodeLinkGenerator codeLinkProcessor = new CodeLinkGenerator(contentPanel, this, jClsNode); setLinkGenerator(codeLinkProcessor); addHyperlinkListener(codeLinkProcessor); addMenuItems(jClsNode); } registerWordHighlighter(); setText(node.getContent()); }
/** * Sets the text mode for this editor pane. If the currently installed * caret is an instance of {@link ConfigurableCaret}, it will be * automatically updated to render itself appropriately for the new text * mode. * * @param mode Either {@link #INSERT_MODE} or {@link #OVERWRITE_MODE}. * @see #getTextMode() */ public void setTextMode(int mode) { if (mode!=INSERT_MODE && mode!=OVERWRITE_MODE) { mode = INSERT_MODE; } if (textMode != mode) { Caret caret = getCaret(); if (caret instanceof ConfigurableCaret) { ((ConfigurableCaret)caret).setStyle(carets[mode]); } textMode = mode; // Prevent the caret from blinking while e.g. holding down the // Insert key to toggle insert/overwrite modes caret.setVisible(false); caret.setVisible(true); } }
@Override public void focusGained(FocusEvent arg0) { DialogTranslate.this.textToTranslate[0].getCaret().setVisible(true); DialogTranslate.this.textToTranslate[0].getCaret().setSelectionVisible(true); } });
@Override public void focusGained(FocusEvent arg0) { browser.getCaret().setVisible(true); browser.getCaret().setSelectionVisible(true); } });
@Override public void focusGained(FocusEvent arg0) { text[0].getCaret().setVisible(true); text[0].getCaret().setSelectionVisible(true); } });
@Override public void focusGained(FocusEvent arg0) { JPopupTextPane.this.getProxy().getCaret().setVisible(true); JPopupTextPane.this.getProxy().getCaret().setSelectionVisible(true); } });
@Override public void focusGained(FocusEvent arg0) { JPopupTextArea.this.getProxy().getCaret().setVisible(true); JPopupTextArea.this.getProxy().getCaret().setSelectionVisible(true); } });
@Override public void focusGained(FocusEvent arg0) { JColoredConsole.this.getProxy().getCaret().setVisible(true); JColoredConsole.this.getProxy().getCaret().setSelectionVisible(true); } });
public void focusGained(java.awt.event.FocusEvent e) { // DEBUG System.out.printf("disasm: focusGained()\n"); editorPane.getCaret().setVisible(true); } public void focusLost(java.awt.event.FocusEvent e) {
/** * called to restore the state of a component * because a drop was performed. */ protected void restoreComponentStateForDrop(JComponent comp) { JTextComponent c = (JTextComponent) comp; Caret caret = c.getCaret(); caret.setVisible(visible); }
/** * Appends the specified string to the shell output area. * @param s string to append to the shell output area. */ private void addToTextArea(String s) { outputTextArea.append(s); outputTextArea.setCaretPosition(outputTextArea.getText().length()); outputTextArea.getCaret().setVisible(true); outputTextArea.repaint(); } }
@Override public void internalFrameActivated(InternalFrameEvent e) { // hack if (consoleTextArea.hasFocus()) { consoleTextArea.getCaret().setVisible(false); consoleTextArea.getCaret().setVisible(true); } } });
@Override public void internalFrameActivated(InternalFrameEvent e) { // hack if (consoleTextArea.hasFocus()) { consoleTextArea.getCaret().setVisible(false); consoleTextArea.getCaret().setVisible(true); } } });
@Override public void focusGained(FocusEvent e) { Caret caret = comp.getCaret(); caret.setVisible(true); caret.setSelectionVisible(true); } };
@Override public void focusGained(FocusEvent e) { // Need to make the caret visible when gaining focus. Sometimes this happens automatically, but // not always. Not sure if there is a better way to do this. this.main.getTextArea().getCaret().setVisible(true); }
/** * Called when the mouse is clicked. */ public void mouseClicked(MouseEvent e) { checkPopup(e); requestFocus(); getCaret().setVisible(true); }
/** * Called when the mouse is clicked. */ public void mouseClicked(MouseEvent e) { checkPopup(e); requestFocus(); getCaret().setVisible(true); }
/** * called to restore the state of a component * because a drop was not performed. */ protected void restoreComponentState(JComponent comp) { JTextComponent c = (JTextComponent) comp; Caret caret = c.getCaret(); caret.setDot(mark); caret.moveDot(dot); caret.setVisible(visible); }
private ZapTextArea getRequestField() { if (requestField == null) { requestField = new ZapTextArea(); requestField.setEditable(false); requestField.setLineWrap(true); requestField.getCaret().setVisible(true); } return requestField; }
/** * called to save the state of a component in case it needs to * be restored because a drop is not performed. */ protected void saveComponentState(JComponent comp) { JTextComponent c = (JTextComponent) comp; Caret caret = c.getCaret(); dot = caret.getDot(); mark = caret.getMark(); visible = caret.isVisible(); caret.setVisible(true); }