|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 20:37:24
|
[ http://jira.springframework.org/browse/RCP-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-127:
-----------------------------
Fix Version/s: 1.x
> support glue in ButtonBarGroupContainerPopulator
> ------------------------------------------------
>
> Key: RCP-127
> URL: http://jira.springframework.org/browse/RCP-127
> Project: Spring Framework Rich Client Project
> Issue Type: Improvement
> Reporter: Peter De Bruycker
> Priority: Minor
> Fix For: 1.x
>
> Attachments: bad.png, good.png
>
>
> I tried to add a help button to the left of a buttonbar in an application dialog, but the help button was not placed to the left of the dialog, but was located just next to the ok button. (see screenshot1). See the 2nd screenshot for the expected result
> This is caused by:
> 1. the ButtonBarGroupContainerPopulator always inserts glue before inserting buttons (this is to align all buttons to the right).
> 2. the JGoodies ButtonBarBuilder ignores Box.Filler elements (as created by the GlueGroupMember)
> I propose the following solution:
> Create the method addGlue() in GroupContainerPopulator
> SimpleGroupContainerPopulator implementation:
> public void addGlue() {
> container.add(Box.createGlue());
> }
> ButtonBarGroupContainerPopulator:
> public void addGlue() {
> buttons.add(CommandGroupFactoryBean.GLUE_MEMBER_CODE);
> }
> public void onPopulated() {
> if (!buttons.contains(CommandGroupFactoryBean.GLUE_MEMBER_CODE)) {
> builder.addGlue();
> }
> int length = buttons.size();
> for (int i = 0; i < length; i++) {
> Object o = buttons.get(i);
> if (o instanceof String) {
> if (o == CommandGroupFactoryBean.SEPARATOR_MEMBER_CODE) {
> builder.addUnrelatedGap();
> }
> else if (o == CommandGroupFactoryBean.GLUE_MEMBER_CODE) {
> builder.addGlue();
> }
> }
> else if (o instanceof AbstractButton) {
> AbstractButton button = (AbstractButton) o;
> if (minimumSize != null) {
> addCustomGridded(button);
> }
> else {
> builder.addGridded(button);
> }
> if (i < buttons.size() - 1) {
> builder.addRelatedGap();
> }
> }
> }
> }
> The GlueGroupMember also has to be changed:
> protected void fill(GroupContainerPopulator parentContainer, Object factory, CommandButtonConfigurer configurer, List previousButtons) {
> parentContainer.addGlue();
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|