Clone wizard and related: refactor, clean-up, fixes or improvements
commit020d0368c9d74ac2c5dd6906d1f291ef6241ebf8
authorMarek Zawirski <marek.zawirski@gmail.com>
Sun, 17 Aug 2008 19:15:06 +0000 (17 21:15 +0200)
committerMarek Zawirski <marek.zawirski@gmail.com>
Sun, 17 Aug 2008 19:15:46 +0000 (17 21:15 +0200)
treea727e7639c56617440a7f4469fcdffefc1f30220
parent8bd78b65305bf6b635446ff66e72c46208b55db6
Clone wizard and related: refactor, clean-up, fixes or improvements

At some stage, it was hard to change or improve anything in Clone wizard
or reuse some of its components without some global refactor or clean-up.

This changeset introduces some common patterns of handling internal pages
validation and inter-pages dependencies, it tries to address existing
issues (complicated internal dependencies, redundant asymmetrical code)
with clone code that IMHO were making it hard to maintain or modify.

Some of these changes introduce new behavior (fixes or improvements),
as it was hard for me to separate this in my iterative process...

- Remove mess of using both setPageComplete() and custom isPageComplete().
  Now, checkPage() is used (calling setPageComplete()) instead - for
  internal validation, while direct setPageComplete() calls are used in
  special situations like handling inter-pages dependencies.
- RepositorySelection class introduces encapsulated result of
  RepositorySelectionPage with helper methods working on that result.
- SelectionChangeListener became new common interface for notifying other
  (dependent) pages about selection changes in current page.
  BaseWizardPage is helper abstract class handling these listeners.
- User can move backward in wizard, change something, revert this change,
  then subsequent pages doesn't set page complete to false. It's now
  supported in common way in whole wizard by *selectionEquals() methods.
- Real-time checking for some fields of destination page is introduced.
- Minor changes like renames or some simplifications, forgotten changes.

Some of this commit resulting components, may be reused in other places,
that's why they are actually in .components package.

Signed-off-by: Marek Zawirski <marek.zawirski@gmail.com>
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/CloneDestinationPage.java
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/GitCloneWizard.java
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/SourceBranchPage.java
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/BaseWizardPage.java [new file with mode: 0644]
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RepositorySelection.java [new file with mode: 0644]
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RepositorySelectionListener.java [deleted file]
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/RepositorySelectionPage.java
org.spearce.egit.ui/src/org/spearce/egit/ui/internal/components/SelectionChangeListener.java [moved from org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/BranchChangeListener.java with 50% similarity]