Skip to content

Commit

Permalink
STS-2686: fixed bug where couldn't download template projects
Browse files Browse the repository at this point in the history
  • Loading branch information
katesherwood committed Jun 11, 2012
1 parent d3eb52a commit a153dfa
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected TemplateSelectionWizardPage(TemplateWizard wizard) {

@Override
public boolean canFlipToNextPage() {
return selectedTemplate != null;
return treeViewer.getSelection() != null && !treeViewer.getSelection().isEmpty();
}

public void createControl(Composite parent) {
Expand Down Expand Up @@ -351,12 +351,13 @@ public void selectionChanged(SelectionChangedEvent event) {
if (selection instanceof TreeSelection) {
Object element = ((TreeSelection) selection).getFirstElement();
if (element instanceof Template) {
selectedTemplate = ((Template) element);
if (element != null) {
selectedTemplate = ((Template) element);
}
}
}
firstPage = null;

// selectedTemplate can be null if there is no network
if (selectedTemplate != null) {
setDescription(selectedTemplate);
if (TemplateSelectionWizardPage.this.equals(wizard.getContainer().getCurrentPage())) {
Expand Down Expand Up @@ -395,7 +396,7 @@ public IWizardPage getNextPage() {
return firstPage;
}

if (selectedTemplate == null) {
if (!canFlipToNextPage()) {
return null;
}

Expand Down Expand Up @@ -621,7 +622,7 @@ public boolean isPageComplete() {
}

private void refreshPage() {
selectedTemplate = null;
// selectedTemplate = null;

treeViewer.refresh(true);
treeViewer.setSelection(new StructuredSelection());
Expand Down

0 comments on commit a153dfa

Please sign in to comment.