|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Migrator interface is used for migrating user customizable settings from previous installations of JDeveloper to the user home of a new installation. Migration may take place during one or both of two migration "phases". The first phase of migration occurs at startup before the IDE has been completely initialized and is signalled by a direct call to the migrate method of the Migrator. First phase migration should deal with the raw migration of files and should avoid trying to access any state information of the IDE itself. Second phase migration may be performed upon notification that all addins have been loaded indicating that the IDE is in a valid initialized state. Second phase migration usually involves tweaking a file that has already been migrated by an associated first phase Migrator implementation. For example; an extension that persists its settings in the settings.xml file may require a second phase Migrator to tweak the resultant file that was migrated by the associated first phase Migrator oracle.ide.config.IdeSettingsMigrator. In this example, the second phase Migrator would not attempt to migrate the settings.xml file itself, but rather would simply add itself as an oracle.ide.IdeListener of the IDE and wait for the addinsLoaded event in order to make the necessary changes to the live object returned by oracle.ide.Ide.getSettings(). This would ensure that the live object reflected the new values which in turn would be persisted by the live object at the next opportunity, thereby resulting in a fully migrated settings.xml on disk. Note that when using this approach, before tweaking any objects, the second phase Migrator would be expected to verify that the first phase Migrator actually allowed first phase migration by checking the isSelected method for the category of interest on the first phase Migrator. No more than a single first phase Migrator implementation should ever attempt to migrate a given file. Any number of second phase Migrator implementations may attempt to alter the live object resulting from the loading of the file migrated by the first phase Migrator.
Field Summary | |
static java.lang.String |
JDEV_HOME_DIR
Legacy directory, under |
static java.lang.String |
SYSTEM_DIR
Legacy directory, under |
Method Summary | |
boolean |
canMigrate(int category,
java.io.File sourceDir)
Determine whether a given category can be migrated from a given directory. |
java.lang.String |
getDescription(int category)
Get a one line description for a given migration category. |
int[] |
getMigrationCategories()
Get an array of unique id values representing available categories to migrate. |
boolean |
isSelected(int category)
Determine whether a category has been flagged for migration. |
java.lang.String[] |
migrate(java.io.File sourceDir,
java.io.File destDir)
Migrate all flagged categories, from a given source directory, to a given destination directory. |
void |
setSelected(int category,
boolean selected)
Flag a category as selected for migration. |
Field Detail |
public static final java.lang.String SYSTEM_DIR
public static final java.lang.String JDEV_HOME_DIR
Method Detail |
public int[] getMigrationCategories()
public java.lang.String getDescription(int category)
public boolean canMigrate(int category, java.io.File sourceDir)
public void setSelected(int category, boolean selected)
public boolean isSelected(int category)
public java.lang.String[] migrate(java.io.File sourceDir, java.io.File destDir)
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.