/** * Create a instance of {@link BaseSourcePanel}. * Per default, a {@link DefaultSourcePanel} is used. * Subclasses can use this to override the default behavior provided by the DefaultSourcePanel, with a * subclass of BaseSourcePanel. * @return The source panel to use. */ protected BaseSourcePanel createSourcePanel() { /* * This callback method replaces the previous use of setSourcePanel, because since we use syntax highlightning, we need a session. * So we need a callback for "lazy" initialization of the source pane. */ return new DefaultSourcePanel(getSession()); }
protected void refreshComponent() { ISession session = getSession(); if (session == null) { throw new IllegalStateException("Null ISession"); } if(_comp == null){ _comp = createSourcePanel(); } try { PreparedStatement pstmt = createStatement(); try { _comp.load(getSession(), pstmt); } finally { SQLUtilities.closeStatement(pstmt); } } catch (SQLException ex) { s_log.error(ex); session.showErrorMessage(ex); } }
public Component getComponent() { if (_scroller == null) { if (_comp == null) { _comp = createSourcePanel(); } _scroller = new JScrollPane(_comp); LineNumber lineNumber = new LineNumber(_comp); _scroller.setRowHeaderView(lineNumber); _scroller.getVerticalScrollBar().setUnitIncrement(10); } return _scroller; }
protected void refreshComponent() { ISession session = getSession(); if (session == null) { throw new IllegalStateException("Null ISession"); } if(_comp == null){ _comp = createSourcePanel(); } try { PreparedStatement pstmt = createStatement(); try { _comp.load(getSession(), pstmt); } finally { SQLUtilities.closeStatement(pstmt); } } catch (SQLException ex) { s_log.error(ex); session.showErrorMessage(ex); } }
public Component getComponent() { if (_scroller == null) { if (_comp == null) { _comp = createSourcePanel(); } _scroller = new JScrollPane(_comp); LineNumber lineNumber = new LineNumber(_comp); _scroller.setRowHeaderView(lineNumber); _scroller.getVerticalScrollBar().setUnitIncrement(10); } return _scroller; }
/** * Create a instance of {@link BaseSourcePanel}. * Per default, a {@link DefaultSourcePanel} is used. * Subclasses can use this to override the default behavior provided by the DefaultSourcePanel, with a * subclass of BaseSourcePanel. * @return The source panel to use. */ protected BaseSourcePanel createSourcePanel() { /* * This callback method replaces the previous use of setSourcePanel, because since we use syntax highlightning, we need a session. * So we need a callback for "lazy" initialization of the source pane. */ return new DefaultSourcePanel(getSession()); }