Skip to main content

JXTable#find doesn't close if wiithin a modeless dialog

3 replies [Last post]
sbusch
Offline
Joined: 2004-10-05

If you create a table w/ a modeless dialog, and then the user brings up the Find dialog, hitting close or X has no effect. Would a hack workaround be something like: JXTable#setParent(xxx)?

Also, while I have the TableSearchable person, wouldn't it be nice if the user could confine the search to an individual column, rather than the whole table, which I suspect is the rule rather than the exception.

Lastly, an end-user has no way of knowing about CTRL-F (or whatever keystroke). Perhaps, could you add find to the column control menu? Very low key (as it were) ...

Thanks.

Steve

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kleopatra

jdnc-interest@javadesktop.org wrote:
> If you create a table w/ a modeless dialog, and then the user brings up the Find dialog, hitting close or X has no effect.

hmm... you mean the table is added to the dialog and the find is opened?
We have an open issue about it if the dialog is modal:

https://swingx.dev.java.net/issues/show_bug.cgi?id=215

Could you please comment that and add an example when it happens with
a modeless as well.

> Would a hack workaround be something like: JXTable#setParent(xxx)?

does it work for you? If so, you might want to add a patch to the above
issue ;-)

>
> Also, while I have the TableSearchable person, wouldn't it be nice if the user could confine the search to an individual column, rather than the whole table, which I suspect is the rule rather than the exception.
>

yes it would, contributions welcome!

> Lastly, an end-user has no way of knowing about CTRL-F (or whatever keystroke). Perhaps, could you add find to the column control menu? Very low key (as it were) ...
>

Not sure if we want it to appear in the column control by default -
after all it's an application-wide functionality which can be applied to
all searchable components the like? So it's more like the user of a
platform "knows" howto search anyway ... but not very opinionated about it.

The correct thing to do is probably to add a targetable action around
the "find" into a menu and keep its enabled state in synch with the
searchability of the current focus owner. Currently that doesn't work at
all because a) SearchFactory default hiding of the search widgets don't
play well with menu items (hides at once after closing) and b) the
enabled/disabled synch is not well supported.

If you want to appear it in column control, you can add the action with
a key starting with ColumnControlButton.COLUMN_CONTROL_MARKER to the
table's actionMap:

[code]
Action findAction = table.getActionMap().get("find");
table.getActionMap().put(ColumnControlButton.COLUMN_CONTROL_MARKER,
findAction);
[/code]

Hmm... plus a bit of visual cleanup possibly wrapping the "bare" action
into another with localized names...

Thanks for finding the rough edges :-)
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Kleopatra

Kleopatra wrote:

oops...

> play well with menu items (hides at once after closing)
^^^^^
should be "showing"

Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

sbusch
Offline
Joined: 2004-10-05

> hmm... you mean the table is added to the dialog and the find is opened?

Yes. This has nothing to do with Find per se, rather it's a Java no-no. If you have a modeless dialog, descendent dialogs should be using JDialog(modeless-dialog-parent), o/w focusing issue go bonkers. Will try to hack the bug already reported to show the problem.

And, yes, I'd rather Find not be part of the Column control. However, I don't think you should necesarily assume that the user "knows" about find, and I just don't know where else to cue the user of its existence. CTRL-F Find is in most word processors, browsers, etc. However, I think it's an exception to the rule that users see Find w/ tables. Likewise, we easily can print out tables. My own hacked Find always provided for a Print button, which was a pleasant suprise when you just wanted a quick and dirty print out.

Steve