diff options
author | Tomas O'Connor <toconnor@openoffice.org> | 2003-02-25 16:22:31 +0000 |
---|---|---|
committer | Tomas O'Connor <toconnor@openoffice.org> | 2003-02-25 16:22:31 +0000 |
commit | 313e6e64a7daaeea920232ebc0d96dcb5b0f1ec2 (patch) | |
tree | eb4d17efbed4a713983428b497eda36275bb57fa /scripting/workben/installer | |
parent | 4f6559bdde6ec5f0be77a1aeb0decba25c3d12a3 (diff) |
Add tooltip to table of office versions
Diffstat (limited to 'scripting/workben/installer')
-rw-r--r-- | scripting/workben/installer/Version.java | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java index 0dc64520f07d..836d6557ee7e 100644 --- a/scripting/workben/installer/Version.java +++ b/scripting/workben/installer/Version.java @@ -71,7 +71,46 @@ public class Version extends javax.swing.JPanel implements ActionListener, Table } tableModel.addTableModelListener(this); - JTable tableVersions = new JTable(tableModel); + JTable tableVersions = new JTable(tableModel) { + public String getToolTipText(MouseEvent event) + { + int col = columnAtPoint( event.getPoint() ); + if (col != 2) + return null; + + int row = rowAtPoint( event.getPoint() ); + Object o = getValueAt(row, col); + + if (o == null) + return null; + + if (o.toString().equals("")) + return null; + + return o.toString(); + } + + public Point getToolTipLocation(MouseEvent event) + { + int col = columnAtPoint( event.getPoint() ); + if (col != 2) + return null; + + int row = rowAtPoint( event.getPoint() ); + Object o = getValueAt(row,col); + + if (o == null) + return null; + + if (o.toString().equals("")) + return null; + + Point pt = getCellRect(row, col, true).getLocation(); + pt.translate(-1,-2); + return pt; + } + }; + tableVersions.setPreferredSize(new Dimension(InstallWizard.DEFWIDTH,InstallWizard.DEFHEIGHT)); tableVersions.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS); tableVersions.doLayout(); |