[rfc][icedtea-web] itweb-settings Control Panel Resizing

Jie Kang jkang at redhat.com
Wed Jul 9 17:33:01 UTC 2014


Hello,

> > Hello,
> >
> > [...]
> >>
> >> Apart from that, good work! :-)
> >
> >
> > Thanks for the review. I have also included a backport patch to 1.5.
> >
> >>
> >> Jacob
> >>
> 
> control-panel-size-1.5-backport.patch:
>  > diff --git a/.hgignore b/.hgignore
>  > --- a/.hgignore
>  > +++ b/.hgignore
>  > @@ -11,3 +11,4 @@
>  >  netx/net/sourceforge/jnlp/resources/COPYING.html
>  >  netx/net/sourceforge/jnlp/resources/ChangeLog.html
>  >  netx/net/sourceforge/jnlp/resources/NEWS.html
>  > +bin/
> 
> Because I use my own build script, I do not know whether this directory is
> created by the build script or not. If it is should be OK to include it into
> .hgignore otherwise please keep this change to your local repo only.

I have removed this.

> 
>  > [...]
>  > @@ -85,26 +97,26 @@
>  >
>  >  public class UnsignedAppletsTrustingListPanel extends javax.swing.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 mainPolicyComboBox;
>  > -    private javax.swing.JComboBox deleteTypeComboBox;
>  > -    private javax.swing.JComboBox 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;
> 
> Please beware that javax.swing.JComboBox is declared as "public class
> JComboBox
> extends JComponent implements ItemSelectable, ListDataListener,
> ActionListener,
> Accessible" in Java 6! No type parameters for JComboBox there.
> To avoid this kind of mistakes in the future, you can set the -target switch
> to
> 6 (or 1.6) in javac or Project Explorer/<IcedTea-Web 1.5>/Properties/Java
> Compiler/JDK Complience/Compiler compliance level to 1.6 for IcedTea-Web 1.5.


Thanks for the explanation and sorry for the mistakes.;;

> 
>  > +    private JComboBox<String> deleteTypeComboBox;
> 
> See for declaration of javax.swing.JComboBox in Java 6 above.
> 
>  > +    private JComboBox<String> viewFilter;
> 
> See for declaration of javax.swing.JComboBox in Java 6 above.
> 
>  > +    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;
>  > [...]
>  > @@ -242,34 +254,51 @@
>  >          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();
>  > -        mainPolicyComboBox = new JComboBox(new AppletSecurityLevel[]{
>  > +        userTableScrollPane = new JScrollPane();
>  > +        globalTableScrollPane = new JScrollPane();
>  > +        userTable = createTable(customModel);
>  > +        globalTable = createTable(globalModel);
>  > +        helpButton = new JButton();
>  > +        mainPolicyComboBox = new JComboBox<AppletSecurityLevel>(new
>  > AppletSecurityLevel[]{
> 
> Same goes here for Java 6.
> 
>  > [...]
>  > @@ -335,15 +364,16 @@
>  >
>  >          > globalBehaviourLabel.setText(Translator.R(
>  > "APPEXTSECguiPanelGlobalBehaviourCaption"));
>  >
>  > -        deleteTypeComboBox.setModel(new
>  > javax.swing.DefaultComboBoxModel(new
>  > String[]{
>  > +        deleteTypeComboBox.setModel(new DefaultComboBoxModel<String>(new
> 
> No type parameters for DefaultComboBoxModel in Java 6 either.
> 
>  > String[]{
> 
> Please add a space between "]" and "{" here. ;-)
> 
>  >                      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<String>(new
>  > String[]{
> 
> No type parameters for DefaultComboBoxModel in Java 6 either. And, please add
> a
> space between "]" and "{" here too. ;-)
> 
>  >                      Translator.R("APPEXTSECguiPanelShowOnlyPermanent"),
>  >                      Translator.R("APPEXTSECguiPanelShowOnlyTemporal"),
>  >                      Translator.R("APPEXTSECguiPanelShowAll"),
>  > [...]
>  > @@ -695,13 +726,13 @@
>  >          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) {
>  >                  int columnx = convertColumnIndexToModel(column);
>  >                  if (columnx == 0) {
>  > -                    return new DefaultCellEditor(new JComboBox(new
>  > ExecuteAppletAction[]{ExecuteAppletAction.ALWAYS,
>  > ExecuteAppletAction.NEVER,
>  > ExecuteAppletAction.YES, ExecuteAppletAction.NO}));
>  > +                    return new DefaultCellEditor(new
>  > JComboBox<ExecuteAppletAction>(new ExecuteAppletAction[]
>  > {ExecuteAppletAction.ALWAYS, ExecuteAppletAction.NEVER,
>  > ExecuteAppletAction.YES, ExecuteAppletAction.NO}));
> 
> I think you got the jest about Java 6 API now. ;-) This is what I meant about
> being aware when backporting to IcedTea-Web 1.5 and Java 6. Well, apparently
> my
> efforts have been in vain.
> Btw, you could reformat the ExecuteAppletAction direct array to
> meet Java's (IcedTea-Web's) coding style too.
> 
>  >                  }
>  >                  if (columnx == 2) {
>  >                      column = convertColumnIndexToModel(column);
> 
> Apart from the nits, I think it is ready to be pushed. Please make sure about
> .hgignore.
> 
> Jacob
> 

Following is the ChangeLog entry: (jvanek requests it not be included in the patch diff)

2014-07-08  Jie Kang <jkang at redhat.com>

    Small changes to control panel GUI for proper display on lower resolutions
    (e.g. 800 x 600) All elements are now on-screen and visible.
    * netx/net/sourceforge/jnlp/controlpanel/ControlPanel.java
    * netx/net/sourceforge/jnlp/controlpanel/UnsignedAppletsTrustingListPanel.java


-- 

Jie Kang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: control-panel-size-2.patch
Type: text/x-patch
Size: 20575 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140709/21b9e4a8/control-panel-size-2-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: control-panel-size-1.5-backport-2.patch
Type: text/x-patch
Size: 22073 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20140709/21b9e4a8/control-panel-size-1.5-backport-2-0001.patch>


More information about the distro-pkg-dev mailing list