19 package org.sleuthkit.autopsy.discovery.ui;
21 import javax.swing.JPanel;
22 import org.apache.commons.lang3.StringUtils;
23 import org.openide.util.NbBundle;
28 class LoadingPanel
extends JPanel {
30 private static final long serialVersionUID = 1L;
39 @NbBundle.Messages({
"LoadingPanel.loading.text=Loading, please wait.",
41 "LoadingPanel.retrieving.text=Retrieving results for {0}."})
43 LoadingPanel(String details) {
45 loadingLabel.setText(Bundle.LoadingPanel_loading_text());
46 if (!StringUtils.isBlank(details)) {
47 detailsLabel.setText(Bundle.LoadingPanel_retrieving_text(details));
56 @SuppressWarnings(
"unchecked")
58 private
void initComponents() {
60 loadingLabel =
new javax.swing.JLabel();
61 detailsLabel =
new javax.swing.JLabel();
63 loadingLabel.setFont(loadingLabel.getFont().deriveFont(loadingLabel.getFont().getSize()+4f));
64 loadingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
65 loadingLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
67 detailsLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
68 detailsLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
69 detailsLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
70 detailsLabel.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
72 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
73 this.setLayout(layout);
74 layout.setHorizontalGroup(
75 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
76 .addComponent(loadingLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
77 .addComponent(detailsLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE)
79 layout.setVerticalGroup(
80 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
81 .addGroup(layout.createSequentialGroup()
82 .addComponent(loadingLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
83 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
84 .addComponent(detailsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
85 .addContainerGap(30, Short.MAX_VALUE))
88 detailsLabel.getAccessibleContext().setAccessibleName(
org.openide.util.NbBundle.getMessage(LoadingPanel.class,
"LoadingPanel.detailsLabel.AccessibleContext.accessibleName"));
93 private javax.swing.JLabel detailsLabel;
94 private javax.swing.JLabel loadingLabel;