Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IZPACK-1069] Allow dynamic views on panels #182

Merged
merged 19 commits into from Mar 24, 2014
Merged

[IZPACK-1069] Allow dynamic views on panels #182

merged 19 commits into from Mar 24, 2014

Conversation

mtjandra
Copy link

This is to address http://jira.codehaus.org/browse/IZPACK-1069
Refer to the link above for more information.

Allows a checkbox or radio button to show additional fields on the same userInputPanel, if conditions specified correctly. Ensures that fields are not validating during this process, validation only needs to occur when pressing the next button.

Allow specifying the topBuffer as number of pixels with the "rigid" attribute. This comes naturally and dynamically showing and hiding fields make the spacing between the top field and title change.

Let me know if anything needs clarification, and am fully open to feedback!

EDIT: Forgot to add functionality in console mode. Currently work in progress.
Checks to see if a console field should be displayed have been added, but I realize it kind of duplicates the code from the updateView() method of the GUI type fields. I plan to eventually come back to this in a seperate PR and find a way to abstract this out.

Miles Tjandrawidjaja added 14 commits March 19, 2014 14:48
…n panel viewing panel, and when panel has been revalidated
…n panel viewing panel, and when panel has been revalidated
…upon panel viewing panel, and when panel has been revalidated
…ing upon panel viewing panel, and when panel has been revalidated
…on during upon panel viewing panel, and when panel has been revalidated
…ng upon panel viewing panel, and when panel has been revalidated
…n during upon panel viewing panel, and when panel has been revalidated
your inputs. Validation matters only whne progressing through the
installer when hitting the next button. Next button should ensure good
data.
…e the isDisplayed and setDisplayed provided by the GUIField
without having to first validate. The GUIField API has been extended to
accomodate for this.
your components to start appearing. Specify the rigid attribute in the
panel tag of the userInputSpec so that the topBuffer is interpreted as
pixels.
@buildhive
Copy link

IzPack project » izpack #390 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive
Copy link

IzPack project » izpack #391 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@unb
Copy link
Collaborator

unb commented Mar 21, 2014

Some comments:

  • For the console fields, the following changes to the display() method:
    if (!getField().isConditionTrue())
    {
          return true;
    }

can be simplified by moving it to UserInputConsolePanel:

if (getField().isConditionTrue() && !field.display())
{
    // field is invalid
    rerun = true;
    break;
}
  • The duplicated code in the various GUIField implementations:
if (getField().isConditionTrue())
{
    if (!isDisplayed())
    {
        result = true;
    }
    setDisplayed(true);
}
else
{
    if (isDisplayed())
    {
        result = true;
    }
    setDisplayed(false);
}

should be moved to UserInputPanel.updateUIElements()

  • The rigid attribute needs to be added to the izpack-userinput-5.0.xsd schema in izpack-dist\src\main\resources\schema\5.0 and the topBuffer documentation changed.

UserInputConsolePanel rather than in the individual field elements.
UserInputPanel rather than through the individual fields.
…ute, and updated documentation on the topBuffer attribute
@buildhive
Copy link

IzPack project » izpack #392 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@mtjandra
Copy link
Author

  • Changes to console display() method have been simplified as suggested
  • Duplicated code in various GUIField implementations have been moved as suggested
  • izpack-userinput-5.0.xsd schema has been updated as suggested

Thank you for the feedback!
The build error "ERROR: Error cloning remote repo 'origin'" does not seem to be related to my changes.
Not sure what the cause of this is.

@unb
Copy link
Collaborator

unb commented Mar 23, 2014

Do ConsoleInputField and ConsoleChoiceFIeld still need the following in display()?

       if (!getField().isConditionTrue())
        {
            return true;
        }

@mtjandra
Copy link
Author

I don't believe they do, sorry I must have missed them.

@buildhive
Copy link

IzPack project » izpack #393 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@rkrell
Copy link
Member

rkrell commented Mar 24, 2014

The build failure is in fact a problem on the build system itself. I've seen this more times the last couple of weeks. Sometimes Githib went down. Will try a rebuild.

unb added a commit that referenced this pull request Mar 24, 2014
[IZPACK-1069] Allow dynamic views on panels
@unb unb merged commit 8ce56da into izpack:master Mar 24, 2014
@mtjandra mtjandra deleted the IZPACK-1069 branch May 1, 2014 01:28
@mtjandra mtjandra restored the IZPACK-1069 branch May 1, 2014 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants