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() {
2712
2712
final JLabel class_label = new JLabel (classname );
2713
2713
gridbag .setConstraints (class_label , c );
2714
2714
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 ) {
2716
2721
c .gridx += 1 ;
2717
2722
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 );
2719
2727
gridbag .setConstraints (link , c );
2720
2728
panel .add (link );
2721
2729
link .addActionListener (new ActionListener () {
You can’t perform that action at this time.
0 commit comments