new Flex project configuration: modifiable model

This commit is contained in:
Kirill.Safonov
2011-09-23 18:34:46 +04:00
parent 38c689be3b
commit 3fec8b1c2d
2 changed files with 7 additions and 6 deletions
@@ -362,7 +362,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
try {
final Object result = method.invoke(myDelegateTable, unwrapParams(params));
if (result instanceof Library) {
return Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Library.class},
return Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{result instanceof LibraryEx ? LibraryEx.class : Library.class},
new LibraryInvocationHandler((Library)result));
}
else if (result instanceof LibraryTable.ModifiableModel) {
@@ -374,7 +374,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
for (int idx = 0; idx < libraries.length; idx++) {
Library library = libraries[idx];
libraries[idx] =
(Library)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Library.class},
(Library)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{library instanceof LibraryEx ? LibraryEx.class : Library.class},
new LibraryInvocationHandler(library));
}
}
@@ -345,15 +345,16 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
roots.add(myRoot);
checkApply(roots, ProjectBundle.message("rename.message.prefix.module"), ProjectBundle.message("rename.module.title"));
if (myContext.myModulesConfigurator.isModified()) {
myContext.myModulesConfigurator.apply();
}
// let's apply extensions first, since they can write to/commit modifiable models
for (final ModuleStructureExtension extension : ModuleStructureExtension.EP_NAME.getExtensions()) {
if (extension.isModified()) {
extension.apply();
}
}
if (myContext.myModulesConfigurator.isModified()) {
myContext.myModulesConfigurator.apply();
}
}
public boolean isModified() {