Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 214300 | Differences between
and this patch

Collapse All | Expand All

(-)a/hudson/src/org/netbeans/modules/hudson/api/UI.java (-10 / +5 lines)
 Lines 46-52    Link Here 
46
import java.util.logging.Level;
46
import java.util.logging.Level;
47
import java.util.logging.Logger;
47
import java.util.logging.Logger;
48
import javax.swing.Action;
48
import javax.swing.Action;
49
import org.netbeans.modules.hudson.ui.actions.CreateJob;
50
import org.netbeans.modules.hudson.ui.actions.ShowBuildConsole;
49
import org.netbeans.modules.hudson.ui.actions.ShowBuildConsole;
51
import org.netbeans.modules.hudson.ui.actions.ShowChanges;
50
import org.netbeans.modules.hudson.ui.actions.ShowChanges;
52
import org.netbeans.modules.hudson.ui.actions.ShowFailures;
51
import org.netbeans.modules.hudson.ui.actions.ShowFailures;
 Lines 55-60    Link Here 
55
import org.openide.nodes.Node;
54
import org.openide.nodes.Node;
56
import org.openide.nodes.NodeNotFoundException;
55
import org.openide.nodes.NodeNotFoundException;
57
import org.openide.nodes.NodeOp;
56
import org.openide.nodes.NodeOp;
57
import org.openide.util.ContextAwareAction;
58
import org.openide.util.Mutex;
58
import org.openide.util.Mutex;
59
import org.openide.util.RequestProcessor;
59
import org.openide.util.RequestProcessor;
60
import org.openide.windows.TopComponent;
60
import org.openide.windows.TopComponent;
 Lines 143-158    Link Here 
143
143
144
    /**
144
    /**
145
     * Action to show test failures of a build.
145
     * Action to show test failures of a build.
146
     * Context should have either a {@link HudsonJobBuild} or a {@link HudsonMavenModuleBuild}.
147
     * Enabled according to status of build(s).
146
     */
148
     */
147
    public static Action showFailuresAction(HudsonJobBuild build) {
149
    public static ContextAwareAction showFailuresAction() {
148
        return new ShowFailures(build);
150
        return ShowFailures.INSTANCE;
149
    }
150
151
    /**
152
     * Action to show test failures of a Maven module build.
153
     */
154
    public static Action showFailuresAction(HudsonMavenModuleBuild build) {
155
        return new ShowFailures(build);
156
    }
151
    }
157
152
158
}
153
}
(-)a/hudson/src/org/netbeans/modules/hudson/ui/nodes/HudsonJobBuildNode.java (-2 / +2 lines)
 Lines 105-112    Link Here 
105
        List<Action> actions = new ArrayList<Action>();
105
        List<Action> actions = new ArrayList<Action>();
106
        actions.add(UI.showChangesAction(build));
106
        actions.add(UI.showChangesAction(build));
107
        actions.add(UI.showConsoleAction(build));
107
        actions.add(UI.showConsoleAction(build));
108
        if (build.getResult() == HudsonJobBuild.Result.UNSTABLE && build.getMavenModules().isEmpty()) {
108
        if (build.getResult() == HudsonJobBuild.Result.UNSTABLE && build.getMavenModules().isEmpty()) { // XXX unconditional
109
            actions.add(UI.showFailuresAction(build));
109
            actions.add(UI.showFailuresAction());
110
        }
110
        }
111
        actions.add(null);
111
        actions.add(null);
112
        if (build instanceof OpenableInBrowser) {
112
        if (build instanceof OpenableInBrowser) {
(-)a/hudson/src/org/netbeans/modules/hudson/ui/nodes/HudsonMavenModuleBuildNode.java (-2 / +2 lines)
 Lines 85-94    Link Here 
85
    public @Override Action[] getActions(boolean context) {
85
    public @Override Action[] getActions(boolean context) {
86
        List<Action> actions = new ArrayList<Action>();
86
        List<Action> actions = new ArrayList<Action>();
87
        actions.add(UI.showConsoleAction(module));
87
        actions.add(UI.showConsoleAction(module));
88
        switch (module.getColor()) {
88
        switch (module.getColor()) { // XXX unconditional
89
        case yellow:
89
        case yellow:
90
        case yellow_anime:
90
        case yellow_anime:
91
            actions.add(UI.showFailuresAction(module));
91
            actions.add(UI.showFailuresAction());
92
        }
92
        }
93
        actions.add(null);
93
        actions.add(null);
94
        if (module instanceof OpenableInBrowser) {
94
        if (module instanceof OpenableInBrowser) {
(-)a/hudson/src/org/netbeans/modules/hudson/ui/notification/ProblemNotification.java (-4 / +6 lines)
 Lines 58-63    Link Here 
58
import org.openide.util.NbBundle.Messages;
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
import static org.netbeans.modules.hudson.ui.notification.Bundle.*;
61
import org.openide.util.Lookup;
62
import org.openide.util.lookup.Lookups;
61
63
62
/**
64
/**
63
 * Build failed or was unstable.
65
 * Build failed or was unstable.
 Lines 107-120    Link Here 
107
                    if (b.getNumber() == build) {
109
                    if (b.getNumber() == build) {
108
                        if (failed) {
110
                        if (failed) {
109
                            UI.showConsoleAction(b).actionPerformed(null);
111
                            UI.showConsoleAction(b).actionPerformed(null);
110
                        } else if (b.getMavenModules().isEmpty()) {
112
                        } else if (b.getMavenModules().isEmpty()) { // XXX unconditional?
111
                            UI.showFailuresAction(b).actionPerformed(null);
113
                            UI.showFailuresAction().createContextAwareInstance(Lookups.singleton(b)).actionPerformed(null);
112
                        } else {
114
                        } else {
113
                            for (HudsonMavenModuleBuild module : b.getMavenModules()) {
115
                            for (HudsonMavenModuleBuild module : b.getMavenModules()) {
114
                                switch (module.getColor()) {
116
                                switch (module.getColor()) { // XXX unconditional?
115
                                case yellow:
117
                                case yellow:
116
                                case yellow_anime:
118
                                case yellow_anime:
117
                                    UI.showFailuresAction(module).actionPerformed(null);
119
                                    UI.showFailuresAction().createContextAwareInstance(Lookups.singleton(module)).actionPerformed(null);
118
                                }
120
                                }
119
                            }
121
                            }
120
                        }
122
                        }

Return to bug 214300
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo