Update of /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/gui/session
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1806/app/src/net/sourceforge/squirrel_sql/client/gui/session
Modified Files:
RowColumnLabel.java I18NStrings.properties
Log Message:
RSyntax editor integration
Index: RowColumnLabel.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/gui/session/RowColumnLabel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RowColumnLabel.java 30 Oct 2005 11:38:39 -0000 1.1
--- RowColumnLabel.java 29 Nov 2009 21:17:54 -0000 1.2
***************
*** 2,5 ****
--- 2,7 ----
import net.sourceforge.squirrel_sql.client.session.ISQLEntryPanel;
+ import net.sourceforge.squirrel_sql.fw.util.StringManager;
+ import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
import javax.swing.*;
***************
*** 14,18 ****
private StringBuffer _msg = new StringBuffer();
! RowColumnLabel(ISQLEntryPanel sqlEntryPanel)
{
super(" ", JLabel.CENTER);
--- 16,24 ----
private StringBuffer _msg = new StringBuffer();
! private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(RowColumnLabel.class);
! private Dimension _dim;
!
!
! RowColumnLabel(ISQLEntryPanel sqlEntryPanel)
{
super(" ", JLabel.CENTER);
***************
*** 29,33 ****
});
! writePosition(0,0);
}
--- 35,41 ----
});
! writePosition(0,0, 0);
!
! setToolTipText(s_stringMgr.getString("RowColumnLabel.tooltip"));
}
***************
*** 36,48 ****
int caretLineNumber = _sqlEntryPanel.getCaretLineNumber();
int caretLinePosition = _sqlEntryPanel.getCaretLinePosition();
! writePosition(caretLineNumber, caretLinePosition);
}
! private void writePosition(int caretLineNumber, int caretLinePosition)
{
_msg.setLength(0);
! _msg.append(caretLineNumber + 1)
! .append(",").append(caretLinePosition + 1);
setText(_msg.toString());
}
--- 44,56 ----
int caretLineNumber = _sqlEntryPanel.getCaretLineNumber();
int caretLinePosition = _sqlEntryPanel.getCaretLinePosition();
+ int caretPosition = _sqlEntryPanel.getCaretPosition();
! writePosition(caretLineNumber, caretLinePosition, caretPosition);
}
! private void writePosition(int caretLineNumber, int caretLinePosition, int caretPosition)
{
_msg.setLength(0);
! _msg.append(caretLineNumber + 1).append(",").append(caretLinePosition + 1).append(" / ").append(caretPosition + 1);
setText(_msg.toString());
}
***************
*** 55,78 ****
public Dimension getPreferredSize()
{
! Dimension dim = super.getPreferredSize();
! FontMetrics fm = getFontMetrics(getFont());
! dim.width = fm.stringWidth("000,000");
! Border border = getBorder();
! if (border != null)
! {
! Insets ins = border.getBorderInsets(this);
! if (ins != null)
! {
! dim.width += (ins.left + ins.right);
! }
! }
! Insets ins = getInsets();
! if (ins != null)
! {
! dim.width += (ins.left + ins.right);
! }
! return dim;
}
}
--- 63,95 ----
public Dimension getPreferredSize()
{
! if (null == _dim)
! {
! _dim = calcPrefSize();
! }
! return _dim;
}
+ private Dimension calcPrefSize()
+ {
+ Dimension dim = super.getPreferredSize();
+ FontMetrics fm = getFontMetrics(getFont());
+ dim.width = fm.stringWidth("000,000 / 00000000");
+ Border border = getBorder();
+ if (border != null)
+ {
+ Insets ins = border.getBorderInsets(this);
+ if (ins != null)
+ {
+ dim.width += (ins.left + ins.right);
+ }
+ }
+ Insets ins = getInsets();
+ if (ins != null)
+ {
+ dim.width += (ins.left + ins.right);
+ }
+ return dim;
+ }
+
}
Index: I18NStrings.properties
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/gui/session/I18NStrings.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** I18NStrings.properties 14 Nov 2005 15:22:59 -0000 1.4
--- I18NStrings.properties 29 Nov 2009 21:17:54 -0000 1.5
***************
*** 31,33 ****
! ObjectTreeInternalFrame.error.retrievecatalog=Unable to retrieve catalog info
\ No newline at end of file
--- 31,35 ----
! ObjectTreeInternalFrame.error.retrievecatalog=Unable to retrieve catalog info
!
! RowColumnLabel.tooltip=line,column / position
\ No newline at end of file
|