File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/main/java/org/scijava/ui/swing/script Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2712,10 +2712,18 @@ public void run() {
27122712 final JLabel class_label = new JLabel (classname );
27132713 gridbag .setConstraints (class_label , c );
27142714 panel .add (class_label );
2715- for (final String url : matches .get (classname )) {
2715+ ArrayList <String > urls = matches .get (classname );
2716+ if (urls .isEmpty ()) {
2717+ urls = new ArrayList <String >();
2718+ urls .add ("https://duckduckgo.com/?q=" + classname );
2719+ }
2720+ for (final String url : urls ) {
27162721 c .gridx += 1 ;
27172722 c .anchor = GridBagConstraints .WEST ;
2718- final JButton link = new JButton (url .endsWith ("java" ) ? "Source" : "JavaDoc" );
2723+ String title = "JavaDoc" ;
2724+ if (url .endsWith (".java" )) title = "Source" ;
2725+ else if (url .contains ("duckduckgo" )) title = "Search..." ;
2726+ final JButton link = new JButton (title );
27192727 gridbag .setConstraints (link , c );
27202728 panel .add (link );
27212729 link .addActionListener (new ActionListener () {
You can’t perform that action at this time.
0 commit comments