From cba26191af4f16562b8c341d788386aca4177023 Mon Sep 17 00:00:00 2001
From: Carlos Ortiz
Date: Thu, 5 Sep 2024 23:22:27 -0600
Subject: [PATCH] Add support for JKS file management and plugin UI updates
Introduced functionality for handling Java Keystore (JKS) files directly within the plugin, including a new file chooser and import alias dialog. Updated plugin.xml to reflect new version and release notes. Adjusted toolbar icons for better visual alignment.
---
.../com/jmpeax/ssltoolbox/jks/JKSView.java | 34 ++++++++++++-------
src/main/resources/META-INF/plugin.xml | 17 ++++++++++
2 files changed, 38 insertions(+), 13 deletions(-)
diff --git a/src/main/java/com/jmpeax/ssltoolbox/jks/JKSView.java b/src/main/java/com/jmpeax/ssltoolbox/jks/JKSView.java
index fb9addd..c400072 100644
--- a/src/main/java/com/jmpeax/ssltoolbox/jks/JKSView.java
+++ b/src/main/java/com/jmpeax/ssltoolbox/jks/JKSView.java
@@ -1,6 +1,9 @@
package com.jmpeax.ssltoolbox.jks;
import com.intellij.icons.AllIcons;
+import com.intellij.openapi.fileChooser.FileChooser;
+import com.intellij.openapi.fileChooser.FileChooserDescriptor;
+import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBList;
@@ -10,6 +13,7 @@
import com.jmpeax.ssltoolbox.svc.CertificateHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.slf4j.LoggerFactory;
import javax.swing.*;
import java.awt.*;
@@ -147,31 +151,35 @@ private JPanel createUnlockButton() {
private JPanel buildToolBar() {
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
- JButton openButton = new JButton(AllIcons.Actions.Menu_open);
+ JButton openButton = new JButton(AllIcons.ToolbarDecorator.Import);
openButton.setToolTipText("Open");
- openButton.setPreferredSize(new Dimension(AllIcons.Actions.Menu_open.getIconWidth() + 10, AllIcons.Actions.Menu_open.getIconHeight() + 10));
+ openButton.setPreferredSize(new Dimension(AllIcons.ToolbarDecorator.Import.getIconWidth() + 10, AllIcons.ToolbarDecorator.Import.getIconHeight() + 10));
openButton.addActionListener(e -> {
+ var descriptor = new FileChooserDescriptor(
+ true, // Choose Files
+ false,
+ false,
+ false,
+ false,
+ false
+ );
+ VirtualFile file = FileChooser.chooseFile(descriptor,null, null);
+ if (file != null) {
+ var str = Messages.showInputDialog("Enter Alias for" + file.getName(), "Alias for Imported Certificate", null);
+ LoggerFactory.getLogger(JKSView.class).info("Selected file: alias {} {}",str, file.getPath());
+ }
});
panel.add(openButton);
- JButton saveButton = new JButton(AllIcons.Actions.Menu_saveall);
- saveButton.setPreferredSize(new Dimension(AllIcons.Actions.Menu_saveall.getIconWidth() + 10, AllIcons.Actions.Menu_saveall.getIconHeight() + 10));
+ JButton saveButton = new JButton(AllIcons.ToolbarDecorator.Export);
+ saveButton.setPreferredSize(new Dimension(AllIcons.ToolbarDecorator.Export.getIconWidth() + 10, AllIcons.ToolbarDecorator.Export.getIconHeight() + 10));
saveButton.setToolTipText("Save");
saveButton.addActionListener(e -> {
});
panel.add(saveButton);
- JButton closeButton = new JButton(AllIcons.Actions.Cancel);
- closeButton.setPreferredSize(new Dimension(AllIcons.Actions.Cancel.getIconWidth() + 10, AllIcons.Actions.Cancel.getIconHeight() + 10));
-
- closeButton.setToolTipText("Close");
- closeButton.addActionListener(e -> {
- });
- panel.add(closeButton);
-
-
return panel;
}
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 6f5877c..d1b4c37 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -20,6 +20,23 @@
and manage SSL certificates
directly within the IntelliJ IDEA environment.
]]>
+ SSL Toolbox Plugin Update - Version 0.1.2-alpha
+ Release Date: September 10, 2024
+
+
+ ]]>