|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: SearchHighlighter for TreeHi Jeanette,
thank you for your fast answer. But sorry I don't get it yet. :( How do I change the pattern dynamically with every key entered in the textfield or when pressed a button? Do I have to add a new SearchPredicate each time, beacause there is no set method for the pattern? greets Juliane [Message sent by forum member 'jayrich' (jay_rich@...)] http://forums.java.net/jive/thread.jspa?messageID=369891 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for Tree> How do I change the pattern dynamically with every
> key entered in the textfield or when pressed a > button? Do I have to add a new SearchPredicate each > time, beacause there is no set method for the > pattern? > don't - let one of the search widgets (JXFindBar or JXFindPanel) do the work for you. Or implement a subclass if you want more control. Or if you insist to do it from scratch, have a look into how they are implemented. But why bother with all the dirty details :-) So take a step back: - use and understand the search support as is (control-f) automagically opens the standard search widget (findbar or dialog depends on the useFindbar property of the SearchFactory) - clearly define what you want different from the default - implement only the part that's different Since yesterday, the search-demo in the demos project is updated, you can run the webstartable to have a look https://swinglabs-demos.dev.java.net/demos/swingxset6/swingxset.jnlp CU Jeanette [Message sent by forum member 'kleopatra' (fastegal@...)] http://forums.java.net/jive/thread.jspa?messageID=369894 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for Tree>
> Since yesterday, the search-demo in the demos project > is updated, you can run the webstartable to have a > look > > https://swinglabs-demos.dev.java.net/demos/swingxset6/swingxset.jnlp > there's nothing as effective as publishing a link to make the bugs stumble out <g> Okay, now it's working as I expect it to work: - type something into the text field and see the match highlight the cell containing the match - toggle the "text match marker" checkbox, type something: the marker has changed to highlight only the exact text-match instead of the whole cell - toggle the "animate" checkbox ... and see how you can drive your users crazy <g> The java code can be viewed in the codeviewer in the lower left section of the frame: choose a snippet from the combo to highlight and jump to the relevant part/s. That's a rather cool feature taken from the original SwingSet3 - I think it can be very helpful to quickly see what/how's going on ... if only we set the snippets ... ehem ... Did add some to the searchDemo, please let me know if they help or confuse :-) CU Jeanette [Message sent by forum member 'kleopatra' (fastegal@...)] http://forums.java.net/jive/thread.jspa?messageID=369914 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for Tree> there's nothing as effective as publishing a link to
> make the bugs stumble out <g> :) oh know I see what the box is for ;-) > Did add some to the searchDemo, please let me know if they help or > confuse :-) They are helpful, but there is something you maybe can change. Scrolling the sourcecode with the scrollerbutton (up and down) is very slow. I now have my tree linked with my own FindPanel (like the JXFindBar without the label and buttons, just the textfield). However my highlighter is not used, the first matching cell is selected. What's wrong? And I'm still to foolish, to highlight all matches, not just the first. Neither the searchable nor the PatternModel have methods for this, Do I have to write it on my own? Here my code: private JXTree optionTree = new JXTree(); optionTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); ColorHighlighter colorHighlighter = new ColorHighlighter(null, null, Color.MAGENTA); TreeSearchable s = new TreeSearchable(optionTree) { @Override protected HighlightPredicate createMatchPredicate() { return hasMatch() ? createSearchPredicate() : HighlightPredicate.NEVER; } private SearchPredicate createSearchPredicate() { SearchPredicate predicate = new SearchPredicate(lastSearchResult.getPattern(), -1, -1); return predicate; } }; s.setMatchHighlighter(colorHighlighter); optionTree.setSearchable(s); DefaultMutableTreeNode root = new DefaultMutableTreeNode("root"); ... optionTree.setModel(new DefaultTreeModel(root, false)); optionTree.setRootVisible(false); optionTree.setBorder(new EmptyBorder(5, 5, 5, 5)); JPanel p = new JPanel(new BorderLayout()); p.add(new FindPanel(s), BorderLayout.NORTH); p.add(optionTree, BorderLayout.CENTER); [Message sent by forum member 'jayrich' (jay_rich@...)] http://forums.java.net/jive/thread.jspa?messageID=369923 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for TreeHey Jeanette,
I found the answer :) Following line of code was missing: [code] optionTree.putClientProperty(AbstractSearchable.MATCH_HIGHLIGHTER, Boolean.TRUE); [/code] Inserting it, everthing works like I wanted it to work. Thank you very much for your time. It would be nice I think if anybody can append some words to the comment of AbstractSearchable.markByHighlighter() about the case when the returnvalue is false. THX Juliane [Message sent by forum member 'jayrich' (jay_rich@...)] http://forums.java.net/jive/thread.jspa?messageID=369930 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for Tree> They are helpful, but there is something you maybe can change. Scrolling the sourcecode with the scrollerbutton (up and down) is very slow.
yeah, that's a known issue: https://swinglabs-demos.dev.java.net/issues/show_bug.cgi?id=36 could point fingers to the original swingset3 -but probably will tackle soon. Glad you solved your problem. As to the doc/api of AbstractSearchable - good idea to improve it. Would you please file an issue in the swingx issue tracker, so we don't forget? Thanks Jeanette [Message sent by forum member 'kleopatra' (fastegal@...)] http://forums.java.net/jive/thread.jspa?messageID=369936 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for TreeDone => #1210
Have a nice weekend. [Message sent by forum member 'jayrich' (jay_rich@...)] http://forums.java.net/jive/thread.jspa?messageID=369948 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
|
|
Re: SearchHighlighter for Tree> Done => #1210
> > Have a nice weekend. Thanks - same to you :-) Jeanette [Message sent by forum member 'kleopatra' (fastegal@...)] http://forums.java.net/jive/thread.jspa?messageID=369950 --------------------------------------------------------------------- To unsubscribe, e-mail: jdnc-unsubscribe@... For additional commands, e-mail: jdnc-help@... |
| Free embeddable forum powered by Nabble | Forum Help |