Example #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;
    }
  }
 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);
   }
 }
Example #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);
   }
 }
Example #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);
  }
Example #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);
  }
Example #6
0
 @Override
 public void windowClose(Window.CloseEvent e) {
   Module = HybridbpmUI.getDevelopmentAPI().getModuleById(Module.getId());
   binder.setItemDataSource(Module);
 }