Lines 43-48
Link Here
|
43 |
package org.netbeans.api.extexecution; |
43 |
package org.netbeans.api.extexecution; |
44 |
|
44 |
|
45 |
import java.nio.charset.Charset; |
45 |
import java.nio.charset.Charset; |
|
|
46 |
import java.util.concurrent.Future; |
46 |
import java.util.logging.Level; |
47 |
import java.util.logging.Level; |
47 |
import java.util.logging.Logger; |
48 |
import java.util.logging.Logger; |
48 |
import javax.swing.event.ChangeListener; |
49 |
import javax.swing.event.ChangeListener; |
Lines 110-115
Link Here
|
110 |
|
111 |
|
111 |
private final RerunCondition rerunCondition; |
112 |
private final RerunCondition rerunCondition; |
112 |
|
113 |
|
|
|
114 |
private final RerunCallback rerunCallback; |
115 |
|
113 |
private final String optionsPath; |
116 |
private final String optionsPath; |
114 |
|
117 |
|
115 |
private final Charset charset; |
118 |
private final Charset charset; |
Lines 141-146
Link Here
|
141 |
this.errProcessorFactory2 = data.errProcessorFactory2; |
144 |
this.errProcessorFactory2 = data.errProcessorFactory2; |
142 |
this.inputOutput = data.inputOutput; |
145 |
this.inputOutput = data.inputOutput; |
143 |
this.rerunCondition = data.rerunCondition; |
146 |
this.rerunCondition = data.rerunCondition; |
|
|
147 |
this.rerunCallback = data.rerunCallback; |
144 |
this.optionsPath = data.optionsPath; |
148 |
this.optionsPath = data.optionsPath; |
145 |
this.charset = data.charset; |
149 |
this.charset = data.charset; |
146 |
this.noReset = data.noReset; |
150 |
this.noReset = data.noReset; |
Lines 661-666
Link Here
|
661 |
* |
665 |
* |
662 |
* @param rerunCondition rerun condition, <code>null</code> allowed |
666 |
* @param rerunCondition rerun condition, <code>null</code> allowed |
663 |
* @return new descriptor with configured rerun condition |
667 |
* @return new descriptor with configured rerun condition |
|
|
668 |
* @see #rerunCallback(org.netbeans.api.extexecution.ExecutionDescriptor.RerunCallback) |
664 |
*/ |
669 |
*/ |
665 |
@NonNull |
670 |
@NonNull |
666 |
@CheckReturnValue |
671 |
@CheckReturnValue |
Lines 674-679
Link Here
|
674 |
} |
679 |
} |
675 |
|
680 |
|
676 |
/** |
681 |
/** |
|
|
682 |
* Returns a descriptor with configured rerun callback. The callback |
683 |
* is invoked when the execution is triggered by the rerun action. |
684 |
* <p> |
685 |
* The default (not configured) value is <code>null</code>. |
686 |
* <p> |
687 |
* All other properties of the returned descriptor are inherited from |
688 |
* <code>this</code>. |
689 |
* |
690 |
* @param rerunCallback rerun callback, <code>null</code> allowed |
691 |
* @return new descriptor with configured rerun callback |
692 |
* @see #rerunCondition(org.netbeans.api.extexecution.ExecutionDescriptor.RerunCondition) |
693 |
* @since 1.46 |
694 |
*/ |
695 |
@NonNull |
696 |
@CheckReturnValue |
697 |
public ExecutionDescriptor rerunCallback(@NullAllowed ExecutionDescriptor.RerunCallback rerunCallback) { |
698 |
DescriptorData data = new DescriptorData(this); |
699 |
return new ExecutionDescriptor(data.rerunCallback(rerunCallback)); |
700 |
} |
701 |
|
702 |
RerunCallback getRerunCallback() { |
703 |
return rerunCallback; |
704 |
} |
705 |
|
706 |
/** |
677 |
* Returns a descriptor with configured options path. If configured |
707 |
* Returns a descriptor with configured options path. If configured |
678 |
* value is not <code>null</code> the {@link ExecutionService} will |
708 |
* value is not <code>null</code> the {@link ExecutionService} will |
679 |
* display the button in the output tab displaying the proper options |
709 |
* display the button in the output tab displaying the proper options |
Lines 762-767
Link Here
|
762 |
} |
792 |
} |
763 |
|
793 |
|
764 |
/** |
794 |
/** |
|
|
795 |
* Provides a callback to be invoked when rerun action is invoked. |
796 |
* |
797 |
* @since 1.46 |
798 |
*/ |
799 |
public interface RerunCallback { |
800 |
|
801 |
/** |
802 |
* Called when rerun action is invoked. |
803 |
* |
804 |
* @param task the task created by the rerun action |
805 |
*/ |
806 |
void performed(Future<Integer> task); |
807 |
|
808 |
} |
809 |
|
810 |
/** |
765 |
* Factory creating the input processor. |
811 |
* Factory creating the input processor. |
766 |
* @deprecated use {@link InputProcessorFactory2} |
812 |
* @deprecated use {@link InputProcessorFactory2} |
767 |
*/ |
813 |
*/ |
Lines 851-856
Link Here
|
851 |
|
897 |
|
852 |
private ExecutionDescriptor.RerunCondition rerunCondition; |
898 |
private ExecutionDescriptor.RerunCondition rerunCondition; |
853 |
|
899 |
|
|
|
900 |
private ExecutionDescriptor.RerunCallback rerunCallback; |
901 |
|
854 |
private String optionsPath; |
902 |
private String optionsPath; |
855 |
|
903 |
|
856 |
private Charset charset; |
904 |
private Charset charset; |
Lines 876-881
Link Here
|
876 |
this.errProcessorFactory = descriptor.errProcessorFactory; |
924 |
this.errProcessorFactory = descriptor.errProcessorFactory; |
877 |
this.inputOutput = descriptor.inputOutput; |
925 |
this.inputOutput = descriptor.inputOutput; |
878 |
this.rerunCondition = descriptor.rerunCondition; |
926 |
this.rerunCondition = descriptor.rerunCondition; |
|
|
927 |
this.rerunCallback = descriptor.rerunCallback; |
879 |
this.optionsPath = descriptor.optionsPath; |
928 |
this.optionsPath = descriptor.optionsPath; |
880 |
this.charset = descriptor.charset; |
929 |
this.charset = descriptor.charset; |
881 |
this.noReset = descriptor.noReset; |
930 |
this.noReset = descriptor.noReset; |
Lines 976-981
Link Here
|
976 |
return this; |
1025 |
return this; |
977 |
} |
1026 |
} |
978 |
|
1027 |
|
|
|
1028 |
public DescriptorData rerunCallback(ExecutionDescriptor.RerunCallback rerunCallback) { |
1029 |
this.rerunCallback = rerunCallback; |
1030 |
return this; |
1031 |
} |
1032 |
|
979 |
public DescriptorData optionsPath(String optionsPath) { |
1033 |
public DescriptorData optionsPath(String optionsPath) { |
980 |
this.optionsPath = optionsPath; |
1034 |
this.optionsPath = optionsPath; |
981 |
return this; |
1035 |
return this; |