예제 #1
0
  public ConnectorEditor(Module Module) {
    super();
    this.Module = HybridbpmUI.getDevelopmentAPI().getModuleById(Module.getId());
    ;

    btnRun.setIcon(FontAwesome.PLAY);
    replaceComponent(horizontalSplitPanel, codeEditorLayout);
    btnParameters.setIcon(FontAwesome.WRENCH);
    buttonBar.addComponent(btnParameters, 0);
    buttonBar.addComponent(btnRun, 0);

    codeEditorLayout.setSizeFull();
    codeEditorLayout.addStyleName("code");
    codeEditorLayout.setMargin(new MarginInfo(false, false, false, true));

    binder.setItemDataSource(this.Module);
    binder.bind(codeEditor, "code");

    switch (Module.getType()) {
      case CONNECTOR:
        codeEditor.setCaption("Code");
        codeEditor.setMode(AceMode.groovy);
        codeEditor.setTheme(AceTheme.textmate);
        codeEditor.setShowGutter(true);
        codeEditor.setSizeFull();
        break;
    }
  }
예제 #2
0
 public void save() {
   try {
     binder.commit();
     HybridbpmUI.getBpmAPI().saveTask(binder.getItemDataSource().getBean(), null, null, null);
   } catch (Exception e) {
     logger.log(Level.SEVERE, e.getMessage(), e);
   }
 }
예제 #3
0
 private void save() {
   try {
     binder.commit();
     Module = HybridbpmUI.getDevelopmentAPI().saveModule(Module);
     binder.setItemDataSource(Module);
   } catch (FieldGroup.CommitException ex) {
     logger.log(Level.SEVERE, ex.getMessage(), ex);
   }
 }
예제 #4
0
  private void openExecutionWindow() {
    final ConnectorExecutionLayout connectorExecutionLayout = new ConnectorExecutionLayout(Module);
    final ConfigureWindow configureWindow =
        new ConfigureWindow(connectorExecutionLayout, "Execute Connector");
    configureWindow.btnOk.setCaption("Run");
    Button.ClickListener clickListener =
        new Button.ClickListener() {

          @Override
          public void buttonClick(Button.ClickEvent event) {
            if (event.getButton().equals(configureWindow.btnClose)) {
              configureWindow.close();
            } else if (event.getButton().equals(configureWindow.btnOk)) {
              connectorExecutionLayout.run();
            }
          }
        };
    configureWindow.setClickListener(clickListener);
    configureWindow.addCloseListener(this);
    HybridbpmUI.getCurrent().addWindow(configureWindow);
  }
예제 #5
0
  private void openParameterConfigurationWindow() {
    final ConnectorParametersLayout connectorParametersLayout =
        new ConnectorParametersLayout(Module);
    final ConfigureWindow configureWindow =
        new ConfigureWindow(connectorParametersLayout, "Connector parameters");
    Button.ClickListener clickListener =
        new Button.ClickListener() {

          @Override
          public void buttonClick(Button.ClickEvent event) {
            if (event.getButton().equals(configureWindow.btnClose)) {

            } else if (event.getButton().equals(configureWindow.btnOk)) {
              connectorParametersLayout.save();
            }
            configureWindow.close();
          }
        };
    configureWindow.setClickListener(clickListener);
    configureWindow.addCloseListener(this);
    HybridbpmUI.getCurrent().addWindow(configureWindow);
  }
예제 #6
0
 @Override
 public void windowClose(Window.CloseEvent e) {
   Module = HybridbpmUI.getDevelopmentAPI().getModuleById(Module.getId());
   binder.setItemDataSource(Module);
 }