Skip to content

Commit

Permalink
Add support for JKS file management and plugin UI updates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cortiz committed Sep 6, 2024
1 parent 41262d1 commit cba2619
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/main/java/com/jmpeax/ssltoolbox/jks/JKSView.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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.*;
Expand Down Expand Up @@ -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;
}

Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@
and manage SSL certificates
directly within the IntelliJ IDEA environment.</p>
]]></description>
<change-notes><![CDATA[
<h1>SSL Toolbox Plugin Update - Version 0.1.2-alpha</h1>
<p><strong>Release Date:</strong> September 10, 2024</p>
<div class="section">
<h2>New Features</h2>
<ul>
<li>
<h3>Support for JKS Files</h3>
<p>Added support for Java Keystore (JKS) files,This allows users to manage JKS files directly from the plugin.</p>
</li>
<li>
<h3>Support Additional Certificate File Types</h3>
</li>
</ul>
</div>
<hr/>
]]></change-notes>

<!-- Product and plugin compatibility requirements.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
Expand Down

0 comments on commit cba2619

Please sign in to comment.