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

(-)a/java.j2seproject/nbproject/project.xml (-1 / +1 lines)
Lines 55-61 Link Here
55
                    <compile-dependency/>
55
                    <compile-dependency/>
56
                    <run-dependency>
56
                    <run-dependency>
57
                        <release-version>3</release-version>
57
                        <release-version>3</release-version>
58
                        <specification-version>3.84</specification-version>
58
                        <specification-version>3.85</specification-version>
59
                    </run-dependency>
59
                    </run-dependency>
60
                </dependency>
60
                </dependency>
61
                <dependency>
61
                <dependency>
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java (+1 lines)
Lines 798-803 Link Here
798
                    true :
798
                    true :
799
                    tabName.equals(s);
799
                    tabName.equals(s);
800
            execenv.setTabReplaceStrategy(p, p);
800
            execenv.setTabReplaceStrategy(p, p);
801
            execenv.setUserAction(false);
801
            return AntTargetExecutor.createTargetExecutor(execenv)
802
            return AntTargetExecutor.createTargetExecutor(execenv)
802
                    .execute(apc, targetNames);
803
                    .execute(apc, targetNames);
803
        }
804
        }
(-)a/o.apache.tools.ant.module/apichanges.xml (+16 lines)
Lines 109-114 Link Here
109
<!-- ACTUAL CHANGES BEGIN HERE: -->
109
<!-- ACTUAL CHANGES BEGIN HERE: -->
110
110
111
    <changes>
111
    <changes>
112
        
113
        <change id="userExecution">
114
            <api name="general"/>
115
            <summary>Added a method to mark an execution as user / non-user into the <code>AntTargetExecutor.Env</code></summary>
116
            <version major="3" minor="85"/>
117
            <date year="2017" month="5" day="2"/>
118
            <author login="tzezula"/>
119
            <compatibility addition="yes"/>
120
            <description>
121
                <p>Added a method <code>AntTargetExecutor.Env.setUserAction</code>to mark an execution as user / non-user.
122
                The executions marked as user actions are registered in the UI support
123
                <code>org.netbeans.spi.project.ui.support.BuildExecutionSupport</code>. By default the execution is an user action.
124
                </p>
125
            </description>
126
            <class package="org.apache.tools.ant.module.api" name="AntTargetExecutor"/>
127
        </change>
112
128
113
        <change id="tabReplacePolicy">
129
        <change id="tabReplacePolicy">
114
            <api name="general"/>
130
            <api name="general"/>
(-)a/o.apache.tools.ant.module/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
javac.compilerargs=-Xlint:unchecked
43
javac.compilerargs=-Xlint:unchecked
44
javac.source=1.8
44
javac.source=1.8
45
spec.version.base=3.84.0
45
spec.version.base=3.85.0
46
compile.ant.jar=${ant.core.lib}
46
compile.ant.jar=${ant.core.lib}
47
compile.ant-launcher.jar=${ant.core.lib}/../ant-launcher.jar
47
compile.ant-launcher.jar=${ant.core.lib}/../ant-launcher.jar
48
src-bridge.cp.extra=build/classes:${compile.ant.jar}:${compile.ant-launcher.jar}
48
src-bridge.cp.extra=build/classes:${compile.ant.jar}:${compile.ant-launcher.jar}
(-)a/o.apache.tools.ant.module/src/org/apache/tools/ant/module/api/AntTargetExecutor.java (+16 lines)
Lines 118-123 Link Here
118
            assert env.canBeReplaced != null;
118
            assert env.canBeReplaced != null;
119
            te.setTabReplaceStrategy(env.canReplace,env.canBeReplaced);
119
            te.setTabReplaceStrategy(env.canReplace,env.canBeReplaced);
120
        }
120
        }
121
        te.setUserAction(env.userAction);
121
        if (env.getLogger() == null) {
122
        if (env.getLogger() == null) {
122
            return te.execute();
123
            return te.execute();
123
        } else {
124
        } else {
Lines 139-144 Link Here
139
        private String preferredName;
140
        private String preferredName;
140
        private Predicate<String> canReplace;
141
        private Predicate<String> canReplace;
141
        private Predicate<String> canBeReplaced;
142
        private Predicate<String> canBeReplaced;
143
        private boolean userAction;
142
144
143
        /** Create instance of Env class describing environment for Ant target execution.
145
        /** Create instance of Env class describing environment for Ant target execution.
144
         */
146
         */
Lines 147-152 Link Here
147
            properties = new Properties();
149
            properties = new Properties();
148
            properties.putAll(AntSettings.getProperties());
150
            properties.putAll(AntSettings.getProperties());
149
            concealedProperties = Collections.emptySet();
151
            concealedProperties = Collections.emptySet();
152
            userAction = true;
150
        }
153
        }
151
154
152
        /**
155
        /**
Lines 259-263 Link Here
259
            this.canReplace = canReplace;
262
            this.canReplace = canReplace;
260
            this.canBeReplaced = canBeReplaced;
263
            this.canBeReplaced = canBeReplaced;
261
        }
264
        }
265
266
        /**
267
         * Marks the execution as an user action.
268
         * The executions marked as user actions are registered in the
269
         * UI support {@link org.netbeans.spi.project.ui.support.BuildExecutionSupport}.
270
         * By default the execution is an user action.
271
         * @param userAction if true the execution is registered into
272
         * the {@link org.netbeans.spi.project.ui.support.BuildExecutionSupport}
273
         * @since 3.85
274
         */
275
        public void setUserAction(final boolean userAction) {
276
            this.userAction = userAction;
277
        }
262
    }
278
    }
263
}
279
}
(-)a/o.apache.tools.ant.module/src/org/apache/tools/ant/module/run/LastTargetExecuted.java (-5 / +13 lines)
Lines 69-75 Link Here
69
 */
69
 */
70
public class LastTargetExecuted implements BuildExecutionSupport.ActionItem {
70
public class LastTargetExecuted implements BuildExecutionSupport.ActionItem {
71
    
71
    
72
    private LastTargetExecuted() {}
72
    private LastTargetExecuted() {
73
    }
73
    
74
    
74
    private File buildScript;
75
    private File buildScript;
75
    //private static int verbosity;
76
    //private static int verbosity;
Lines 81-86 Link Here
81
    private Boolean shouldSaveAllDocs;
82
    private Boolean shouldSaveAllDocs;
82
    private Predicate<String> canReplace;
83
    private Predicate<String> canReplace;
83
    private Predicate<String> canBeReplaced;
84
    private Predicate<String> canBeReplaced;
85
    private boolean wasRegistered;
84
86
85
    /** Called from {@link TargetExecutor}. */
87
    /** Called from {@link TargetExecutor}. */
86
    static LastTargetExecuted record(
88
    static LastTargetExecuted record(
Lines 92-98 Link Here
92
            @NullAllowed final Boolean shouldSaveAllDocs,
94
            @NullAllowed final Boolean shouldSaveAllDocs,
93
            @NonNull final Predicate<String> canReplace,
95
            @NonNull final Predicate<String> canReplace,
94
            @NonNull final Predicate<String> canBeReplaced,
96
            @NonNull final Predicate<String> canBeReplaced,
95
            Thread thread) {
97
            Thread thread,
98
            final boolean shouldRegister) {
96
        LastTargetExecuted rec = new LastTargetExecuted();
99
        LastTargetExecuted rec = new LastTargetExecuted();
97
        rec.buildScript = buildScript;
100
        rec.buildScript = buildScript;
98
        //LastTargetExecuted.verbosity = verbosity;
101
        //LastTargetExecuted.verbosity = verbosity;
Lines 104-117 Link Here
104
        rec.shouldSaveAllDocs = shouldSaveAllDocs;
107
        rec.shouldSaveAllDocs = shouldSaveAllDocs;
105
        rec.canReplace = canReplace;
108
        rec.canReplace = canReplace;
106
        rec.canBeReplaced = canBeReplaced;
109
        rec.canBeReplaced = canBeReplaced;
107
        BuildExecutionSupport.registerRunningItem(rec);
110
        if (shouldRegister) {
111
            BuildExecutionSupport.registerRunningItem(rec);
112
        }
113
        rec.wasRegistered = shouldRegister;
108
        return rec;
114
        return rec;
109
    }
115
    }
110
116
111
    static void finish(LastTargetExecuted exc) {
117
    static void finish(LastTargetExecuted exc) {
112
        BuildExecutionSupport.registerFinishedItem(exc);
118
        if (exc.wasRegistered) {
119
            BuildExecutionSupport.registerFinishedItem(exc);
120
        }
113
    }
121
    }
114
    
122
115
    /**
123
    /**
116
     * Get the last build script to be run.
124
     * Get the last build script to be run.
117
     * @return the last-run build script, or null if nothing has been run yet (or the build script disappeared etc.)
125
     * @return the last-run build script, or null if nothing has been run yet (or the build script disappeared etc.)
(-)a/o.apache.tools.ant.module/src/org/apache/tools/ant/module/run/TargetExecutor.java (-1 / +7 lines)
Lines 134-139 Link Here
134
    private Boolean shouldSaveAllDocs;
134
    private Boolean shouldSaveAllDocs;
135
    private Predicate<String> canReplace = (s) -> true;
135
    private Predicate<String> canReplace = (s) -> true;
136
    private Predicate<String> canBeReplaced = (s) -> true;
136
    private Predicate<String> canBeReplaced = (s) -> true;
137
    private boolean userAction = true;
137
    private volatile Set<String> concealedProperties;
138
    private volatile Set<String> concealedProperties;
138
139
139
    /** targets may be null to indicate default target */
140
    /** targets may be null to indicate default target */
Lines 173-178 Link Here
173
        this.canBeReplaced = canBeReplaced;
174
        this.canBeReplaced = canBeReplaced;
174
    }
175
    }
175
    
176
    
177
    public void setUserAction(final boolean userAction) {
178
        this.userAction = userAction;
179
    }
180
    
176
    private static String getProcessDisplayName(AntProjectCookie pcookie, List<String> targetNames) {
181
    private static String getProcessDisplayName(AntProjectCookie pcookie, List<String> targetNames) {
177
        Element projel = pcookie.getProjectElement();
182
        Element projel = pcookie.getProjectElement();
178
        String projectName;
183
        String projectName;
Lines 527-533 Link Here
527
                shouldSaveAllDocs,
532
                shouldSaveAllDocs,
528
                canReplace,
533
                canReplace,
529
                canBeReplaced,
534
                canBeReplaced,
530
                Thread.currentThread());
535
                Thread.currentThread(),
536
                userAction);
531
        sa.t = thisExec[0];
537
        sa.t = thisExec[0];
532
        
538
        
533
        // Don't hog the CPU, the build might take a while:
539
        // Don't hog the CPU, the build might take a while:

Return to bug 270532