public abstract class PanelLibrary<T extends DBObject>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PanelLibrary.DelegatePanelLibrary<T extends DBObject>
Allows the creation of a PanelLibrary that can delegate all the panel
logic to an underlying PanelLibrary and then override other
specifics as required.
|
static interface |
PanelLibrary.HeaderPanel
Deprecated.
replaced by PanelSetChangeValidator
|
static interface |
PanelLibrary.HeaderPanelListener
Deprecated.
replaced by PanelSetChanger
|
static class |
PanelLibrary.PanelSetChanger
If a PanelSetChanger is in the TraversableContext then it can be used
to change the set of panels in the current editor.
|
static class |
PanelLibrary.PanelSetChangeValidator
Optional callback validation mechanism when a panel set change is made.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMIT_TO_PROVIDER_KEY
Deprecated.
|
static java.lang.String |
KEY
Deprecated.
use data.find( PanelLibrary.class );
|
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultPanels(java.util.List<Navigable> navs,
boolean edit) |
protected void |
addNavigable(java.lang.String title,
Navigable n,
java.lang.String... properties)
Adds a new panel to this library.
|
protected Navigable |
addPanel(java.lang.String title,
java.lang.Class<? extends Traversable> clz,
java.lang.String helpID,
java.lang.Class[] constructorSig,
java.lang.Object[] constructorArgs,
java.lang.String... properties)
Adds a new panel to this library and returns the resulting Navigable.
|
protected Navigable |
addPanel(java.lang.String title,
java.lang.Class<? extends Traversable> clz,
java.lang.String helpID,
java.lang.String... properties)
Adds a new panel to this library and returns the resulting Navigable.
|
protected void |
addSupportedTitle(SystemObject obj,
DBObjectProvider pro,
java.lang.String[] propPaths,
java.util.Collection<java.lang.String> titles,
java.lang.String title)
Deprecated.
register the panel against its properties using addPanel
and this is done automatically.
|
protected void |
addSupportedTitle(SystemObject obj,
DBObjectProvider pro,
java.lang.String propPath,
java.util.Collection<java.lang.String> titles,
java.lang.String title)
Deprecated.
register the panel against its properties using addPanel
and this is done automatically.
|
boolean |
canEditObject(T 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(T obj,
DBObjectProvider pro)
Deprecated.
|
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()
Deprecated.
verifiers are no longer used, the provider's
PropertyManager controls everything.
|
Navigable |
getDDLNavigable()
Gets the Navigable representing the DDL panel for this library.
|
protected java.lang.Class<? extends Traversable> |
getDDLPanel() |
Navigable[] |
getDefaultPanels(boolean edit)
Gets the default panels for this library.
|
java.util.List<Navigable> |
getEditNavigables(T obj,
DBObjectProvider pro)
Deprecated.
use
#getNavigables(T,DBObjectProvider,boolean) |
java.lang.String |
getEditTitle()
Returns the title to use for the edit dialog.
|
java.util.Map<java.lang.String,java.lang.Class> |
getEditVerifiers()
Deprecated.
verifiers are no longer used, the provider's
PropertyManager controls everything.
|
protected java.lang.String |
getGeneralHelpID()
Gets the help ID for the general panel.
|
Navigable |
getGeneralNavigable(DBEditorConfig editorConfig)
Gets the Navigable for the "General" panel/section in a flat editor.
|
java.util.Collection<java.lang.String> |
getGeneralTitles()
Given the list of available titles, this method returns the subset of
those titles that should be included on the "General" page of a flat
editor, rather than appearing on pages of their own.
|
protected java.lang.Class<? extends Traversable> |
getHeader()
Returns the traversable class to use for the header component.
|
protected java.lang.String |
getHeaderHelpID()
Gets the help ID for the header panel.
|
java.awt.Component |
getInitialFocus(Traversable mainPanel)
Get a component from the given main panel for the dialog to put the
initial focus in.
|
protected java.util.logging.Logger |
getLogger()
Gets the Logger to use for any messages that are logged by this
PanelLibrary.
|
Traversable |
getMainDialogPanel(DBEditorConfig config,
Navigable[] navs)
Returns the main panel to use in an editor described by the given
config.
|
Traversable |
getMainDialogPanel(T obj,
DBObjectProvider pro,
DBObject child,
Navigable[] navs)
Deprecated.
replaced by
getMainDialogPanel(DBEditorConfig,Navigable[]) |
protected java.util.Set<java.lang.String> |
getNamesToExclude(DBObjectProvider pro,
DBObject contextObject) |
protected java.util.Map<java.lang.String,Navigable> |
getNavigables() |
java.util.List<Navigable> |
getNavigables(DBEditorConfig editorConfig)
Gets the Navigables for the editor of the given object.
|
T |
getObjectForCreate(Schema schema,
DBObjectProvider pro,
DBObject parent)
Returns an object ready to be created.
|
protected java.util.Collection<java.lang.String> |
getPropsRequiredForNavigables()
Get properties (derived or otherwise) that are required to be built before
determining the Navigables to to return from
getNavigables(Collection<String>,DBObject,DBObjectProvider,boolean,boolean,boolean).
|
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.
|
boolean |
getSkipGeneralForNewObject()
Tests whether the "General" page should be "skipped" when an overview
editor for a newly created object is first shown.
|
java.lang.String |
getStartPage(DBEditorConfig config)
Returns the page of the editor to start from.
|
java.lang.String |
getStartPage(DBObject child)
Deprecated.
Replaced by
getStartPage(DBEditorConfig) . |
protected abstract java.util.List<java.lang.String> |
getTitles(T 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)
Deprecated.
unqiue name is determined by the api
|
protected java.util.Map<java.lang.String,java.lang.Class> |
getVerifiers(boolean editing)
Deprecated.
verifiers are no longer used, the provider's
PropertyManager controls everything.
|
protected boolean |
includePanelHeaders(DBEditorConfig editorConfig)
Tests whether this panel library should include a header at the top
of each panel with its title and icon (if defined).
|
void |
makeNameUnique(DBObject dbo,
Schema schema,
DBObjectProvider pro,
DBObject parent)
It is expected that an new object created by
getObjectForCreate(oracle.javatools.db.Schema, oracle.javatools.db.DBObjectProvider, oracle.javatools.db.DBObject) will be initialized by the provider's
DBObjectFactory and therefore have a default name. |
protected T |
newDBObject(DBObjectProvider pro,
Schema schema,
DBObject parent)
Returns a new DBObject instance for the type of object this library
supports.
|
protected void |
setContextObject(SchemaObject newObject,
SchemaObject contextObject)
Set the context object on the newly created SystemObject.
|
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.
|
boolean |
shouldValidateOnExit(oracle.ideimpl.db.panels.BaseEditorPanel panel,
Namespace dataContext)
Tests whether the given panel should validate the objects and
properties that are being edited on it when onExit is called, blocking
the exit if the model is invalid.
|
boolean |
showEditorAfterCommit()
Tests whether the IDE Editor for the object should be shown after any
commit.
|
@Deprecated public static final java.lang.String KEY
@Deprecated public static final java.lang.String COMMIT_TO_PROVIDER_KEY
DBEditorConfig.isCommitToProvider()
protected PanelLibrary(java.lang.String type)
protected PanelLibrary(java.lang.String type, java.util.Map<java.lang.String,java.lang.String> helpIDs)
protected java.util.logging.Logger getLogger()
public java.lang.String getType()
public final void setDefaultPanels(Navigable[] navs)
BaseDBEditorFactory#initializeLibrary
,
setDefaultPanels(Navigable[],boolean)
public final void setDefaultPanels(Navigable[] navs, boolean alwaysAddDefaultPanels)
navs
- the navigables describing the default panelsalwaysAddDefaultPanels
- whether to always add the default panels,
even if the object's panel list is empty (getNavigables returned an empty
list).BaseDBEditorFactory#initializeLibrary
public Navigable[] getDefaultPanels(boolean edit)
protected final void addDefaultPanels(java.util.List<Navigable> navs, boolean edit)
protected java.lang.Class<? extends Traversable> getHeader()
protected java.lang.String getHeaderHelpID()
By default this returns getGeneralHelpID()
as the header is
shown on the general panel.
protected java.lang.String getGeneralHelpID()
#getGeneralTraversable()
public final Navigable getGeneralNavigable(DBEditorConfig editorConfig)
public java.util.Collection<java.lang.String> getGeneralTitles()
The default implementation will return
public boolean getSkipGeneralForNewObject()
By default this returns true if the only general title is "Comment".
protected java.lang.Class<? extends Traversable> getDDLPanel()
public Navigable getDDLNavigable()
The default implementation uses getDDLPanel()
and constructs
a Navigable with the standard title ("DDL") and help id. You
therefore only need to override this method to customize the title or
help id.
public java.awt.Component getInitialFocus(Traversable mainPanel)
public final Traversable getMainDialogPanel(DBEditorConfig config, Navigable[] navs)
@Deprecated public final Traversable getMainDialogPanel(T obj, DBObjectProvider pro, DBObject child, Navigable[] navs)
getMainDialogPanel(DBEditorConfig,Navigable[])
protected Traversable createMainPanel(Traversable header, Navigable[] navs, java.lang.String startPage)
protected boolean includePanelHeaders(DBEditorConfig editorConfig)
By default this returns true for flat editor and false for dialogs.
editorConfig
- the editor configpublic final java.util.List<Navigable> getNavigables(DBEditorConfig editorConfig)
editorConfig
- the launched editor config@Deprecated public final java.util.List<Navigable> getCreateNavigables(T obj, DBObjectProvider pro)
getNavigables(DBEditorConfig)
@Deprecated public final java.util.Map<java.lang.String,java.lang.Class> getCreateVerifiers()
public boolean canEditObject(T obj, DBObjectProvider pro)
To aid performance this method won't necessarily get passed the object itself, just a blank instance of the correct type.
@Deprecated public final java.util.List<Navigable> getEditNavigables(T obj, DBObjectProvider pro)
#getNavigables(T,DBObjectProvider,boolean)
@Deprecated public final java.util.Map<java.lang.String,java.lang.Class> getEditVerifiers()
public final java.util.List<Navigable> getSimpleNavigables()
public final T getObjectForCreate(Schema schema, DBObjectProvider pro, DBObject parent)
public final void makeNameUnique(DBObject dbo, Schema schema, DBObjectProvider pro, DBObject parent)
getObjectForCreate(oracle.javatools.db.Schema, oracle.javatools.db.DBObjectProvider, oracle.javatools.db.DBObject)
will be initialized by the provider's
DBObjectFactory and therefore have a default name. This method ensures
that the name is unique given any special requirements of the object
type that the DBObjectFactory is unaware of (e.g. open pl/sql editors).protected java.util.Set<java.lang.String> getNamesToExclude(DBObjectProvider pro, DBObject contextObject)
public void commitToProvider(DBEditorConfig config)
public boolean showEditorAfterCommit()
@Deprecated protected java.lang.String getUniqueName(java.lang.String type)
public java.lang.String getStartPage(DBEditorConfig config)
@Deprecated public java.lang.String getStartPage(DBObject child)
getStartPage(DBEditorConfig)
.protected T newDBObject(DBObjectProvider pro, Schema schema, DBObject parent)
pro
- The providerschema
- The owing schema if the new object is a SchemaObjectparent
- The parent of a ChildDBObject, or where applicable, the
context SystemObject (for example, the Table for an Index or Trigger)protected void setContextObject(SchemaObject newObject, SchemaObject contextObject)
newObject
- The newly created SchemaObjectcontextObject
- The context SchemaObject (for example the Table for a new
Index or Trigger)protected abstract java.util.List<java.lang.String> getTitles(T obj, DBObjectProvider pro, boolean editing)
@Deprecated protected void addSupportedTitle(SystemObject obj, DBObjectProvider pro, java.lang.String propPath, java.util.Collection<java.lang.String> titles, java.lang.String title)
@Deprecated protected void addSupportedTitle(SystemObject obj, DBObjectProvider pro, java.lang.String[] propPaths, java.util.Collection<java.lang.String> titles, java.lang.String title)
@Deprecated protected java.util.Map<java.lang.String,java.lang.Class> getVerifiers(boolean editing)
protected java.util.List<java.lang.String> getSimpleTitles()
Returns null by default (no simple edit).
protected java.util.Collection<java.lang.String> getPropsRequiredForNavigables()
protected final Navigable addPanel(java.lang.String title, java.lang.Class<? extends Traversable> clz, java.lang.String helpID, java.lang.String... properties)
title
- the title for the panelclz
- the traversable class for the panelhelpID
- the f1 help topic for the panelproperties
- the properties that this panel edits. These should be
relative to the SystemObject this library edits.protected final Navigable addPanel(java.lang.String title, java.lang.Class<? extends Traversable> clz, java.lang.String helpID, java.lang.Class[] constructorSig, java.lang.Object[] constructorArgs, java.lang.String... properties)
title
- the title for the panelclz
- the traversable class for the panelhelpID
- the f1 help topic for the panelconstructorSig
- the signature of the constructor to use on clzconstructorArgs
- the args for the constructor to on clzproperties
- the properties that this panel edits. These should be
relative to the SystemObject this library edits.protected final void addNavigable(java.lang.String title, Navigable n, java.lang.String... properties)
title
- the title for the panel.n
- the navigable with the panel information.properties
- the properties that this panel edits. These should be
relative to the SystemObject this library edits.protected java.util.Map<java.lang.String,Navigable> getNavigables()
public java.awt.Dimension getSize(boolean edit)
public java.lang.String getCreateText()
public java.lang.String getCreateTitle()
public java.lang.String getEditTitle()
public boolean canReplaceByDefault()
public boolean shouldResetObjectBeforeEdit(DBEditorConfig config)
The default implementation returns true if the underlying provider doesn't support timestamps for the given object type.
public boolean shouldValidateOnExit(oracle.ideimpl.db.panels.BaseEditorPanel panel, Namespace dataContext)
panel
- the panel that onExist has been called ondataContext
- the current data context