/hg/icedtea-web: Fixed ControlPanel UI for lower resolutions.
jkang at icedtea.classpath.org
jkang at icedtea.classpath.org
Mon Jul 28 14:50:26 UTC 2014
changeset fcfceec90e2d in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=fcfceec90e2d
author: Jie Kang <jkang at redhat.com>
date: Mon Jul 28 10:50:03 2014 -0400
Fixed ControlPanel UI for lower resolutions.
2014-07-28 Jie Kang <jkang at redhat.com>
Fix to Control Panel UI for lower resolutions. Addresses bug
PR1856 where part of the dialog is hidden and unaccessible
on lower resolutions such as 800 x 600.
* netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
* netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java
diffstat:
ChangeLog | 8 +
netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java | 3 +-
netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java | 193 +++++----
3 files changed, 119 insertions(+), 85 deletions(-)
diffs (349 lines):
diff -r 65fef87606cd -r fcfceec90e2d ChangeLog
--- a/ChangeLog Tue Jul 22 11:20:03 2014 -0400
+++ b/ChangeLog Mon Jul 28 10:50:03 2014 -0400
@@ -1,3 +1,11 @@
+2014-07-28 Jie Kang <jkang at redhat.com>
+
+ Fix to Control Panel UI for lower resolutions. Addresses bug
+ PR1856 where part of the dialog is hidden and unaccessible
+ on lower resolutions such as 800 x 600.
+ * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
+ * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java
+
2014-07-22 Fridrich Strba <fridrich.strba at suse.com>
* plugin/icedteanp/IcedTeaPluginUtils.cc (flush_pre_init_messages):
diff -r 65fef87606cd -r fcfceec90e2d netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Tue Jul 22 11:20:03 2014 -0400
+++ b/netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java Mon Jul 28 10:50:03 2014 -0400
@@ -120,7 +120,6 @@
add(buttonPanel, BorderLayout.PAGE_END);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
pack();
- setMinimumSize(getPreferredSize());
}
private JPanel createTopPanel() {
@@ -304,7 +303,7 @@
}
});
JScrollPane settingsListScrollPane = new JScrollPane(settingsList);
- settingsListScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+ settingsListScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
final JPanel settingsDetailPanel = new JPanel();
settingsDetailPanel.setLayout(new BorderLayout());
diff -r 65fef87606cd -r fcfceec90e2d netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java
--- a/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java Tue Jul 22 11:20:03 2014 -0400
+++ b/netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java Mon Jul 28 10:50:03 2014 -0400
@@ -53,15 +53,25 @@
import java.util.regex.Pattern;
import javax.swing.DefaultCellEditor;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.GroupLayout;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
+import javax.swing.LayoutStyle;
+import javax.swing.ListCellRenderer;
import javax.swing.RowFilter;
-import javax.swing.RowFilter.Entry;
import javax.swing.RowSorter.SortKey;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -83,31 +93,31 @@
import net.sourceforge.jnlp.security.appletextendedsecurity.UnsignedAppletActionEntry;
import net.sourceforge.jnlp.security.appletextendedsecurity.UrlRegEx;
import net.sourceforge.jnlp.security.appletextendedsecurity.impl.UnsignedAppletActionStorageExtendedImpl;
+import net.sourceforge.jnlp.util.ScreenFinder;
import net.sourceforge.jnlp.util.logging.OutputController;
-import net.sourceforge.jnlp.util.ScreenFinder;
-public class UnsignedAppletsTrustingListPanel extends javax.swing.JPanel {
+public class UnsignedAppletsTrustingListPanel extends JPanel {
- private javax.swing.JButton helpButton;
- private javax.swing.JButton deleteButton;
- private javax.swing.JButton addRowButton;
- private javax.swing.JButton validateTableButton;
- private javax.swing.JButton testUrlButton;
- private javax.swing.JButton invertSelectionButton;
- private javax.swing.JButton moveRowUpButton;
- private javax.swing.JButton moveRowDownButton;
- private javax.swing.JCheckBox askBeforeActionCheckBox;
- private javax.swing.JCheckBox filterRegexesCheckBox;
- private javax.swing.JComboBox<AppletSecurityLevel> mainPolicyComboBox;
- private javax.swing.JComboBox<String> deleteTypeComboBox;
- private javax.swing.JComboBox<String> viewFilter;
- private javax.swing.JLabel globalBehaviourLabel;
- private javax.swing.JLabel securityLevelLabel;
- private javax.swing.JScrollPane userTableScrollPane;
- private javax.swing.JTabbedPane mainTabPanel;
- private javax.swing.JTable userTable;
- private javax.swing.JScrollPane globalTableScrollPane;
- private javax.swing.JTable globalTable;
+ private JButton helpButton;
+ private JButton deleteButton;
+ private JButton addRowButton;
+ private JButton validateTableButton;
+ private JButton testUrlButton;
+ private JButton invertSelectionButton;
+ private JButton moveRowUpButton;
+ private JButton moveRowDownButton;
+ private JCheckBox askBeforeActionCheckBox;
+ private JCheckBox filterRegexesCheckBox;
+ private JComboBox<AppletSecurityLevel> mainPolicyComboBox;
+ private JComboBox<String> deleteTypeComboBox;
+ private JComboBox<String> viewFilter;
+ private JLabel globalBehaviourLabel;
+ private JLabel securityLevelLabel;
+ private JScrollPane userTableScrollPane;
+ private JTabbedPane mainTabPanel;
+ private JTable userTable;
+ private JScrollPane globalTableScrollPane;
+ private JTable globalTable;
private final UnsignedAppletActionStorageExtendedImpl customBackEnd;
private final UnsignedAppletActionStorageExtendedImpl globalBackEnd;
private final UnsignedAppletActionTableModel customModel;
@@ -115,7 +125,7 @@
private final ByPermanencyFilter customFilter;
private final ByPermanencyFilter globalFilter;
private final DeploymentConfiguration conf;
- private javax.swing.JTable currentTable;
+ private JTable currentTable;
private UnsignedAppletActionTableModel currentModel;
private String lastDoc;
private String lastCode;
@@ -135,7 +145,6 @@
public void run() {
try {
JFrame f = new JFrame();
- f.setSize(700, 300);
f.setLayout(new BorderLayout());
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
DeploymentConfiguration cc = new DeploymentConfiguration();
@@ -143,6 +152,7 @@
File ff1 = new File(defaultFile1);
File ff2 = new File(defaultFile2);
f.add(new UnsignedAppletsTrustingListPanel(ff2, ff1, cc));
+ f.pack();
f.setVisible(true);
} catch (Exception ex) {
OutputController.getLogger().log(OutputController.Level.ERROR_ALL, ex);
@@ -245,13 +255,28 @@
model.clear();
}
+ ListCellRenderer<Object> comboRendererWithToolTips = new DefaultListCellRenderer() {
+
+ @Override
+ public final Component getListCellRendererComponent(final JList<?> list,
+ final Object value, final int index, final boolean isSelected,
+ final boolean cellHasFocus) {
+ if (value != null) {
+ setToolTipText(value.toString());
+ }
+ return super.getListCellRendererComponent(list, value, index, isSelected,
+ cellHasFocus);
+ }
+
+ };
+
private void initComponents() {
- userTableScrollPane = new javax.swing.JScrollPane();
- globalTableScrollPane = new javax.swing.JScrollPane();
- userTable = createTbale(customModel);
- globalTable = createTbale(globalModel);
- helpButton = new javax.swing.JButton();
+ userTableScrollPane = new JScrollPane();
+ globalTableScrollPane = new JScrollPane();
+ userTable = createTable(customModel);
+ globalTable = createTable(globalModel);
+ helpButton = new JButton();
mainPolicyComboBox = new JComboBox<>(new AppletSecurityLevel[] {
AppletSecurityLevel.DENY_ALL,
AppletSecurityLevel.DENY_UNSIGNED,
@@ -259,20 +284,22 @@
AppletSecurityLevel.ALLOW_UNSIGNED
});
mainPolicyComboBox.setSelectedItem(AppletSecurityLevel.getDefault());
- securityLevelLabel = new javax.swing.JLabel();
- globalBehaviourLabel = new javax.swing.JLabel();
- deleteTypeComboBox = new javax.swing.JComboBox<>();
- viewFilter = new javax.swing.JComboBox<>();
- deleteButton = new javax.swing.JButton();
- testUrlButton = new javax.swing.JButton();
- addRowButton = new javax.swing.JButton();
- validateTableButton = new javax.swing.JButton();
- askBeforeActionCheckBox = new javax.swing.JCheckBox();
- filterRegexesCheckBox = new javax.swing.JCheckBox();
- invertSelectionButton = new javax.swing.JButton();
- moveRowUpButton = new javax.swing.JButton();
- moveRowDownButton = new javax.swing.JButton();
- mainTabPanel = new javax.swing.JTabbedPane();
+ mainPolicyComboBox.setRenderer(comboRendererWithToolTips);
+
+ securityLevelLabel = new JLabel();
+ globalBehaviourLabel = new JLabel();
+ deleteTypeComboBox = new JComboBox<>();
+ viewFilter = new JComboBox<>();
+ deleteButton = new JButton();
+ testUrlButton = new JButton();
+ addRowButton = new JButton();
+ validateTableButton = new JButton();
+ askBeforeActionCheckBox = new JCheckBox();
+ filterRegexesCheckBox = new JCheckBox();
+ invertSelectionButton = new JButton();
+ moveRowUpButton = new JButton();
+ moveRowDownButton = new JButton();
+ mainTabPanel = new JTabbedPane();
userTableScrollPane.setViewportView(userTable);
@@ -338,15 +365,15 @@
globalBehaviourLabel.setText(Translator.R("APPEXTSECguiPanelGlobalBehaviourCaption"));
- deleteTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] {
+ deleteTypeComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
Translator.R("APPEXTSECguiPanelDeleteMenuSelected"),
Translator.R("APPEXTSECguiPanelDeleteMenuAllA"),
Translator.R("APPEXTSECguiPanelDeleteMenuAllN"),
Translator.R("APPEXTSECguiPanelDeleteMenuAlly"),
Translator.R("APPEXTSECguiPanelDeleteMenuAlln"),
Translator.R("APPEXTSECguiPanelDeleteMenuAllAll")}));
-
- viewFilter.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] {
+ deleteTypeComboBox.setRenderer(comboRendererWithToolTips);
+ viewFilter.setModel(new DefaultComboBoxModel<>(new String[] {
Translator.R("APPEXTSECguiPanelShowOnlyPermanent"),
Translator.R("APPEXTSECguiPanelShowOnlyTemporal"),
Translator.R("APPEXTSECguiPanelShowAll"),
@@ -354,7 +381,7 @@
Translator.R("APPEXTSECguiPanelShowOnlyPermanentN"),
Translator.R("APPEXTSECguiPanelShowOnlyTemporalY"),
Translator.R("APPEXTSECguiPanelShowOnlyTemporalN")}));
-
+ viewFilter.setRenderer(comboRendererWithToolTips);
deleteButton.setText(Translator.R("APPEXTSECguiPanelDeleteButton"));
deleteButton.setToolTipText(Translator.R("APPEXTSECguiPanelDeleteButtonToolTip"));
deleteButton.addActionListener(new java.awt.event.ActionListener() {
@@ -425,54 +452,54 @@
}
});
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ GroupLayout layout = new GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(mainTabPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 583, Short.MAX_VALUE)
- .addComponent(globalBehaviourLabel, javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
- .addComponent(securityLevelLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap()
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(mainTabPanel, GroupLayout.Alignment.LEADING, 0, 583, Short.MAX_VALUE)
+ .addComponent(globalBehaviourLabel, GroupLayout.Alignment.LEADING, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
+ .addComponent(securityLevelLabel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(mainPolicyComboBox, 0, 474, Short.MAX_VALUE))
- .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
- .addComponent(addRowButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(validateTableButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(testUrlButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
- .addComponent(moveRowDownButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(moveRowUpButton))
+ .addGroup(GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
+ .addComponent(addRowButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(validateTableButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(testUrlButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 94, Short.MAX_VALUE)
+ .addComponent(moveRowDownButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(moveRowUpButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
- .addComponent(deleteButton).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(deleteTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(invertSelectionButton))
+ .addComponent(deleteButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(deleteTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(invertSelectionButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
- .addComponent(askBeforeActionCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(filterRegexesCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
- .addComponent(viewFilter))).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))).addContainerGap()));
+ .addComponent(askBeforeActionCheckBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(filterRegexesCheckBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 93, Short.MAX_VALUE)
+ .addComponent(viewFilter, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE))).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(helpButton, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE))).addContainerGap()));
layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup().addContainerGap()
- .addComponent(globalBehaviourLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(globalBehaviourLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(securityLevelLabel)
- .addComponent(mainPolicyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(mainPolicyComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
.addComponent(deleteButton)
.addComponent(deleteTypeComboBox)
- .addComponent(invertSelectionButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(invertSelectionButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(askBeforeActionCheckBox)
.addComponent(filterRegexesCheckBox)
.addComponent(viewFilter)))
- .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(mainTabPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(helpButton, GroupLayout.PREFERRED_SIZE, 53, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(mainTabPanel, GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(addRowButton)
.addComponent(validateTableButton)
.addComponent(testUrlButton)
@@ -698,7 +725,7 @@
moveRowDownButton.setEnabled(b);
}
- private JTable createTbale(final TableModel model) {
+ private JTable createTable(final TableModel model) {
JTable jt = new JTable() {
@Override
public TableCellEditor getCellEditor(int row, int column) {
@@ -761,7 +788,7 @@
currentTable.setModel(currentModel);
{
currentTable.getRowSorter().setSortKeys(l);
-
+
}
}
More information about the distro-pkg-dev
mailing list