Skip to content

Commit 6ffc4a4

Browse files
hansonrhansonr
authored andcommitted
tooltip on hold during table editing
1 parent 4797dc2 commit 6ffc4a4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSTableUI.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import javax.swing.LookAndFeel;
6464
import javax.swing.SwingUtilities;
6565
import javax.swing.Timer;
66+
import javax.swing.ToolTipManager;
6667
import javax.swing.TransferHandler;
6768
import javax.swing.UIDefaults;
6869
import javax.swing.UIManager;
@@ -363,6 +364,11 @@ private void updateCellNode(DOMNode td, int row, int col, int w, int h) {
363364
}
364365

365366
JComponent editorComp;
367+
368+
369+
370+
371+
private Boolean ttipEnabled;
366372

367373
public void prepareDOMEditor(boolean starting, int row, int col) {
368374
if (editorComp != null) {
@@ -371,15 +377,20 @@ public void prepareDOMEditor(boolean starting, int row, int col) {
371377
}
372378
editorComp = (JComponent) table.getEditorComponent();
373379
if (starting) {
380+
boolean haveToolTip = /** @j2sNative !!javax.swing.ToolTipManager || */false;
381+
ttipEnabled = new Boolean(haveToolTip && ToolTipManager.sharedInstance().isEnabled());
382+
ToolTipManager.sharedInstance().setEnabled(false);
374383
if (editorComp != null) {
375384
editorComp.setVisible(false);
376385
editorComp.setVisible(true);
377386
}
378-
// DOMNode td = CellHolder.findCellNode(this, null, row, col);
379387
} else {
380388
DOMNode td = CellHolder.findCellNode(this, null, table.getEditingRow(), table.getEditingColumn());
381389
updateCellNode(td, row, col, 0, 0);
382390
repaintCell(row, col);
391+
if (ttipEnabled == Boolean.TRUE)
392+
ToolTipManager.sharedInstance().setEnabled(true);
393+
ttipEnabled = null;
383394
}
384395
}
385396

0 commit comments

Comments
 (0)