Lines 55-62
Link Here
|
55 |
import org.openide.awt.NotificationDisplayer; |
55 |
import org.openide.awt.NotificationDisplayer; |
56 |
import org.openide.awt.NotificationDisplayer.Priority; |
56 |
import org.openide.awt.NotificationDisplayer.Priority; |
57 |
import org.openide.util.ImageUtilities; |
57 |
import org.openide.util.ImageUtilities; |
58 |
import org.openide.util.NbBundle; |
58 |
import org.openide.util.NbBundle.Keys; |
59 |
import org.openide.util.RequestProcessor; |
59 |
import org.openide.util.RequestProcessor; |
|
|
60 |
import static org.netbeans.modules.hudson.ui.notification.ProblemNotificationBundle.*; |
60 |
|
61 |
|
61 |
/** |
62 |
/** |
62 |
* Build failed or was unstable. |
63 |
* Build failed or was unstable. |
Lines 76-89
Link Here
|
76 |
this.failed = failed; |
77 |
this.failed = failed; |
77 |
} |
78 |
} |
78 |
|
79 |
|
|
|
80 |
@Keys({ |
81 |
"title_failed={0} #{1,number,#} failed", |
82 |
"title_unstable={0} #{1,number,#} is unstable" |
83 |
}) |
79 |
private String getTitle() { |
84 |
private String getTitle() { |
80 |
// XXX use HudsonJobBuild.getDisplayName |
85 |
// XXX use HudsonJobBuild.getDisplayName |
81 |
return NbBundle.getMessage(ProblemNotification.class, failed ? "ProblemNotification.title.failed" : "ProblemNotification.title.unstable", |
86 |
return failed ? title_failed(job.getDisplayName(), build) : title_unstable(job.getDisplayName(), build); |
82 |
job.getDisplayName(), build); |
|
|
83 |
} |
87 |
} |
84 |
|
88 |
|
|
|
89 |
@Keys({ |
90 |
"description_failed=The build failed.", |
91 |
"description_unstable=Some tests failed." |
92 |
}) |
85 |
String showFailureText() { |
93 |
String showFailureText() { |
86 |
return NbBundle.getMessage(ProblemNotification.class, failed ? "ProblemNotification.description.failed" : "ProblemNotification.description.unstable"); |
94 |
return failed ? description_failed() : description_unstable(); |
87 |
} |
95 |
} |
88 |
|
96 |
|
89 |
void showFailure() { |
97 |
void showFailure() { |
Lines 113-122
Link Here
|
113 |
}); |
121 |
}); |
114 |
} |
122 |
} |
115 |
|
123 |
|
|
|
124 |
@Keys({ |
125 |
"ignore_question=Do you wish to cease to receive notifications of failures in {0}? If you change your mind, use Services > Hudson Builders > {1} > {0} > Properties > Watched.", |
126 |
"ignore_title=Ignore Failures in {0}" |
127 |
}) |
116 |
void ignore() { // #161601 |
128 |
void ignore() { // #161601 |
117 |
if (DialogDisplayer.getDefault().notify(new NotifyDescriptor.Confirmation( |
129 |
if (DialogDisplayer.getDefault().notify(new NotifyDescriptor.Confirmation( |
118 |
NbBundle.getMessage(ProblemNotification.class, "ProblemNotification.ignore.question", job.getDisplayName(), job.getInstance().getName()), |
130 |
ignore_question(job.getDisplayName(), job.getInstance().getName()), |
119 |
NbBundle.getMessage(ProblemNotification.class, "ProblemNotification.ignore.title", job.getDisplayName()), |
131 |
ignore_title(job.getDisplayName()), |
120 |
NotifyDescriptor.OK_CANCEL_OPTION)) == NotifyDescriptor.OK_OPTION) { |
132 |
NotifyDescriptor.OK_CANCEL_OPTION)) == NotifyDescriptor.OK_OPTION) { |
121 |
job.setSalient(false); |
133 |
job.setSalient(false); |
122 |
} |
134 |
} |