public DefaultSQLEntryPanel(ISession session) { super(session.getApplication()); if (session == null) { throw new IllegalArgumentException("ISession == null"); } _session = session; _comp = new MyTextArea(session); dt = new DropTarget(_comp, new FileEditorDropTargetListener(session)); }
/** * Append the passed SQL script to the SQL entry area and specify * whether it should be selected. * * @param sqlScript The script to be appended. * @param select If <TT>true</TT> then select the passed script * in the sql entry area. */ public void appendText(String sqlScript, boolean select) { final int start = select ? getText().length() : 0; _comp.append(sqlScript); if (select) { setSelectionEnd(getText().length()); setSelectionStart(start); } }
/** * Append the passed SQL script to the SQL entry area and specify * whether it should be selected. * * @param sqlScript The script to be appended. * @param select If <TT>true</TT> then select the passed script * in the sql entry area. */ public void appendText(String sqlScript, boolean select) { final int start = select ? getText().length() : 0; _comp.append(sqlScript); if (select) { setSelectionEnd(getText().length()); setSelectionStart(start); } }
public void removeUndoableEditListener(UndoableEditListener lis) { _comp.getDocument().removeUndoableEditListener(lis); }
public void addCaretListener(CaretListener lis) { _comp.addCaretListener(lis); }
public int getCaretLinePosition() { int caretPos = _comp.getCaretPosition(); int caretLineOffset = caretPos; try { caretLineOffset = _comp.getLineStartOffset(getCaretLineNumber()); } catch (BadLocationException ex) { s_log.error("BadLocationException in getCaretLinePosition", ex); } return caretPos - caretLineOffset; }
public int getCaretLinePosition() { int caretPos = _comp.getCaretPosition(); int caretLineOffset = caretPos; try { caretLineOffset = _comp.getLineStartOffset(getCaretLineNumber()); } catch (BadLocationException ex) { s_log.error("BadLocationException in getCaretLinePosition", ex); } return caretPos - caretLineOffset; }
public void addUndoableEditListener(UndoableEditListener lis) { _comp.getDocument().addUndoableEditListener(lis); }
/** * @see ISQLEntryPanel#addMouseListener(MouseListener) */ public void addMouseListener(MouseListener lis) { _comp.addMouseListener(lis); }
public void addCaretListener(CaretListener lis) { _comp.addCaretListener(lis); }
public void removeUndoableEditListener(UndoableEditListener lis) { _comp.getDocument().removeUndoableEditListener(lis); }
public void addUndoableEditListener(UndoableEditListener lis) { _comp.getDocument().addUndoableEditListener(lis); }
public DefaultSQLEntryPanel(ISession session) { super(session.getApplication()); if (session == null) { throw new IllegalArgumentException("ISession == null"); } _session = session; _comp = new MyTextArea(session); dt = new DropTarget(_comp, new FileEditorDropTargetListener(session)); }
/** * @see ISQLEntryPanel#getCaretPosition() */ public int getCaretPosition() { return _comp.getCaretPosition(); }
/** * @see ISQLEntryPanel#getSelectedText() */ public String getSelectedText() { return _comp.getSelectedText(); }
/** * @see ISQLEntryPanel#getSelectionEnd() */ public int getSelectionEnd() { return _comp.getSelectionEnd(); }
public int getCaretLineNumber() { try { return _comp.getLineOfOffset(_comp.getCaretPosition()); } catch (BadLocationException ex) { return 0; } }
/** * @see ISQLEntryPanel#getSelectionEnd() */ public int getSelectionEnd() { return _comp.getSelectionEnd(); }
public int getCaretLineNumber() { try { return _comp.getLineOfOffset(_comp.getCaretPosition()); } catch (BadLocationException ex) { return 0; } }
/** * @see ISQLEntryPanel#getSelectedText() */ public String getSelectedText() { return _comp.getSelectedText(); }