|
34 | 34 | import stroom.pipeline.shared.data.PipelineElementType;
|
35 | 35 | import stroom.pipeline.shared.data.PipelineProperty;
|
36 | 36 | import stroom.pipeline.shared.stepping.FindElementDocRequest;
|
| 37 | +import stroom.pipeline.shared.stepping.StepType; |
37 | 38 | import stroom.pipeline.shared.stepping.SteppingResource;
|
38 | 39 | import stroom.pipeline.stepping.client.presenter.ElementPresenter.ElementView;
|
39 | 40 | import stroom.util.shared.ErrorType;
|
|
48 | 49 |
|
49 | 50 | import com.google.gwt.core.client.GWT;
|
50 | 51 | import com.google.gwt.core.client.Scheduler;
|
| 52 | +import com.google.gwt.event.dom.client.KeyCodes; |
| 53 | +import com.google.gwt.event.dom.client.KeyDownEvent; |
51 | 54 | import com.google.inject.Inject;
|
52 | 55 | import com.google.inject.Provider;
|
53 | 56 | import com.google.web.bindery.event.shared.EventBus;
|
|
60 | 63 | import java.util.EnumMap;
|
61 | 64 | import java.util.List;
|
62 | 65 | import java.util.Objects;
|
| 66 | +import java.util.function.Consumer; |
63 | 67 | import java.util.function.Function;
|
64 | 68 | import java.util.stream.Collectors;
|
65 | 69 |
|
@@ -97,6 +101,7 @@ public class ElementPresenter extends MyPresenterWidget<ElementView> implements
|
97 | 101 | private ClassificationWrapperView inputView;
|
98 | 102 | private ClassificationWrapperView outputView;
|
99 | 103 | private View logView;
|
| 104 | + private Consumer<StepType> stepRequestHandler = null; |
100 | 105 |
|
101 | 106 | @Inject
|
102 | 107 | public ElementPresenter(final EventBus eventBus,
|
@@ -307,6 +312,17 @@ public void setCode(final String code) {
|
307 | 312 | codePresenter.getLiveAutoCompletionOption().setOff();
|
308 | 313 |
|
309 | 314 | codePresenter.setMode(getMode(element));
|
| 315 | + |
| 316 | + |
| 317 | + registerHandler(codePresenter.getView().asWidget().addDomHandler(e -> { |
| 318 | + if (KeyCodes.KEY_ENTER == e.getNativeKeyCode() && |
| 319 | + (e.isShiftKeyDown() || e.isControlKeyDown())) { |
| 320 | + e.preventDefault(); |
| 321 | + if (stepRequestHandler != null) { |
| 322 | + stepRequestHandler.accept(StepType.REFRESH); |
| 323 | + } |
| 324 | + } |
| 325 | + }, KeyDownEvent.getType())); |
310 | 326 | }
|
311 | 327 | }
|
312 | 328 |
|
@@ -611,6 +627,10 @@ private void setCommonEditorOptions(final EditorPresenter editorPresenter) {
|
611 | 627 | editorPresenter.getUseVimBindingsOption().setAvailable();
|
612 | 628 | }
|
613 | 629 |
|
| 630 | + public void setStepRequestHandler(final Consumer<StepType> onStepRefreshRequest) { |
| 631 | + this.stepRequestHandler = onStepRefreshRequest; |
| 632 | + } |
| 633 | + |
614 | 634 |
|
615 | 635 | // --------------------------------------------------------------------------------
|
616 | 636 |
|
|
0 commit comments