Extension SDK 10.1.2

Package oracle.ide.docking

Contains interfaces and classes responsible for the dockable behavior provided by JDeveloper.

See:
          Description

Interface Summary
Dockable A Dockable interface.
DockableContainer Internal use only.
DockableFactory The DockableFactory is responsible for translating a dockable name found in a layout file into an instance of Dockable.
DockableListener Interface to support notification of visibility changes on a dockable.
DockableView This interface is the bridge between the Dockable interface docking system and the View interface.
DockLayoutConstants Deprecated. use IdeConstants instead.
TitleChangeListener An interface that clients that want to be notified of docking changes in a docking port must implement.
 

Class Summary
DockableEvent The class describes events on Dockable objects.
Although it might seem similar to a ComponentListener on the UI, it is different because when two dockable are tabbed together, ComponentListener considers the visibility of the windows (the selected page is visible and the others are hidden) while the DockableEvent will be sent for each Dockable corresponding to a tab in the tab pane.
DockableWindow This class is the bridge between the Dockable interface docking system and the View interface.
DockingParam This class is used to specify how to dock a dockable
DockStation The singleton for docking operations.
DockUtil  
Site This class is used to store the sizes of a dockable window.
TitleChangeEvent The TileChangeEvent contains the new title.
 

Package oracle.ide.docking Description

Contains interfaces and classes responsible for the dockable behavior provided by JDeveloper.

In general, addins developers will extend DockableWindow for each of dockable windows and write one DockableFactory for the whole addin.

In the following example, our addin has only one dockable.

In our Addin class, we register our DockableFactory:

import oracle.ide.*;
import oracle.ide.addin.*;
import oracle.ide.docking.*;

public class TestAddin implements Addin
{
  public void initialize()
  {
    Ide.getDockStation().registerDockableFactory("MYADDIN", new MyDockableFactory());
  }
  ...

Our factory only knows one Dockable.
It returns it when asked through getDockable() and installs it at a default location in install() the first time a layout is loaded, or more precisely the first time the layout is loaded since the addin has been installed.

import oracle.ide.*;
import oracle.ide.docking.*;
import oracle.ide.layout.*;

public class MyDockableFactory implements DockableFactory
{
  public final String VIEW_TYPE = "MyDockables";
  private ViewOne _viewOne;

  public Dockable getDockable(ViewId viewId)
  {
    String name = viewId.getName();
    if (name.equals(ViewOne.NAME))
    {
      return getViewOne();
    }

    return null;
  }

  public void install()
  {
    Ide.getDockStation().dock(getViewOne(), DockStation.EAST, true);
  }

  private ViewOne getViewOne()
  {
    if (_viewOne == null)
    {
      _viewOne = new ViewOne(null, VIEW_TYPE + "." + ViewOne.NAME);
    }
    return _viewOne;
  }
}

And our Dockable window is just a button. You can customize the dockable further by overriding Dockable methods but for this example, we only define the minimum.

import java.awt.*;
import java.util.*;
import javax.swing.*;
import oracle.ide.*;
import oracle.ide.addin.*;
import oracle.ide.docking.*;

public class ViewOne extends DockableWindow
{
  public static final String NAME = "ViewOne";
  private JComponent _ui;

  ViewOne(View owner, String viewId)
  {
    super(owner, viewId);
  }

  public Context getContext(EventObject e )
  {
    IdeContext context = new IdeContext( this, e );
    context.setView( this );
    return context;
  }

  public String getTitleName()
  {
    return getId();
  }

  public String getTabName()
  {
    return getId();
  }

  public Component getGUI()
  {
    if (_ui == null)
    {
      _ui = new JButton("This is ViewOne");
    }
    return _ui;
  }
  }

Related Documentation

See Extending JDeveloper Using the Addin API for detailed information.


Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.