From 7fdcb6e664a449d3006644a87aa35dbc7e3c5ab7 Mon Sep 17 00:00:00 2001 From: Albert Beade Date: Sat, 14 Mar 2020 23:02:15 +0100 Subject: [PATCH] Fix runtime issues by avoid using UI DSL (#2) --- .idea/misc.xml | 2 +- resources/META-INF/plugin.xml | 6 +- .../figma/ImportConfirmationDialogWrapper.kt | 20 +- .../plugin/figma/ImportDialogWrapper.kt | 196 +++++------- src/com/abeade/plugin/figma/ImportSettings.kt | 10 +- .../plugin/figma/ImportSettingsPanel.kt | 47 --- .../figma/ImportSettingsPanelWrapper.kt | 35 +++ .../figma/ui/ImportConfirmationDialog.form | 33 +++ .../figma/ui/ImportConfirmationDialog.java | 10 + .../abeade/plugin/figma/ui/ImportDialog.form | 278 ++++++++++++++++++ .../abeade/plugin/figma/ui/ImportDialog.java | 33 +++ .../plugin/figma/ui/ImportSettingsPanel.form | 43 +++ .../plugin/figma/ui/ImportSettingsPanel.java | 9 + 13 files changed, 530 insertions(+), 192 deletions(-) delete mode 100644 src/com/abeade/plugin/figma/ImportSettingsPanel.kt create mode 100644 src/com/abeade/plugin/figma/ImportSettingsPanelWrapper.kt create mode 100644 src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.form create mode 100644 src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.java create mode 100644 src/com/abeade/plugin/figma/ui/ImportDialog.form create mode 100644 src/com/abeade/plugin/figma/ui/ImportDialog.java create mode 100644 src/com/abeade/plugin/figma/ui/ImportSettingsPanel.form create mode 100644 src/com/abeade/plugin/figma/ui/ImportSettingsPanel.java diff --git a/.idea/misc.xml b/.idea/misc.xml index 5326776..c27fbdc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index 7392d12..ddbbd4a 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ com.abeade.plugin.figma.import Import figma resources - 1.0.6 + 1.0.7 Albert Beade 1.0.7 +
    +
  • Fix runtime issues by avoid using UI DSL
  • +
1.0.6
  • Fix issue when accessing plugin settings
  • diff --git a/src/com/abeade/plugin/figma/ImportConfirmationDialogWrapper.kt b/src/com/abeade/plugin/figma/ImportConfirmationDialogWrapper.kt index bcac236..ae4ee4a 100644 --- a/src/com/abeade/plugin/figma/ImportConfirmationDialogWrapper.kt +++ b/src/com/abeade/plugin/figma/ImportConfirmationDialogWrapper.kt @@ -1,7 +1,7 @@ package com.abeade.plugin.figma +import com.abeade.plugin.figma.ui.ImportConfirmationDialog import com.intellij.openapi.ui.DialogWrapper -import com.intellij.ui.layout.panel import javax.swing.JComponent class ImportConfirmationDialogWrapper(private val resource: String, private val affectedDensities: MutableList) : @@ -12,15 +12,17 @@ class ImportConfirmationDialogWrapper(private val resource: String, private val title = "Import figma resources" } - override fun createCenterPanel(): JComponent? = - panel { + override fun createCenterPanel(): JComponent? { + return ImportConfirmationDialog().apply { if (affectedDensities.size > 1) { - val densities = StringBuilder() - affectedDensities.forEach { densities.appendln(it) } - noteRow("Resource $resource already exists in the following densities:\n\n$densities\nDo you want to overwrite them?") + itemsLabel.text = affectedDensities.joinToString(prefix = "
    ", separator = "
    ", postfix = "

    ") + titleLabel.text = "Resource $resource already exists in the following densities:" + questionLabel.text = "Do you want to overwrite them?" } else { - noteRow("Resource $resource already exists in density ${affectedDensities[0]}\n\nDo you want to overwrite it?") + titleLabel.text = "Resource $resource already exists in density ${affectedDensities[0]}" + itemsLabel.text = " " + questionLabel.text = "Do you want to overwrite it?" } - row { } - } + }.mainPanel + } } diff --git a/src/com/abeade/plugin/figma/ImportDialogWrapper.kt b/src/com/abeade/plugin/figma/ImportDialogWrapper.kt index d350e51..0680f25 100644 --- a/src/com/abeade/plugin/figma/ImportDialogWrapper.kt +++ b/src/com/abeade/plugin/figma/ImportDialogWrapper.kt @@ -1,13 +1,16 @@ package com.abeade.plugin.figma +import com.abeade.plugin.figma.ui.ImportDialog import com.intellij.icons.AllIcons import com.intellij.ide.util.PropertiesComponent import com.intellij.openapi.ui.DialogWrapper import com.intellij.openapi.ui.ValidationInfo -import com.intellij.ui.layout.panel +import com.intellij.ui.IdeBorderFactory +import java.awt.Desktop import java.awt.event.MouseAdapter import java.awt.event.MouseEvent import java.io.File +import java.net.URI import java.util.zip.ZipFile import javax.swing.* import javax.swing.event.DocumentEvent @@ -46,35 +49,14 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) val importData: ImportData? get() = data + private lateinit var dialog: ImportDialog + private var data: ImportData? = null private var result = mutableMapOf() private var file: File? = null private var zipFilesList: MutableList? = null private var resource: String? = null - private lateinit var fileField: JTextField - private lateinit var resourceField: JTextField - private lateinit var ldpiField: JTextField - private lateinit var mdpiField: JTextField - private lateinit var hdpiField: JTextField - private lateinit var xhdpiField: JTextField - private lateinit var xxhdpiField: JTextField - private lateinit var xxxhdpiField: JTextField - private lateinit var rememberCheckBox: JCheckBox - private lateinit var overrideCheckBox: JCheckBox - private lateinit var ldpiLabel: JLabel - private lateinit var mdpiLabel: JLabel - private lateinit var hdpiLabel: JLabel - private lateinit var xhdpiLabel: JLabel - private lateinit var xxhdpiLabel: JLabel - private lateinit var xxxhdpiLabel: JLabel - private lateinit var ldpiIconLabel: JLabel - private lateinit var mdpiIconLabel: JLabel - private lateinit var hdpiIconLabel: JLabel - private lateinit var xhdpiIconLabel: JLabel - private lateinit var xxhdpiIconLabel: JLabel - private lateinit var xxxhdpiIconLabel: JLabel - override fun getDimensionServiceKey(): String? = DIMENSION_SERVICE_KEY override fun createCenterPanel(): JComponent { @@ -88,96 +70,52 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) val override = propertiesComponent.getBoolean(OVERRIDE_KEY, true) val directory = propertiesComponent.getValue(DIRECTORY_KEY) val prefix = propertiesComponent.getValue(ImportDialogWrapper.PREFIX_KEY) ?: RESOURCE_PREFIX - rememberCheckBox = JCheckBox().apply { isSelected = saveDensities } - overrideCheckBox = JCheckBox("Show confirmation dialog if any resource already exists (otherwise resources will be overwritten)").apply { isSelected = override } - fileField = JTextField(String.EMPTY).apply { - addMouseListener(object : MouseAdapter() { + + dialog = ImportDialog().apply { + selectFileButton.addActionListener { openFile(directory) } + rememberCheckBox.isSelected = saveDensities + overrideCheckBox.isSelected = override + resourceField.text = prefix + fileField.addMouseListener(object : MouseAdapter() { override fun mouseClicked(e: MouseEvent?) { openFile(directory) } }) - isEditable = false - + ldpiField.text = ldpi + mdpiField.text = mdpi + hdpiField.text = hdpi + xhdpiField.text = xhdpi + xxhdpiField.text = xxhdpi + xxxhdpiField.text = xxxhdpi + ldpiField.document.addDocumentListener(this@ImportDialogWrapper) + mdpiField.document.addDocumentListener(this@ImportDialogWrapper) + hdpiField.document.addDocumentListener(this@ImportDialogWrapper) + xhdpiField.document.addDocumentListener(this@ImportDialogWrapper) + xxhdpiField.document.addDocumentListener(this@ImportDialogWrapper) + xxxhdpiField.document.addDocumentListener(this@ImportDialogWrapper) + filePanel.border = IdeBorderFactory.createTitledBorder("Select zip file with figma exported resources (JPG or PNG)") + resourcesPanel.border = IdeBorderFactory.createTitledBorder("Select the suffixes used for each density (empty densities will be skipped)") + moreInfoLabel.addMouseListener(object : MouseAdapter() { + override fun mouseClicked(e: MouseEvent?) { + Desktop.getDesktop().browse(URI("https://github.com/abeade/figma-import-plugin")) + } + }) } - resourceField = JTextField(prefix) - ldpiField = JTextField(ldpi).apply { document.addDocumentListener(this@ImportDialogWrapper) } - mdpiField = JTextField(mdpi).apply { document.addDocumentListener(this@ImportDialogWrapper) } - hdpiField = JTextField(hdpi).apply { document.addDocumentListener(this@ImportDialogWrapper) } - xhdpiField = JTextField(xhdpi).apply { document.addDocumentListener(this@ImportDialogWrapper) } - xxhdpiField = JTextField(xxhdpi).apply { document.addDocumentListener(this@ImportDialogWrapper) } - xxxhdpiField = JTextField(xxxhdpi).apply { document.addDocumentListener(this@ImportDialogWrapper) } - ldpiLabel = JLabel("ldpi suffix:") - mdpiLabel = JLabel("mdpi suffix:") - hdpiLabel = JLabel("hdpi suffix:") - xhdpiLabel = JLabel("xhdpi suffix:") - xxhdpiLabel = JLabel("xxhdpi suffix:") - xxxhdpiLabel = JLabel("xxxhdpi suffix:") - ldpiIconLabel = JLabel() - mdpiIconLabel = JLabel() - hdpiIconLabel = JLabel() - xhdpiIconLabel = JLabel() - xxhdpiIconLabel = JLabel() - xxxhdpiIconLabel = JLabel() - updateLabels() - - return panel { - noteRow("Select zip file with figma exported resources (JPG or PNG)") - row("File:") { - fileField(pushX) - button("Select file") { openFile(directory) } - } - row("Resource name:") { resourceField() } - row(String.EMPTY) { overrideCheckBox()} - row { } - noteRow("Select the suffixes used for each density (empty densities will be skipped)") - row { - ldpiLabel() - ldpiField(pushX, growX) - ldpiIconLabel() - } - row { - mdpiLabel() - mdpiField(pushX) - mdpiIconLabel() - } - row { - hdpiLabel() - hdpiField(pushX) - hdpiIconLabel() - } - row { - xhdpiLabel() - xhdpiField(pushX) - xhdpiIconLabel() - } - row { - xxhdpiLabel() - xxhdpiField(pushX) - xxhdpiIconLabel() - } - row { - xxxhdpiLabel() - xxxhdpiField(pushX) - xxxhdpiIconLabel() - } - row("Remember suffixes") { rememberCheckBox() } - row { } - noteRow("""More info in GitHub repository""") - } + return dialog.mainPanel } override fun doOKAction() { - data = ImportData(file, resourceField.text, result, overrideCheckBox.isSelected) - val remember = rememberCheckBox.isSelected - propertiesComponent.setValue(LDPI_KEY, if (remember) ldpiField.text else null) - propertiesComponent.setValue(MDPI_KEY, if (remember) mdpiField.text else null) - propertiesComponent.setValue(HDPI_KEY, if (remember) hdpiField.text else null) - propertiesComponent.setValue(XHDPI_KEY, if (remember) xhdpiField.text else null) - propertiesComponent.setValue(XXHDPI_KEY, if (remember) xxhdpiField.text else null) - propertiesComponent.setValue(XXXHDPI_KEY, if (remember) xxxhdpiField.text else null) + data = ImportData(file, dialog.resourceField.text, result, dialog.overrideCheckBox.isSelected) + val remember = dialog.rememberCheckBox.isSelected + propertiesComponent.setValue(LDPI_KEY, if (remember) dialog.ldpiField.text else null) + propertiesComponent.setValue(MDPI_KEY, if (remember) dialog.mdpiField.text else null) + propertiesComponent.setValue(HDPI_KEY, if (remember) dialog.hdpiField.text else null) + propertiesComponent.setValue(XHDPI_KEY, if (remember) dialog.xhdpiField.text else null) + propertiesComponent.setValue(XXHDPI_KEY, if (remember) dialog.xxhdpiField.text else null) + propertiesComponent.setValue(XXXHDPI_KEY, if (remember) dialog.xxxhdpiField.text else null) propertiesComponent.setValue(SAVE_KEY, remember) - propertiesComponent.setValue(OVERRIDE_KEY, overrideCheckBox.isSelected) + propertiesComponent.setValue(OVERRIDE_KEY, dialog.overrideCheckBox.isSelected) propertiesComponent.setValue(DIRECTORY_KEY, file?.parent) super.doOKAction() } @@ -185,11 +123,11 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) override fun doValidate(): ValidationInfo? { processResult() return when { - fileField.text.isEmpty() -> ValidationInfo("Zip file required", fileField) - resourceField.text.isBlank() -> ValidationInfo("Resource name required", resourceField) - resourceField.text.contains('.') -> ValidationInfo("Resource name should not contain extension", resourceField) - ldpiField.text.isBlank() && mdpiField.text.isBlank() && hdpiField.text.isBlank() - && xhdpiField.text.isBlank() && xxhdpiField.text.isBlank() && xxxhdpiField.text.isBlank() -> + dialog.fileField.text.isEmpty() -> ValidationInfo("Zip file required", dialog.fileField) + dialog.resourceField.text.isBlank() -> ValidationInfo("Resource name required", dialog.resourceField) + dialog.resourceField.text.contains('.') -> ValidationInfo("Resource name should not contain extension", dialog.resourceField) + dialog.ldpiField.text.isBlank() && dialog.mdpiField.text.isBlank() && dialog.hdpiField.text.isBlank() + && dialog.xhdpiField.text.isBlank() && dialog.xxhdpiField.text.isBlank() && dialog.xxxhdpiField.text.isBlank() -> ValidationInfo("At least one density prefix should be defined") result.isEmpty() -> ValidationInfo("No resource matches found! Review the prefixes and ensure you're using PNG or JPG") else -> null @@ -211,12 +149,12 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) private fun processResult() { result.clear() zipFilesList?.forEach { - addFieldToResult(it, ldpiField.text, FOLDER_LDPI) - addFieldToResult(it, mdpiField.text, FOLDER_MDPI) - addFieldToResult(it, hdpiField.text, FOLDER_HDPI) - addFieldToResult(it, xhdpiField.text, FOLDER_XHDPI) - addFieldToResult(it, xxhdpiField.text, FOLDER_XXHDPI) - addFieldToResult(it, xxxhdpiField.text, FOLDER_XXXHDPI) + addFieldToResult(it, dialog.ldpiField.text, FOLDER_LDPI) + addFieldToResult(it, dialog.mdpiField.text, FOLDER_MDPI) + addFieldToResult(it, dialog.hdpiField.text, FOLDER_HDPI) + addFieldToResult(it, dialog.xhdpiField.text, FOLDER_XHDPI) + addFieldToResult(it, dialog.xxhdpiField.text, FOLDER_XXHDPI) + addFieldToResult(it, dialog.xxxhdpiField.text, FOLDER_XXXHDPI) } } @@ -227,19 +165,19 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) } private fun updateLabels() { - updateLabelField(ldpiLabel, ldpiField) - updateLabelField(mdpiLabel, mdpiField) - updateLabelField(hdpiLabel, hdpiField) - updateLabelField(xhdpiLabel, xhdpiField) - updateLabelField(xxhdpiLabel, xxhdpiField) - updateLabelField(xxxhdpiLabel, xxxhdpiField) + updateLabelField(dialog.ldpiLabel, dialog.ldpiField) + updateLabelField(dialog.mdpiLabel, dialog.mdpiField) + updateLabelField(dialog.hdpiLabel, dialog.hdpiField) + updateLabelField(dialog.xhdpiLabel, dialog.xhdpiField) + updateLabelField(dialog.xxhdpiLabel, dialog.xxhdpiField) + updateLabelField(dialog.xxxhdpiLabel, dialog.xxxhdpiField) zipFilesList?.let { - updateIconField(ldpiIconLabel, ldpiField, it) - updateIconField(mdpiIconLabel, mdpiField, it) - updateIconField(hdpiIconLabel, hdpiField, it) - updateIconField(xhdpiIconLabel, xhdpiField, it) - updateIconField(xxhdpiIconLabel, xxhdpiField, it) - updateIconField(xxxhdpiIconLabel, xxxhdpiField, it) + updateIconField(dialog.ldpiIconLabel, dialog.ldpiField, it) + updateIconField(dialog.mdpiIconLabel, dialog.mdpiField, it) + updateIconField(dialog.hdpiIconLabel, dialog.hdpiField, it) + updateIconField(dialog.xhdpiIconLabel, dialog.xhdpiField, it) + updateIconField(dialog.xxhdpiIconLabel, dialog.xxhdpiField, it) + updateIconField(dialog.xxxhdpiIconLabel, dialog.xxxhdpiField, it) } } @@ -274,7 +212,7 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) val result = fileDialog.showOpenDialog(contentPane) if (result == JFileChooser.APPROVE_OPTION) { file = fileDialog.selectedFile - fileField.text = file.toString() + dialog.fileField.text = file.toString() val zipFile = ZipFile(file) zipFilesList = zipFile.entries().asSequence() .filter { !it.isDirectory && (it.name.endsWith(".png", true) || it.name.endsWith(".jpg", true)) } @@ -290,7 +228,7 @@ class ImportDialogWrapper(private val propertiesComponent: PropertiesComponent) if (resource?.startsWith(prefix) == false) { resource = prefix + resource } - resourceField.text = resource + dialog.resourceField.text = resource } updateLabels() } diff --git a/src/com/abeade/plugin/figma/ImportSettings.kt b/src/com/abeade/plugin/figma/ImportSettings.kt index b14c9e9..d204db0 100644 --- a/src/com/abeade/plugin/figma/ImportSettings.kt +++ b/src/com/abeade/plugin/figma/ImportSettings.kt @@ -6,7 +6,7 @@ import javax.swing.JComponent class ImportSettings : SearchableConfigurable { - private val panel = ImportSettingsPanel(PropertiesComponent.getInstance()) + private val settingsWrapper = ImportSettingsPanelWrapper(PropertiesComponent.getInstance()) override fun getDisplayName(): String? = "Figma import" @@ -14,15 +14,15 @@ class ImportSettings : SearchableConfigurable { override fun getId(): String = "Figma import" - override fun createComponent(): JComponent? = panel + override fun createComponent(): JComponent? = settingsWrapper.createPanel() - override fun isModified(): Boolean = panel.isModified + override fun isModified(): Boolean = settingsWrapper.isModified override fun apply() { - panel.apply() + settingsWrapper.apply() } override fun reset() { - panel.reset() + settingsWrapper.reset() } } \ No newline at end of file diff --git a/src/com/abeade/plugin/figma/ImportSettingsPanel.kt b/src/com/abeade/plugin/figma/ImportSettingsPanel.kt deleted file mode 100644 index bfa563e..0000000 --- a/src/com/abeade/plugin/figma/ImportSettingsPanel.kt +++ /dev/null @@ -1,47 +0,0 @@ -package com.abeade.plugin.figma - -import com.intellij.ide.util.PropertiesComponent -import com.intellij.openapi.ui.panel.ComponentPanelBuilder -import com.intellij.ui.layout.LCFlags -import com.intellij.ui.layout.panel -import javax.swing.BoxLayout -import javax.swing.JPanel -import javax.swing.JTextField - -class ImportSettingsPanel(private val propertiesComponent: PropertiesComponent) : JPanel() { - - private val prefixField: JTextField = JTextField() - - init { - createPanel() - layout = BoxLayout(this, BoxLayout.Y_AXIS) - } - - private fun createPanel() { - add( - panel(LCFlags.fillX) { - row("Resource prefix") { prefixField() } - row("") { ComponentPanelBuilder.createCommentComponent("Prefix used in purposed resource name. When empty no prefix will be added.", false)() } - } - ) - } - - val isModified: Boolean - get() = prefixField.text != getCurrentPrefix() - - fun apply() { - propertiesComponent.setValue(ImportDialogWrapper.PREFIX_KEY, prefixField.text) - } - - fun reset() { - prefixField.text = getCurrentPrefix() - } - - private fun getCurrentPrefix(): String { - var prefix = propertiesComponent.getValue(ImportDialogWrapper.PREFIX_KEY) - if (prefix == null) { - prefix = ImportDialogWrapper.RESOURCE_PREFIX - } - return prefix - } -} \ No newline at end of file diff --git a/src/com/abeade/plugin/figma/ImportSettingsPanelWrapper.kt b/src/com/abeade/plugin/figma/ImportSettingsPanelWrapper.kt new file mode 100644 index 0000000..05c3257 --- /dev/null +++ b/src/com/abeade/plugin/figma/ImportSettingsPanelWrapper.kt @@ -0,0 +1,35 @@ +package com.abeade.plugin.figma + +import com.abeade.plugin.figma.ui.ImportSettingsPanel +import com.intellij.ide.util.PropertiesComponent +import com.intellij.openapi.ui.panel.ComponentPanelBuilder +import java.awt.BorderLayout +import javax.swing.JPanel + +class ImportSettingsPanelWrapper(private val propertiesComponent: PropertiesComponent) { + + private val settingsPanel = ImportSettingsPanel() + + init { + settingsPanel.resourcePrefixHelpPanel.layout = BorderLayout() + settingsPanel.resourcePrefixHelpPanel.add( + ComponentPanelBuilder.createCommentComponent("Prefix used in purposed resource name. When empty no prefix will be added.", false) + ) + } + + val isModified: Boolean + get() = settingsPanel.resourcePrefixTextField.text != getCurrentPrefix() + + fun apply() { + propertiesComponent.setValue(ImportDialogWrapper.PREFIX_KEY, settingsPanel.resourcePrefixTextField.text) + } + + fun reset() { + settingsPanel.resourcePrefixTextField.text = getCurrentPrefix() + } + + fun createPanel(): JPanel = settingsPanel.mainPanel + + private fun getCurrentPrefix(): String = + propertiesComponent.getValue(ImportDialogWrapper.PREFIX_KEY) ?: ImportDialogWrapper.RESOURCE_PREFIX +} \ No newline at end of file diff --git a/src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.form b/src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.form new file mode 100644 index 0000000..69d7cad --- /dev/null +++ b/src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.form @@ -0,0 +1,33 @@ + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.java b/src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.java new file mode 100644 index 0000000..760a4c9 --- /dev/null +++ b/src/com/abeade/plugin/figma/ui/ImportConfirmationDialog.java @@ -0,0 +1,10 @@ +package com.abeade.plugin.figma.ui; + +import javax.swing.*; + +public class ImportConfirmationDialog { + public JPanel mainPanel; + public JLabel titleLabel; + public JLabel itemsLabel; + public JLabel questionLabel; +} diff --git a/src/com/abeade/plugin/figma/ui/ImportDialog.form b/src/com/abeade/plugin/figma/ui/ImportDialog.form new file mode 100644 index 0000000..441be41 --- /dev/null +++ b/src/com/abeade/plugin/figma/ui/ImportDialog.form @@ -0,0 +1,278 @@ + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/src/com/abeade/plugin/figma/ui/ImportDialog.java b/src/com/abeade/plugin/figma/ui/ImportDialog.java new file mode 100644 index 0000000..e5d53e2 --- /dev/null +++ b/src/com/abeade/plugin/figma/ui/ImportDialog.java @@ -0,0 +1,33 @@ +package com.abeade.plugin.figma.ui; + +import javax.swing.*; + +public class ImportDialog { + public JPanel mainPanel; + public JPanel filePanel; + public JPanel resourcesPanel; + public JTextField fileField; + public JButton selectFileButton; + public JTextField resourceField; + public JCheckBox overrideCheckBox; + public JTextField ldpiField; + public JCheckBox rememberCheckBox; + public JTextField mdpiField; + public JTextField hdpiField; + public JTextField xhdpiField; + public JTextField xxhdpiField; + public JTextField xxxhdpiField; + public JLabel ldpiIconLabel; + public JLabel mdpiIconLabel; + public JLabel hdpiIconLabel; + public JLabel xhdpiIconLabel; + public JLabel xxhdpiIconLabel; + public JLabel xxxhdpiIconLabel; + public JLabel ldpiLabel; + public JLabel mdpiLabel; + public JLabel hdpiLabel; + public JLabel xhdpiLabel; + public JLabel xxhdpiLabel; + public JLabel xxxhdpiLabel; + public JLabel moreInfoLabel; +} diff --git a/src/com/abeade/plugin/figma/ui/ImportSettingsPanel.form b/src/com/abeade/plugin/figma/ui/ImportSettingsPanel.form new file mode 100644 index 0000000..20d4838 --- /dev/null +++ b/src/com/abeade/plugin/figma/ui/ImportSettingsPanel.form @@ -0,0 +1,43 @@ + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/src/com/abeade/plugin/figma/ui/ImportSettingsPanel.java b/src/com/abeade/plugin/figma/ui/ImportSettingsPanel.java new file mode 100644 index 0000000..9490d0d --- /dev/null +++ b/src/com/abeade/plugin/figma/ui/ImportSettingsPanel.java @@ -0,0 +1,9 @@ +package com.abeade.plugin.figma.ui; + +import javax.swing.*; + +public class ImportSettingsPanel { + public JPanel mainPanel; + public JTextField resourcePrefixTextField; + public JPanel resourcePrefixHelpPanel; +}