View Javadoc

1   package org.robsite.extension.rss;
2   
3   import oracle.ide.docking.DockStation;
4   import oracle.ide.docking.Dockable;
5   import oracle.ide.docking.DockableFactory;
6   import oracle.ide.docking.DockingParam;
7   import oracle.ide.layout.ViewId;
8   import oracle.ide.log.LogManager;
9   import oracle.ide.log.LogWindow;
10  
11  /***
12   * Dockable factory for the RSS News dockable window.
13   * 
14   * @author brian_duff@sourceforge.net
15   * @version $Revision: 1.1.1.1 $
16   */
17  public class NewsDockableFactory implements DockableFactory
18  {
19    private NewsDockableWindow _dockableWindow;
20  
21    public NewsDockableFactory()
22    {
23      super();
24    }
25  
26    public Dockable getDockable(ViewId viewId)
27    {
28      if ( _dockableWindow == null )
29      {
30        _dockableWindow = createDockableWindow();
31      }
32      return _dockableWindow;
33    }
34  
35    public void install()
36    {
37    }
38    
39    private NewsDockableWindow createDockableWindow()
40    {
41      NewsDockableWindow dockable = new NewsDockableWindow();
42      DockingParam param = new DockingParam();
43      
44      LogWindow logWindow = LogManager.getIdeLogWindow();
45      if ( DockStation.getDockStation().isDockableVisible( logWindow ) )
46      {
47        param.setTabbedWith( LogManager.getIdeLogWindow() );    
48      }
49      else
50      {
51        param.setPosition( DockStation.SOUTH );
52      }
53      
54      DockStation.getDockStation().dock( dockable, param );
55      
56      return dockable;
57    }
58  }