Clone wizard and related: refactor, clean-up, fixes or improvements
commit908ebc59605504e6b33e8dd5cc072a3d0756955e
authorMarek Zawirski <marek.zawirski@gmail.com>
Sun, 17 Aug 2008 20:44:00 +0000 (17 22:44 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Thu, 21 Aug 2008 21:32:20 +0000 (21 23:32 +0200)
tree73cd037c3482f78c3078b5207015631cc2328090
parent3463bb377b4cf7ba46b9cbcc4fd27009aac3d081
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>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.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]