Package com.mvc4g.client

Examples of com.mvc4g.client.Event


        {
            bindData(this.cachedInstances);

            // clear details
            controller.handleEvent(
                    new Event(UpdateInstanceDetailAction.ID,
                            new InstanceEvent(this.currentDefinition, null)
                    )
            );

            startBtn.setEnabled(true);           
View Full Code Here


                      } else
                       
                        if (selectedToken != -1) {

                            controller.handleEvent(
                                    new Event(SignalExecutionAction.ID,
                                            new SignalInstanceEvent(getCurrentDefinition(), getSelection(), listBoxTokens.getItem(selectedToken), eventData.getText(), selectedToken)));

                        } else if (signalRef.getText().length() > 0) {
                         
                          TokenReference token = new TokenReference();
                          token.setId(getSelection().getId());
                          token.setName(signalRef.getText());
                          int foundMatch = -1;
                          int index = 0;
                          // try to find matching element from the list to avoid double signal problems
                          for (TokenReference ref : tokensToSignal)
                          {
                            if (ref.getName().equals(token.getName())) {
                              foundMatch = index;
                              break;
                            }
                            index++;
                          }
                         
                            controller.handleEvent(
                                    new Event(SignalExecutionAction.ID,
                                            new SignalInstanceEvent(getCurrentDefinition(), getSelection(), token, eventData.getText(), foundMatch)));

                        } else {
                            MessageBox.alert("Incomplete selection", "Please select element you want to signal");
                        }


                    }
                }
                )
        );

        toolBar.add(
                new Button("Close", new ClickHandler() {

                    public void onClick(ClickEvent clickEvent)
                    {

                        signalWindowPanel.close();
                        controller.handleEvent( new Event(UpdateInstancesAction.ID, getCurrentDefinition()));
                    }
                }
                )
        );
View Full Code Here

            if(index!=-1)
            {
              DeploymentRef item = listBox.getItem(index);

              controller.handleEvent(
                  new Event(UpdateDeploymentDetailAction.ID, item)
              );
            }
          }
        }
    );
View Full Code Here

            {
              reset();
             
              // force loading
              controller.handleEvent(
                  new Event(UpdateDeploymentsAction.ID, null)
              );
            }
          }
          )
      );


      Button deleteBtn = new Button("Delete", new ClickHandler()
      {
        public void onClick(ClickEvent clickEvent)
        {
          DeploymentRef deploymentRef = getSelection();
          if (deploymentRef != null)
          {
            MessageBox.confirm("Delete deployment",
                "Do you want to delete this deployment? Any related data will be removed.",
                new MessageBox.ConfirmationCallback()
                {
                  public void onResult(boolean doIt)
                  {
                    if (doIt)
                    {
                      controller.handleEvent(
                          new Event(
                              DeleteDeploymentAction.ID,
                              getSelection().getId()
                          )
                      );
                    }
                  }
                });
          }
          else
          {
            MessageBox.alert("Missing selection", "Please select a deployment");
          }
        }
      }
      );

      if(!isRiftsawInstance)
        toolBar.add(deleteBtn);

      toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));

      // filter
      MosaicPanel filterPanel = new MosaicPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
      filterPanel.setStyleName("mosaic-ToolBar");
      final com.google.gwt.user.client.ui.ListBox dropBox = new com.google.gwt.user.client.ui.ListBox(false);
      dropBox.setStyleName("bpm-operation-ui");
      dropBox.addItem("All");
      dropBox.addItem("Active");
      dropBox.addItem("Retired");

      dropBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
          switch (dropBox.getSelectedIndex())
          {
            case 0:
              currentFilter = FILTER_NONE;
              break;
            case 1:
              currentFilter = FILTER_ACTIVE;
              break;
            case 2:
              currentFilter = FILTER_SUSPENDED;
              break;
            default:
              throw new IllegalArgumentException("No such index");
          }

          renderFiltered();
        }
      });
      filterPanel.add(dropBox);

      toolBox.add(filterPanel, new BoxLayoutData(BoxLayoutData.FillStyle.VERTICAL));

      this.deploymentList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
      this.deploymentList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));

      // details
      // detail panel
      detailView = new DeploymentDetailView();
      controller.addView(DeploymentDetailView.ID, detailView);

      Timer t = new Timer()
      {
        @Override
        public void run()
        {
          controller.handleEvent(
              new Event(UpdateDeploymentsAction.ID, null)
          );
        }
      };

      t.schedule(500);
View Full Code Here

    model.clear();

    // clear details
    controller.handleEvent(
        new Event(UpdateDeploymentDetailAction.ID, null)
    );
  }
View Full Code Here

                                terminateBtn.setEnabled(true);

                                // update details
                                controller.handleEvent(
                                        new Event(UpdateInstanceDetailAction.ID,
                                                new InstanceEvent(currentDefinition, item)
                                        )
                                );
                            }
                        }
                    }
            );

            // toolbar
            final MosaicPanel toolBox = new MosaicPanel();

            toolBox.setPadding(0);
            toolBox.setWidgetSpacing(5);

            final ToolBar toolBar = new ToolBar();
            refreshBtn = new Button("Refresh", new ClickHandler() {

                public void onClick(ClickEvent clickEvent) {
                    controller.handleEvent(
                            new Event(
                                    UpdateInstancesAction.ID,
                                    getCurrentDefinition()
                            )
                    );
                }
            }
            );
            toolBar.add(refreshBtn);
            refreshBtn.setEnabled(false);
            toolBar.addSeparator();

            startBtn = new Button("Start", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    MessageBox.confirm("Start new execution",
                            "Do you want to start a new execution of this process?",
                            new MessageBox.ConfirmationCallback()
                            {
                                public void onResult(boolean doIt)
                                {
                                    if (doIt)
                                    {
                                        String url = getCurrentDefinition().getFormUrl();
                                        boolean hasForm = (url != null && !url.equals(""));
                                        if (hasForm)
                                        {
                                            ProcessDefinitionRef definition = getCurrentDefinition();
                                            iframeWindow = new IFrameWindowPanel(
                                                    definition.getFormUrl(), "New Process Instance: " + definition.getId()
                                            );

                                            iframeWindow.setCallback(
                                                    new IFrameWindowCallback()
                                                    {
                                                        public void onWindowClosed()
                                                        {
                                                            controller.handleEvent(
                                                                    new Event(UpdateInstancesAction.ID, getCurrentDefinition())
                                                            );
                                                        }
                                                    }
                                            );

                                            iframeWindow.show();
                                        }
                                        else
                                        {
                                            controller.handleEvent(
                                                    new Event(
                                                            StartNewInstanceAction.ID,
                                                            getCurrentDefinition()
                                                    )
                                            );
                                        }
                                    }

                                }
                            });

                }
            }
            );


            terminateBtn = new Button("Terminate", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    if (getSelection() != null)
                    {

                        MessageBox.confirm("Terminate instance",
                                "Terminating this instance will stop further execution.",
                                new MessageBox.ConfirmationCallback()
                                {
                                    public void onResult(boolean doIt)
                                    {
                                        if (doIt)
                                        {
                                            ProcessInstanceRef selection = getSelection();
                                            selection.setState(ProcessInstanceRef.STATE.ENDED);
                                            selection.setEndResult(ProcessInstanceRef.RESULT.OBSOLETE);
                                            controller.handleEvent(
                                                    new Event(
                                                            StateChangeAction.ID,
                                                            selection
                                                    )
                                            );
                                        }
                                    }
                                });
                    }
                    else
                    {
                        MessageBox.alert("Missing selection", "Please select an instance");
                    }
                }
            }
            );           


            deleteBtn = new Button("Delete", new ClickHandler()
            {
                public void onClick(ClickEvent clickEvent)
                {
                    if (getSelection() != null)
                    {
                        MessageBox.confirm("Delete instance",
                                "Deleting this instance will remove any history information and associated tasks as well.",
                                new MessageBox.ConfirmationCallback()
                                {
                                    public void onResult(boolean doIt)
                                    {

                                        if (doIt)
                                        {
                                            ProcessInstanceRef selection = getSelection();
                                            selection.setState(ProcessInstanceRef.STATE.ENDED);

                                            controller.handleEvent(
                                                    new Event(
                                                            DeleteInstanceAction.ID,
                                                            selection
                                                    )
                                            );
                                        }
View Full Code Here

        {
            bindData(this.cachedInstances);

            // clear details
            controller.handleEvent(
                    new Event(UpdateInstanceDetailAction.ID,
                            new InstanceEvent(this.currentDefinition, null)
                    )
            );

            startBtn.setEnabled(true);           
View Full Code Here

                        int selectedToken = listBoxTokens.getSelectedIndex();
                        int selectedSignal = listBoxTokenSignals.getSelectedIndex();
                        if (selectedToken != -1 && selectedSignal != -1) {

                            controller.handleEvent(
                                    new Event(SignalExecutionAction.ID,
                                            new SignalInstanceEvent(getCurrentDefinition(), getSelection(), listBoxTokens.getItem(selectedToken), listBoxTokenSignals.getItem(selectedSignal), selectedToken)));

                        } else {
                            MessageBox.alert("Incomplete selection", "Please select both token and signal name");
                        }
View Full Code Here

        menuButton = new ToolButton("Open", new ClickHandler()
        {
            public void onClick(ClickEvent clickEvent) {
                controller.handleEvent(
                        new Event(UpdateDefinitionsAction.ID, null)
                );
            }
        });

        // -----------------------
View Full Code Here

        {
            DeferredCommand.addCommand(new Command()
            {
                public void execute() {
                    controller.handleEvent(
                            new Event(
                                    UpdateInstancesAction.ID,
                                    getActiveDefinition()
                            )
                    );
                }
View Full Code Here

TOP

Related Classes of com.mvc4g.client.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.