View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.ui;
14  
15  import com.eviware.soapui.support.components.BrowserComponent;
16  import com.eviware.soapui.ui.support.DefaultDesktopPanel;
17  
18  import javax.swing.*;
19  import java.awt.*;
20  
21  public class URLDesktopPanel extends DefaultDesktopPanel
22  {
23     private BrowserComponent browser;
24  
25     public URLDesktopPanel( String title, String description, String url )
26     {
27        super( title, description, new JPanel( new BorderLayout() ) );
28  
29        JPanel panel = (JPanel) getComponent();
30  
31        browser = new BrowserComponent();
32        panel.add( browser.getComponent(), BorderLayout.CENTER );
33        navigate( url );
34     }
35  
36     public void navigate( String url )
37     {
38        browser.navigate( url );
39     }
40  
41     public boolean onClose( boolean canCancel )
42     {
43        browser.release();
44        return super.onClose( canCancel );
45     }
46  }