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 190012
Collapse All | Expand All

(-)maven/src/org/netbeans/modules/maven/api/execute/RunUtils.java (-1 / +1 lines)
Lines 138-144 Link Here
138
    }
138
    }
139
    
139
    
140
    private static ExecutorTask executeMavenImpl(String runtimeName, final MavenExecutor exec) {
140
    private static ExecutorTask executeMavenImpl(String runtimeName, final MavenExecutor exec) {
141
        ExecutorTask task =  ExecutionEngine.getDefault().execute(runtimeName, exec, exec.getInputOutput());
141
        ExecutorTask task =  ExecutionEngine.getDefault().execute(runtimeName, exec, exec.getInputOutput("Terminal"));
142
        exec.setTask(task);
142
        exec.setTask(task);
143
        return task;
143
        return task;
144
    }
144
    }
(-)maven/src/org/netbeans/modules/maven/execute/AbstractMavenExecutor.java (-1 / +1 lines)
Lines 172-178 Link Here
172
    protected final void processInitialMessage() {
172
    protected final void processInitialMessage() {
173
        Iterator<String> it1 = messages.iterator();
173
        Iterator<String> it1 = messages.iterator();
174
        Iterator<OutputListener> it2 = listeners.iterator();
174
        Iterator<OutputListener> it2 = listeners.iterator();
175
        InputOutput ioput = getInputOutput();
175
        InputOutput ioput = getInputOutput("Terminal");
176
        try {
176
        try {
177
            while (it1.hasNext()) {
177
            while (it1.hasNext()) {
178
                OutputListener ol = it2.next();
178
                OutputListener ol = it2.next();
(-)maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java (-1 / +1 lines)
Lines 137-143 Link Here
137
            clonedConfig.setPreExecution(new BeanRunConfig(clonedConfig.getPreExecution()));
137
            clonedConfig.setPreExecution(new BeanRunConfig(clonedConfig.getPreExecution()));
138
        }
138
        }
139
        int executionresult = -10;
139
        int executionresult = -10;
140
        InputOutput ioput = getInputOutput();
140
        InputOutput ioput = getInputOutput("Terminal");
141
        ExecutionContext exCon = ActionToGoalUtils.ACCESSOR.createContext(ioput, handle);
141
        ExecutionContext exCon = ActionToGoalUtils.ACCESSOR.createContext(ioput, handle);
142
        // check the prerequisites
142
        // check the prerequisites
143
        if (clonedConfig.getProject() != null) {
143
        if (clonedConfig.getProject() != null) {
(-)maven/src/org/netbeans/modules/maven/execute/MavenExecutor.java (-1 / +1 lines)
Lines 54-60 Link Here
54
54
55
    void setTask(ExecutorTask task);
55
    void setTask(ExecutorTask task);
56
    
56
    
57
    InputOutput getInputOutput();
57
    InputOutput getInputOutput(String type);
58
    
58
    
59
    void addInitialMessage(String line, OutputListener listener);
59
    void addInitialMessage(String line, OutputListener listener);
60
}
60
}
(-)maven/src/org/netbeans/modules/maven/execute/OutputTabMaintainer.java (-7 / +15 lines)
Lines 58-69 Link Here
58
58
59
    private static class AllContext<TabContext> {
59
    private static class AllContext<TabContext> {
60
        final String name;
60
        final String name;
61
        final String type;
61
        final Class<TabContext> tabContextType;
62
        final Class<TabContext> tabContextType;
62
        final TabContext tabContext;
63
        final TabContext tabContext;
63
        AllContext(String name, Class<TabContext> tabContextType, TabContext tabContext) {
64
        AllContext(String name, String type, Class<TabContext> tabContextType, TabContext tabContext) {
64
            this.name = name;
65
            this.name = name;
65
            this.tabContextType = tabContextType;
66
            this.tabContextType = tabContextType;
66
            this.tabContext = tabContext;
67
            this.tabContext = tabContext;
68
            this.type = type;
67
        }
69
        }
68
    }
70
    }
69
71
Lines 76-81 Link Here
76
    private static final Map<InputOutput,AllContext<?>> freeTabs = new WeakHashMap<InputOutput,AllContext<?>>();
78
    private static final Map<InputOutput,AllContext<?>> freeTabs = new WeakHashMap<InputOutput,AllContext<?>>();
77
    
79
    
78
    protected InputOutput io;
80
    protected InputOutput io;
81
    private String type;
79
    private final String name;
82
    private final String name;
80
    
83
    
81
    protected OutputTabMaintainer(String name) {
84
    protected OutputTabMaintainer(String name) {
Lines 87-93 Link Here
87
    protected final void markFreeTab() {
90
    protected final void markFreeTab() {
88
        synchronized (freeTabs) {
91
        synchronized (freeTabs) {
89
            assert io != null;
92
            assert io != null;
90
            freeTabs.put(io, new AllContext<TabContext>(name, tabContextType(), createContext()));
93
            freeTabs.put(io, new AllContext<TabContext>(name, type, tabContextType(), createContext()));
91
        }
94
        }
92
    }
95
    }
93
    
96
    
Lines 99-118 Link Here
99
        return new Action[0];
102
        return new Action[0];
100
    }
103
    }
101
    
104
    
102
    public final InputOutput getInputOutput() {
105
    public final InputOutput getInputOutput(String type) {
103
        if (io == null) {
106
        if (io == null) {
104
            io = createInputOutput();
107
            io = createInputOutput(type);
105
        }
108
        }
106
        return io;
109
        return io;
107
    }
110
    }
108
    
111
    
109
    protected final InputOutput createInputOutput() {
112
    protected final InputOutput createInputOutput(String type) {
110
        synchronized (freeTabs) {
113
        synchronized (freeTabs) {
111
            for (Map.Entry<InputOutput,AllContext<?>> entry : freeTabs.entrySet()) {
114
            for (Map.Entry<InputOutput,AllContext<?>> entry : freeTabs.entrySet()) {
112
                InputOutput free = entry.getKey();
115
                InputOutput free = entry.getKey();
116
                
113
                AllContext<?> allContext = entry.getValue();
117
                AllContext<?> allContext = entry.getValue();
114
                if (io == null && allContext.name.equals(name) && allContext.tabContextType == tabContextType()) {
118
                if (io == null && allContext.name.equals(name) && allContext.type.equals(type) && allContext.tabContextType == tabContextType()) {
115
                    // Reuse it.
119
                    // Reuse it.
120
                    this.type = type; 
116
                    io = free;
121
                    io = free;
117
                    reassignAdditionalContext(tabContextType().cast(allContext.tabContext));
122
                    reassignAdditionalContext(tabContextType().cast(allContext.tabContext));
118
                    try {
123
                    try {
Lines 130-136 Link Here
130
        }
135
        }
131
        //                }
136
        //                }
132
        if (io == null) {
137
        if (io == null) {
133
            io = IOProvider.getDefault().getIO(name, createNewTabActions());
138
            IOProvider provider = type == null ? IOProvider.getDefault() : IOProvider.get(type);
139
            this.type = type;
140
            io = provider.getIO(name, createNewTabActions());
141
            
134
            io.setInputVisible(true);
142
            io.setInputVisible(true);
135
        }
143
        }
136
        return io;
144
        return io;

Return to bug 190012