Skip to content

Commit

Permalink
Cover zero hit case (eclipse-platform#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur authored Aug 8, 2022
1 parent 39aa216 commit 14f2275
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public PreviewWizardPage() {
*/
public PreviewWizardPage(boolean wizard) {
super(PAGE_NAME, wizard);
setDescription(RefactoringUIMessages.PreviewWizardPage_description_s);
setDescription(RefactoringUIMessages.PreviewWizardPage_description_z);
}

/**
Expand Down Expand Up @@ -562,8 +562,10 @@ protected void setTreeViewerInput() {
if (fTreeViewerInputChange != null) {
input= AbstractChangeNode.createNode(null, fTreeViewerInputChange);
int filenumber= fTreeViewerInputChange.getFilenumber();
String fullDescription= RefactoringUIMessages.PreviewWizardPage_description_s;
if (filenumber > 1) {
String fullDescription= RefactoringUIMessages.PreviewWizardPage_description_z;
if (filenumber == 1) {
fullDescription= RefactoringUIMessages.PreviewWizardPage_description_s;
} else if (filenumber > 1) {
fullDescription= MessageFormat.format(RefactoringUIMessages.PreviewWizardPage_description_m, String.valueOf(filenumber));
}
setDescription(fullDescription);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public final class RefactoringUIMessages extends NLS {

public static String PreviewWizardPage_changes_filtered2;

public static String PreviewWizardPage_description_z;

public static String PreviewWizardPage_description_s;

public static String PreviewWizardPage_description_m;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ PreviewWizardPage_changes_filter_derived=derived resources hidden
PreviewWizardPage_hideDerived_text=&Hide derived resources
PreviewWizardPage_refactoring= Refactoring
PreviewWizardPage_Internal_error=An unexpected exception while creating a preview. See the error log for more details.
PreviewWizardPage_description_z= No changes to perform.
PreviewWizardPage_description_s= The following change to 1 file is necessary to perform the refactoring.
PreviewWizardPage_description_m= The following changes to {0} files are necessary to perform the refactoring.
PreviewWizardPage_changeElementLabelProvider_textFormat= {0} - {1}
Expand Down

0 comments on commit 14f2275

Please sign in to comment.