This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 192750
Collapse All | Expand All

(-)a/hudson/src/org/netbeans/modules/hudson/ui/notification/Bundle.properties (-56 lines)
Lines 1-56 Link Here
1
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
#
3
# Copyright 2010 Oracle and/or its affiliates. All rights reserved.
4
#
5
# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
6
# Other names may be trademarks of their respective owners.
7
#
8
# The contents of this file are subject to the terms of either the GNU
9
# General Public License Version 2 only ("GPL") or the Common
10
# Development and Distribution License("CDDL") (collectively, the
11
# "License"). You may not use this file except in compliance with the
12
# License. You can obtain a copy of the License at
13
# http://www.netbeans.org/cddl-gplv2.html
14
# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
# specific language governing permissions and limitations under the
16
# License.  When distributing the software, include this License Header
17
# Notice in each file and include the License file at
18
# nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
19
# particular file as subject to the "Classpath" exception as provided
20
# by Oracle in the GPL Version 2 section of the License file that
21
# accompanied this code. If applicable, add the following below the
22
# License Header, with the fields enclosed by brackets [] replaced by
23
# your own identifying information:
24
# "Portions Copyrighted [year] [name of copyright owner]"
25
#
26
# If you wish your version of this file to be governed by only the CDDL
27
# or only the GPL Version 2, indicate your decision by adding
28
# "[Contributor] elects to include this software in this distribution
29
# under the [CDDL or GPL Version 2] license." If you do not indicate a
30
# single choice of license, a recipient has the option to distribute
31
# your version of this file under either the CDDL, the GPL Version 2 or
32
# to extend the choice of license to its licensees as provided above.
33
# However, if you add GPL Version 2 code and therefore, elected the GPL
34
# Version 2 license, then the option applies only if the new code is
35
# made subject to such option by the copyright holder.
36
#
37
# Contributor(s):
38
#
39
# Portions Copyrighted 2009 Sun Microsystems, Inc.
40
41
# {0} - job name
42
# {1} - build number
43
ProblemNotification.title.failed={0} #{1,number,#} failed
44
# {0} - job name
45
# {1} - build number
46
ProblemNotification.title.unstable={0} #{1,number,#} is unstable
47
ProblemNotification.description.failed=The build failed.
48
ProblemNotification.description.unstable=Some tests failed.
49
ProblemPanel.ignore.text=<html><u>Ignore
50
# {0} - job name
51
ProblemNotification.ignore.title=Ignore Failures in {0}
52
# {0} - job name
53
# {1} - server name
54
ProblemNotification.ignore.question=\
55
    Do you wish to cease to receive notifications of failures in {0}? \
56
    If you change your mind, use Services > Hudson Builders > {1} > {0} > Properties > Watched.
(-)a/hudson/src/org/netbeans/modules/hudson/ui/notification/ProblemNotification.java (-6 / +18 lines)
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.Messages;
59
import org.openide.util.RequestProcessor;
59
import org.openide.util.RequestProcessor;
60
import static org.netbeans.modules.hudson.ui.notification.Bundle.*;
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
    @Messages({
81
        "ProblemNotification.title.failed={0} #{1,number,#} failed",
82
        "ProblemNotification.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 ? ProblemNotification_title_failed(job.getDisplayName(), build) : ProblemNotification_title_unstable(job.getDisplayName(), build);
82
                job.getDisplayName(), build);
83
    }
87
    }
84
88
89
    @Messages({
90
        "ProblemNotification.description.failed=The build failed.",
91
        "ProblemNotification.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 ? ProblemNotification_description_failed() : ProblemNotification_description_unstable();
87
    }
95
    }
88
96
89
    void showFailure() {
97
    void showFailure() {
Lines 113-122 Link Here
113
        });
121
        });
114
    }
122
    }
115
123
124
    @Messages({
125
        "ProblemNotification.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
        "ProblemNotification.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
                ProblemNotification_ignore_question(job.getDisplayName(), job.getInstance().getName()),
119
                NbBundle.getMessage(ProblemNotification.class, "ProblemNotification.ignore.title", job.getDisplayName()),
131
                ProblemNotification_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
        }
(-)a/hudson/src/org/netbeans/modules/hudson/ui/notification/ProblemPanel.form (-5 / +3 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <Properties>
4
  <Properties>
Lines 50-56 Link Here
50
        <Property name="focusPainted" type="boolean" value="false"/>
50
        <Property name="focusPainted" type="boolean" value="false"/>
51
        <Property name="focusable" type="boolean" value="false"/>
51
        <Property name="focusable" type="boolean" value="false"/>
52
        <Property name="horizontalAlignment" type="int" value="2"/>
52
        <Property name="horizontalAlignment" type="int" value="2"/>
53
        <Property name="opaque" type="boolean" value="false"/>
54
      </Properties>
53
      </Properties>
55
      <Events>
54
      <Events>
56
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showFailureActionPerformed"/>
55
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showFailureActionPerformed"/>
Lines 61-68 Link Here
61
        <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
60
        <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
62
          <Color blue="ff" green="0" id="blue" palette="1" red="0" type="palette"/>
61
          <Color blue="ff" green="0" id="blue" palette="1" red="0" type="palette"/>
63
        </Property>
62
        </Property>
64
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
63
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
65
          <ResourceString bundle="org/netbeans/modules/hudson/ui/notification/Bundle.properties" key="ProblemPanel.ignore.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
64
          <Connection code="ProblemPanel_ignore_text()" type="code"/>
66
        </Property>
65
        </Property>
67
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
66
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
68
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
67
          <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
Lines 74-80 Link Here
74
        <Property name="focusPainted" type="boolean" value="false"/>
73
        <Property name="focusPainted" type="boolean" value="false"/>
75
        <Property name="focusable" type="boolean" value="false"/>
74
        <Property name="focusable" type="boolean" value="false"/>
76
        <Property name="horizontalAlignment" type="int" value="2"/>
75
        <Property name="horizontalAlignment" type="int" value="2"/>
77
        <Property name="opaque" type="boolean" value="false"/>
78
      </Properties>
76
      </Properties>
79
      <Events>
77
      <Events>
80
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ignoreActionPerformed"/>
78
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ignoreActionPerformed"/>
(-)a/hudson/src/org/netbeans/modules/hudson/ui/notification/ProblemPanel.java (-5 / +9 lines)
Lines 44-49 Link Here
44
44
45
import java.awt.Cursor;
45
import java.awt.Cursor;
46
import javax.swing.JPanel;
46
import javax.swing.JPanel;
47
import org.openide.util.NbBundle.Messages;
48
import static org.netbeans.modules.hudson.ui.notification.Bundle.*;
47
49
48
class ProblemPanel extends JPanel {
50
class ProblemPanel extends JPanel {
49
51
Lines 60-65 Link Here
60
        ignore.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
62
        ignore.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
61
    }
63
    }
62
64
65
    @Messages(
66
        // XXX not yet really supported by form editor
67
        {"ProblemPanel.ignore.text=<html><u>Ignore"}
68
    )
63
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
69
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
64
    private void initComponents() {
70
    private void initComponents() {
65
71
Lines 76-82 Link Here
76
        showFailure.setFocusPainted(false);
82
        showFailure.setFocusPainted(false);
77
        showFailure.setFocusable(false);
83
        showFailure.setFocusable(false);
78
        showFailure.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
84
        showFailure.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
79
        showFailure.setOpaque(false);
80
        showFailure.addActionListener(new java.awt.event.ActionListener() {
85
        showFailure.addActionListener(new java.awt.event.ActionListener() {
81
            public void actionPerformed(java.awt.event.ActionEvent evt) {
86
            public void actionPerformed(java.awt.event.ActionEvent evt) {
82
                showFailureActionPerformed(evt);
87
                showFailureActionPerformed(evt);
Lines 84-97 Link Here
84
        });
89
        });
85
90
86
        ignore.setForeground(java.awt.Color.blue);
91
        ignore.setForeground(java.awt.Color.blue);
87
        ignore.setText(org.openide.util.NbBundle.getMessage(ProblemPanel.class, "ProblemPanel.ignore.text")); // NOI18N
92
        ignore.setText(ProblemPanel_ignore_text());
88
        ignore.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
93
        ignore.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
89
        ignore.setBorderPainted(false);
94
        ignore.setBorderPainted(false);
90
        ignore.setContentAreaFilled(false);
95
        ignore.setContentAreaFilled(false);
91
        ignore.setFocusPainted(false);
96
        ignore.setFocusPainted(false);
92
        ignore.setFocusable(false);
97
        ignore.setFocusable(false);
93
        ignore.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
98
        ignore.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
94
        ignore.setOpaque(false);
95
        ignore.addActionListener(new java.awt.event.ActionListener() {
99
        ignore.addActionListener(new java.awt.event.ActionListener() {
96
            public void actionPerformed(java.awt.event.ActionEvent evt) {
100
            public void actionPerformed(java.awt.event.ActionEvent evt) {
97
                ignoreActionPerformed(evt);
101
                ignoreActionPerformed(evt);
Lines 103-116 Link Here
103
        layout.setHorizontalGroup(
107
        layout.setHorizontalGroup(
104
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
108
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
105
            .addComponent(showFailure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
109
            .addComponent(showFailure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
106
            .addComponent(ignore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
110
            .addComponent(ignore)
107
        );
111
        );
108
        layout.setVerticalGroup(
112
        layout.setVerticalGroup(
109
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
113
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
110
            .addGroup(layout.createSequentialGroup()
114
            .addGroup(layout.createSequentialGroup()
111
                .addComponent(showFailure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
115
                .addComponent(showFailure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
112
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
116
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
113
                .addComponent(ignore, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
117
                .addComponent(ignore))
114
        );
118
        );
115
    }// </editor-fold>//GEN-END:initComponents
119
    }// </editor-fold>//GEN-END:initComponents
116
120

Return to bug 192750