IDEA-150585 uiDesigner NewKeyDialog missing getDimensionServiceKey

This commit is contained in:
Alexander Lobas
2016-02-15 14:46:23 +03:00
parent 21e09f0114
commit cbbcdacf08
3 changed files with 52 additions and 44 deletions
@@ -281,7 +281,7 @@ public final class PropertyInspectorTable extends Table implements DataProvider{
return myEditor;
}
else if (PlatformDataKeys.FILE_EDITOR.is(dataId)) {
GuiEditor designer = DesignerToolWindowManager.getInstance(myProject).getActiveFormEditor();
GuiEditor designer = myProject.isDisposed() ? null : DesignerToolWindowManager.getInstance(myProject).getActiveFormEditor();
return designer == null ? null : designer.getEditor();
}
else if (PlatformDataKeys.HELP_ID.is(dataId)) {
@@ -1,54 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.uiDesigner.propertyInspector.editors.string.NewKeyDialog">
<grid id="1eff1" binding="myPanel" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<grid id="49180" binding="myPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<xy x="59" y="38" width="219" height="49"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0"/>
<xy x="59" y="38" width="232" height="65"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="9981" class="javax.swing.JLabel">
<constraints>
<xy x="2" y="5" width="55" height="14"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0"/>
</constraints>
<properties>
<labelFor value="89f45"/>
<text resource-bundle="messages/UIDesignerBundle" key="key.chooser.new.property.name"/>
</properties>
</component>
<component id="89f45" class="javax.swing.JTextField" binding="myKeyNameEdit">
<constraints>
<xy x="67" y="2" width="150" height="20"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<grid id="772be" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="North"/>
<properties/>
</component>
<component id="f12ed" class="javax.swing.JTextField" binding="myKeyValueEdit">
<constraints>
<xy x="67" y="27" width="150" height="20"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<columns value="50"/>
</properties>
</component>
<component id="23f8d" class="javax.swing.JLabel">
<constraints>
<xy x="2" y="30" width="55" height="14"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0"/>
</constraints>
<properties>
<labelFor value="f12ed"/>
<text resource-bundle="messages/UIDesignerBundle" key="key.chooser.new.property.value"/>
</properties>
</component>
<border type="none"/>
<children>
<component id="ab054" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="89f45"/>
<text resource-bundle="messages/UIDesignerBundle" key="key.chooser.new.property.name"/>
</properties>
</component>
<component id="5ff32" class="javax.swing.JTextField" binding="myKeyNameEdit">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="19be8" class="javax.swing.JTextField" binding="myKeyValueEdit">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<columns value="50"/>
</properties>
</component>
<component id="49d01" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="f12ed"/>
<text resource-bundle="messages/UIDesignerBundle" key="key.chooser.new.property.value"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>
@@ -17,6 +17,7 @@ package com.intellij.uiDesigner.propertyInspector.editors.string;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.uiDesigner.UIDesignerBundle;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.event.DocumentListener;
@@ -63,6 +64,11 @@ public class NewKeyDialog extends DialogWrapper {
return myPanel;
}
@NotNull
protected String getDimensionServiceKey() {
return getClass().getName();
}
public String getName() {
return myKeyNameEdit.getText();
}