Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
12c (12.1.2)

E23196-02

Package oracle.ide.config

Contains classes encapsulating JDevelopers's environment settings.

See: Description

Package oracle.ide.config Description

Contains classes encapsulating JDevelopers's environment settings. Addins can extends these settings with their own.

Related Documentation

See Extending JDeveloper Using the Addin API for detailed information.


Example of an option bean

package mypackage;

import oracle.ide.config.ChangeEventSource;
import oracle.ide.util.Copyable;

public class MyConfigOptions extends ChangeEventSource
    implements Copyable
{
  public static final String KEY = "MyConfigOptions";

  private boolean _myOption;

  public boolean getMyOption()
  {
    return _myOption;
  }

  public void setMyOption( boolean myOption )
  {
    _myOption = myOption;
  }

  public Object copyTo( Object target )
  {
    final MyConfigOptions other = ( target != null ) ? (MyConfigOptions) target: new MyConfigOptions();

    other.setMyOption(getMyOption());

    return other;
  }
}

Example of an option panel

package mypackage;

import java.awt.BorderLayout;
import javax.swing.JCheckBox;
import oracle.ide.Ide;
import oracle.ide.config.IdeSettings;
import oracle.ide.panels.DefaultTraversablePanel;
import oracle.ide.panels.Navigable;
import oracle.ide.panels.TraversableContext;

public class MyConfigPanel extends DefaultTraversablePanel
{
  private JCheckBox _myCheckBox;

  public static final void registerPanel()
  {
    IdeSettings ideSettings = Ide.getSettings();
    if ( ideSettings.getData(MyConfigOptions.KEY) == null )
    {
      ideSettings.putData(MyConfigOptions.KEY, new MyConfigOptions());
    }

    Navigable myNavigable = new Navigable("My Options", MyConfigPanel.class);

    // To register a top level panel
    IdeSettings.registerUI(myNavigable);

//  To register a child of another Navigable:
//  Navigable parentNavigable = null;
//  parentNavigable.addChildNavigable(myNavigable);
  }

  public MyConfigPanel()
  {
    setLayout(new BorderLayout());
    _myCheckBox = new JCheckBox("My Option:", true);
    add(_myCheckBox, BorderLayout.CENTER);
  }

  public void onEntry( TraversableContext tc )
  {
    final MyConfigOptions options = (MyConfigOptions) tc.find( MyConfigOptions.KEY );
    _myCheckBox.setSelected(options.getMyOption());
  }

  public void onExit( TraversableContext tc )
  {
    final MyConfigOptions options =(MyConfigOptions) tc.find( MyConfigOptions.KEY );
    options.setMyOption(_myCheckBox.isSelected());
  }

}

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
12c (12.1.2)

E23196-02

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