Extension SDK 10.1.3.36.73

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.
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.
DockableView This interface is the bridge between the Dockable interface docking system and the oracle.ide.addin.View interface.
DockableWindow This class is the bridge between the Dockable interface docking system and the oracle.ide.addin.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.addin.*;
import oracle.ide.docking.*;

public class TestAddin implements Addin
{
  public void initialize()
  {
    DockStation.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.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()
  {
    DockingParam dockingParam = new DockingParam();
    dockingParam.setPosition(DockStation.EAST);
    DockStation.getDockStation().dock(getViewOne(), dockingParam);
  }

  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.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 )
  {
    Context context = Context.newIdeContext(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 10.1.3.36.73

 

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