IDEA-119303 UI Designer: Create Form Snapshot failure

This commit is contained in:
Alexander Lobas
2014-01-14 15:17:01 +04:00
parent b8b48ebffb
commit dece38be3f
2 changed files with 9 additions and 3 deletions
@@ -120,7 +120,7 @@ public final class Palette implements Disposable, PersistentStateComponent<Eleme
/** Invoked by reflection */
public Palette(Project project) {
myProject = project;
myLafManagerListener = new MyLafManagerListener();
myLafManagerListener = project == null ? null : new MyLafManagerListener();
myClass2Properties = new HashMap<Class, IntrospectedProperty[]>();
myClassName2Item = new HashMap<String, ComponentItem>();
myGroups = new ArrayList<GroupItem>();
@@ -130,7 +130,9 @@ public final class Palette implements Disposable, PersistentStateComponent<Eleme
mySpecialGroup.addItem(ComponentItem.createAnyComponentItem(project));
}
LafManager.getInstance().addLafManagerListener(myLafManagerListener);
if (myLafManagerListener != null) {
LafManager.getInstance().addLafManagerListener(myLafManagerListener);
}
}
public Element getState() {
@@ -164,7 +166,9 @@ public final class Palette implements Disposable, PersistentStateComponent<Eleme
@Override
public void dispose() {
LafManager.getInstance().removeLafManagerListener(myLafManagerListener);
if (myLafManagerListener != null) {
LafManager.getInstance().removeLafManagerListener(myLafManagerListener);
}
}
public void readExternal(@NotNull final Element element) {
@@ -26,6 +26,7 @@ import com.intellij.execution.configurations.RuntimeConfigurationException;
import com.intellij.execution.process.ProcessAdapter;
import com.intellij.execution.process.ProcessEvent;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.ide.palette.PaletteGroup;
import com.intellij.ide.ui.LafManagerListener;
import com.intellij.openapi.actionSystem.DataProvider;
import com.intellij.openapi.application.PathManager;
@@ -78,6 +79,7 @@ public class SnapShooterConfigurationExtension extends RunConfigurationExtension
paths.add(PathUtil.getJarPathForClass(ProjectComponent.class)); // openapi
paths.add(PathUtil.getJarPathForClass(LwComponent.class)); // UIDesignerCore
paths.add(PathUtil.getJarPathForClass(GridConstraints.class)); // forms_rt
paths.add(PathUtil.getJarPathForClass(PaletteGroup.class)); // openapi
paths.add(PathUtil.getJarPathForClass(LafManagerListener.class)); // ui-impl
paths.add(PathUtil.getJarPathForClass(DataProvider.class)); // action-system-openapi
paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class)); // idea