updates for EULA loading

This commit is contained in:
Greg DiCristofaro 2023-07-24 11:18:01 -04:00
parent 947b52dbbd
commit 67dd48307b
4 changed files with 7 additions and 12 deletions

View File

@ -167,6 +167,7 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
this.licenseFetcher.cancel(true);
}
setLicenseDisplay(null, Bundle.CTOPtionsPanel_loadLicenseInfo_loading());
setMalwareScansDisplay(null, null);
this.licenseFetcher = new LicenseFetcher(licenseNumber);
this.licenseFetcher.execute();
}

View File

@ -36,14 +36,6 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="viewablePanel">
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[32767, 32767]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="null"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="3" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="5" insetsRight="5" anchor="10" weightX="1.0" weightY="1.0"/>

View File

@ -9,6 +9,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import javafx.application.Platform;
import javafx.concurrent.Worker.State;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
@ -52,12 +53,15 @@ public class EULADialog extends javax.swing.JDialog {
webView.setMaxSize(Short.MAX_VALUE, Short.MAX_VALUE);
webView.setPrefSize(Short.MAX_VALUE, Short.MAX_VALUE);
webView.setMinSize(100, 100);
webView.getEngine().getLoadWorker().stateProperty().addListener((ov, oldState, newState) -> {
if (newState == State.SUCCEEDED) {
SwingUtilities.invokeLater(() -> EULADialog.this.acceptButton.setEnabled(true));
}
});
webView.getEngine().loadContent(htmlString, "text/html");
VBox root = new VBox(webView);
Scene scene = new Scene(root, Color.RED);
fxPanel.setScene(scene);
SwingUtilities.invokeLater(() -> EULADialog.this.acceptButton.setEnabled(true));
});
}
@ -83,8 +87,6 @@ public class EULADialog extends javax.swing.JDialog {
setSize(new java.awt.Dimension(550, 550));
getContentPane().setLayout(new java.awt.GridBagLayout());
viewablePanel.setMaximumSize(new java.awt.Dimension(32767, 32767));
viewablePanel.setPreferredSize(null);
viewablePanel.setLayout(new java.awt.BorderLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;