Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.db.panels
Class PanelLibrary

java.lang.Object
  extended by oracle.ide.db.panels.PanelLibrary

public abstract class PanelLibrary
extends java.lang.Object

A panel library is a way that a list of wizard/dialog panels can be built up generically, and a set of Steps or Navigables - flat or nested can be retrieved. This allows there to be one source of truth for the panels available for a given object.

Since:
11.0

Nested Class Summary
static interface PanelLibrary.HeaderPanel
          Interface to be implemented if a panel can effect a change to the panel set in a dialog.
static interface PanelLibrary.HeaderPanelListener
          Interface that defines a listener for changes to the panel set.
 
Field Summary
static java.lang.String COMMIT_TO_PROVIDER_KEY
          Deprecated. use DBEditorConfig.isCommitToProvider()
static java.lang.String KEY
          Deprecated. use data.find( PanelLibrary.class );
 
Constructor Summary
protected PanelLibrary(java.lang.String type)
           
protected PanelLibrary(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> helpIDs)
          Allows the customisation of help IDs from the default set held by this library.
 
Method Summary
protected  void addDefaultPanels(java.util.List<Navigable> navs, boolean edit)
           
protected  void addNavigable(java.lang.String title, Navigable n)
           
protected  Navigable addPanel(java.lang.String title, java.lang.Class clz, java.lang.String helpId)
           
protected  Navigable addPanel(java.lang.String title, java.lang.Class clz, java.lang.String helpId, java.lang.Class[] constructorSig, java.lang.Object[] constructorArgs)
           
 boolean canEditObject(DBObject obj, DBObjectProvider pro)
          Tests whether this panel library can edit the given object.
 boolean canReplaceByDefault()
          Tests whether it is ok to replace the object type for this panel library without prompting the user about possible data loss.
 void commitToProvider(DBEditorConfig config)
          The config must have a result of SUCCCESS set by this method for the dialog to be disposed of.
protected  Traversable createMainPanel(Traversable header, Navigable[] navs, java.lang.String startPage)
          Gets the main panel that contains all the navigable for the dialog.
 java.util.List<Navigable> getCreateNavigables(DBObject obj, DBObjectProvider pro)
          Returns the navigables to create the given object.
 java.lang.String getCreateText()
          Returns the text used to offer the option to create an object from this library (e.g.
 java.lang.String getCreateTitle()
          Returns the title to use for the create dialog.
 java.util.Map<java.lang.String,java.lang.Class> getCreateVerifiers()
          Returns a map of verifier keys to classes for the creation of an object.
protected  Navigable[] getDefaultPanels(boolean edit)
          gets the default panels for this library.
 java.util.List<Navigable> getEditNavigables(DBObject obj, DBObjectProvider pro)
          Returns the navigables to edit the given object.
 java.lang.String getEditTitle()
          Returns the title to use for the edit dialog.
 java.util.Map<java.lang.String,java.lang.Class> getEditVerifiers()
          Returns a map of verifier keys to classes for the edit of an object.
protected  java.lang.Class<? extends Traversable> getHeader()
          Returns the traversable class to use for the header component.
 java.awt.Component getInitialFocus(Traversable mainPanel)
          Get a component from the given main panel for the dialog to put the initial focus in.
 Traversable getMainDialogPanel(DBObject obj, DBObjectProvider pro, DBObject child, Navigable[] navs)
          Retruns the main panel to use in a dialog.
 DBObject getObjectForCreate(Schema schema, DBObjectProvider pro, DBObject parent)
          Returns an object ready to be created.
 java.util.List<Navigable> getSimpleNavigables()
          Returns the navigables for the simple edit mode of the dialog, or null if no simple edit is supported for this library.
protected  java.util.List<java.lang.String> getSimpleTitles()
          Returns the titles for simple editing.
 java.awt.Dimension getSize(boolean edit)
          Returns a size for the edit dialog to take by default.
 java.lang.String getStartPage(DBObject child)
          Returns the page of the editor to start from for the given child object.
protected abstract  java.util.List<java.lang.String> getTitles(DBObject obj, DBObjectProvider pro, boolean editing)
          Returns the titles of the panels needed to create or edit the given object as appropriate.
 java.lang.String getType()
          Returns the object type this library provides panels for.
protected  java.lang.String getUniqueName(java.lang.String type)
          Returns a unique name for a new object of the given type.
protected  java.util.Map<java.lang.String,java.lang.Class> getVerifiers(boolean editing)
          Returns the verifiers for creating or editing.
 void makeNameUnique(DBObject dbo, Schema schema, DBObjectProvider pro, DBObject parent)
           
protected  DBObject newDBObject(DBObjectProvider pro, Schema schema, DBObject parent)
          Returns a new DBObject instance for the type of object this library supports.
static void setBaseNamePrefix(java.lang.String baseNamePrefix)
           
 void setDefaultPanels(Navigable[] navs)
          Sets the default panels for this library.
 void setDefaultPanels(Navigable[] navs, boolean alwaysAddDefaultPanels)
          Sets the default panels for this library.
 boolean shouldResetObjectBeforeEdit(DBEditorConfig config)
          If this method returns true the object to edit will be completely reset before the edit dialog is launched - so all of its properties will be required from the database.
protected  void showEditor(DBEditorConfig config)
           
protected  boolean showEditorAfterCommit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

@Deprecated
public static final java.lang.String KEY
Deprecated. use data.find( PanelLibrary.class );
See Also:
Constant Field Values

COMMIT_TO_PROVIDER_KEY

@Deprecated
public static final java.lang.String COMMIT_TO_PROVIDER_KEY
Deprecated. use DBEditorConfig.isCommitToProvider()
See Also:
Constant Field Values
Constructor Detail

PanelLibrary

protected PanelLibrary(java.lang.String type)

PanelLibrary

protected PanelLibrary(java.lang.String type,
                       java.util.Map<java.lang.String,java.lang.String> helpIDs)
Allows the customisation of help IDs from the default set held by this library.

Method Detail

getType

public java.lang.String getType()
Returns the object type this library provides panels for.


setDefaultPanels

public final void setDefaultPanels(Navigable[] navs)
Sets the default panels for this library. The default panels are always included at the end of the panel list regardless of the object state, or whether we're creating or editing. By default the panels will not appear if the object create or edit has no panels defined.

See Also:
BaseDBEditorFactory#initializeLibrary, setDefaultPanels(Navigable[],boolean)

setDefaultPanels

public final void setDefaultPanels(Navigable[] navs,
                                   boolean alwaysAddDefaultPanels)
Sets the default panels for this library. The default panels are always included at the end of the panel list regardless of the object state, or whether we're creating or editing.

Parameters:
navs - the navigables describing the default panels
alwaysAddDefaultPanels - whether to always add the default panels, even if the object's panel list is empty (getNavigables returned an empty list).
See Also:
BaseDBEditorFactory#initializeLibrary

getDefaultPanels

protected final Navigable[] getDefaultPanels(boolean edit)
gets the default panels for this library. Typically this will be the panels held in m_defaultPanels, but this allows clients to override this behaviour.


addDefaultPanels

protected final void addDefaultPanels(java.util.List<Navigable> navs,
                                      boolean edit)

getHeader

protected java.lang.Class<? extends Traversable> getHeader()
Returns the traversable class to use for the header component. By default this is a simple name and schema editor.


getInitialFocus

public java.awt.Component getInitialFocus(Traversable mainPanel)
Get a component from the given main panel for the dialog to put the initial focus in. Do NOT return a disabled component because it'll make the dialog inaccessible by locking tab navigation.

Returns:
the default focus component for the given panel.

getMainDialogPanel

public final Traversable getMainDialogPanel(DBObject obj,
                                            DBObjectProvider pro,
                                            DBObject child,
                                            Navigable[] navs)
Retruns the main panel to use in a dialog.


createMainPanel

protected Traversable createMainPanel(Traversable header,
                                      Navigable[] navs,
                                      java.lang.String startPage)
Gets the main panel that contains all the navigable for the dialog. If this returns null, no dialog will be shown and the factory will go straight to calling commitToProvider.


getCreateNavigables

public final java.util.List<Navigable> getCreateNavigables(DBObject obj,
                                                           DBObjectProvider pro)
Returns the navigables to create the given object.


getCreateVerifiers

public final java.util.Map<java.lang.String,java.lang.Class> getCreateVerifiers()
Returns a map of verifier keys to classes for the creation of an object.


canEditObject

public boolean canEditObject(DBObject obj,
                             DBObjectProvider pro)
Tests whether this panel library can edit the given object. If getTitles builds the object, it is advised that this is overridden to speed up context menus.


getEditNavigables

public final java.util.List<Navigable> getEditNavigables(DBObject obj,
                                                         DBObjectProvider pro)
Returns the navigables to edit the given object.


getEditVerifiers

public final java.util.Map<java.lang.String,java.lang.Class> getEditVerifiers()
Returns a map of verifier keys to classes for the edit of an object.


getSimpleNavigables

public final java.util.List<Navigable> getSimpleNavigables()
Returns the navigables for the simple edit mode of the dialog, or null if no simple edit is supported for this library.


getObjectForCreate

public final DBObject getObjectForCreate(Schema schema,
                                         DBObjectProvider pro,
                                         DBObject parent)
Returns an object ready to be created. The object type will match this library type and will set up in the given schema with a unique name and a temporary object id.


makeNameUnique

public final void makeNameUnique(DBObject dbo,
                                 Schema schema,
                                 DBObjectProvider pro,
                                 DBObject parent)

commitToProvider

public void commitToProvider(DBEditorConfig config)
The config must have a result of SUCCCESS set by this method for the dialog to be disposed of.


showEditorAfterCommit

protected boolean showEditorAfterCommit()

showEditor

protected void showEditor(DBEditorConfig config)

getUniqueName

protected java.lang.String getUniqueName(java.lang.String type)
Returns a unique name for a new object of the given type.


getStartPage

public java.lang.String getStartPage(DBObject child)
Returns the page of the editor to start from for the given child object. Returns null by default - override for multi-page editors.


newDBObject

protected DBObject newDBObject(DBObjectProvider pro,
                               Schema schema,
                               DBObject parent)
Returns a new DBObject instance for the type of object this library supports.

Parameters:
the - parent object for this object. can be null.

getTitles

protected abstract java.util.List<java.lang.String> getTitles(DBObject obj,
                                                              DBObjectProvider pro,
                                                              boolean editing)
Returns the titles of the panels needed to create or edit the given object as appropriate. Returning null disables the given create or edit operation, returning an empty List will mean the operation is enabled and the dialog will be shown with just the default panels registered with the editor factory in question.


getVerifiers

protected java.util.Map<java.lang.String,java.lang.Class> getVerifiers(boolean editing)
Returns the verifiers for creating or editing.


getSimpleTitles

protected java.util.List<java.lang.String> getSimpleTitles()
Returns the titles for simple editing. If this method is overridden to return non-null an advanced header will be used and the panel set this list defines will make up the simple UI.

Returns null by default (no simple edit).


addPanel

protected final Navigable addPanel(java.lang.String title,
                                   java.lang.Class clz,
                                   java.lang.String helpId)

addPanel

protected final Navigable addPanel(java.lang.String title,
                                   java.lang.Class clz,
                                   java.lang.String helpId,
                                   java.lang.Class[] constructorSig,
                                   java.lang.Object[] constructorArgs)

addNavigable

protected final void addNavigable(java.lang.String title,
                                  Navigable n)

getSize

public java.awt.Dimension getSize(boolean edit)
Returns a size for the edit dialog to take by default. Returns null by default which means the dialog will take the standard ide edit dialog size.


getCreateText

public java.lang.String getCreateText()
Returns the text used to offer the option to create an object from this library (e.g. "New Table..." ). The text may contain a mnemonic.


getCreateTitle

public java.lang.String getCreateTitle()
Returns the title to use for the create dialog.


getEditTitle

public java.lang.String getEditTitle()
Returns the title to use for the edit dialog.


canReplaceByDefault

public boolean canReplaceByDefault()
Tests whether it is ok to replace the object type for this panel library without prompting the user about possible data loss.


shouldResetObjectBeforeEdit

public boolean shouldResetObjectBeforeEdit(DBEditorConfig config)
If this method returns true the object to edit will be completely reset before the edit dialog is launched - so all of its properties will be required from the database.

The default implementation returns true if the underlying provider doesn't support timestamps for the given object type.


setBaseNamePrefix

public static void setBaseNamePrefix(java.lang.String baseNamePrefix)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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