[rfc][icedtea-web] Launching PolicyEditor from CertWarningPane

Jiri Vanek jvanek at redhat.com
Fri Mar 14 14:34:06 UTC 2014


On 03/13/2014 08:41 PM, Andrew Azores wrote:
> On 03/13/2014 03:08 PM, Andrew Azores wrote:
>> Hi,
>>
>> This patch adds a button which summons a popup menu, currently with only one item, allowing the
>> user to launch PolicyEditor directly from the warning dialog. The editor appears with the current
>> applet's codebase added (if necessary) and pre-selected. This, along with the sandbox button and
>> earlier patch allowing JNLPPolicy to use per-codebase policy entries and to reload at runtime,
>> allows for easy configuration of fine grained permissions granted to an applet.
>>
>> Feedback/recommendations on the UI here are definitely welcome. At a later point, extra items will
>> be added to the popup menu to allow for "this run only" temporary permissions to be granted to the
>> applet. These choices will have to use a different mechanism for adding the permissions, however,
>> since it won't be automatically handled by the JNLPPolicy/automatically reloaded by
>> SecurityDelegate, as the policy file permissions are. (note the conspicuous lack of any code here
>> to actually force a policy reload - this is already handled by the sandbox button and
>> SecurityDelegate)
>>
>> Note that there is a visual bug with PolicyEditor where the checkboxes may not be updated
>> correctly, and will be incorrectly blank when the currently selected codebase actually does have
>> permissions assigned. This will be addressed separately. As a workaround, simply switch to "All
>> applets" codebase, then back to the applet-specific one. The checkboxes will then correctly update.
>>
>> http://caff.de/applettest/Signed.html can serve as a test applet again.
>>
>> ChangeLog:
>> Add button with popup menu to launch PolicyEditor
>> * netx/net/sourceforge/jnlp/resources/Messages.properties: (ButPolicyEditorDropdown,
>> CertWarnPolicyTip, CertWarnPolicyEditorItem): new messages
>> * netx/net/sourceforge/jnlp/security/dialogs/CertWarningPane.java: (addComponents,
>> setTextAndLabels, addButtons) refactored and split methods. (createPolicyPermissionsMenu) new
>> method. (PolicyEditorLaunchListener) new ActionListener for advancedOptions button
>>
>> Thanks,
>>
>
> Sorry, tiny update here. I noticed that there was a small "deadspot" in the middle of the new
> button, which was apparently the popupmenu component, as clicking it caused PolicyEditor to appear.
> It seems this was because the menu was added as a child component of the button. Adding the
> component to the pane itself, which is the only change between this new patch and the previous one,
> resolves this. The popup menu still appears in the same place and works fine as far as I can tell.
>
> Is there some better way to handle JPopupMenus?
>
> Thanks,
>


many import issues. Invaid(how comae? My wrong I guess) and especially unused imports.

I gave up an code a bit O:). So user experience:


popupmenu - best handling is NOT to add as component. And do not show them in actionPerforemd.
Show them *without* parent, in mause Clicked - it have positionOnScreen, and you show the poup menu 
on this pposition. Should work like charm.

I would excude this "V" from pproperties. Also the button s quote wide. Maybe use image rather?

Interesting state - dialog appeared , I clicked "V" clicked  show policy editor, it apeared, I 
clicked cancel in mian dilog/or ok in main dialog.. The editro should be modal

How does it behave for  yes/no/cancel/close of policy editor?
  - small nit - other codebases in editor are confusing.


Thanx!
   J.


More information about the distro-pkg-dev mailing list