Package com.mvc4g.client

Examples of com.mvc4g.client.Event


  }
 
  @Override
  public void provideWidget(final ProvisioningCallback callback) {

        controller.handleEvent(new Event(LoadProcessDefinitionsAction.ID, null));

    this.callback = callback;
   
  }
View Full Code Here


        event.setStartTime(theDate.getTime());
        event.setEndTime(edate.getTime());
        event.setPage(page);
        event.setKey(ckey);
       
        controller.handleEvent(new Event(LoadProcessHistoryAction.ID, event));
      }
     
    }) );
   
    final MosaicPanel formPanel = new MosaicPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
    panel.add(formPanel, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));

    BoxLayoutData bld1 = new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL);
        bld1.setPreferredWidth("130px");
       
        final MosaicPanel processDefBox = new MosaicPanel(new BoxLayout());
    processDefBox.add(new Label("Process Definition: "), bld1);
   
    definitionList = new ListBox();
    for (ProcessDefinitionRef ref : processDefinitions) {
      definitionList.addItem(ref.getName());
    }
    processDefBox.add(definitionList);
       
        formPanel.add(processDefBox);      
        formPanel.add(createProcessStatusListBox(bld1));   
        formPanel.add(createCorrelationKeyTextBox(bld1));   
        formPanel.add(createStartTimeDateBox(bld1));       
        formPanel.add(createEndTimeDateBox(bld1));

        prevButton=new Button("<< Previous", new ClickHandler() {

      @Override
      public void onClick(ClickEvent clickEvent) {

                if (definitionList.getItemCount() < 1) {
                    return;
                }

        String proDef = definitionList.getValue(definitionList.getSelectedIndex());

                String definitionId = null;

                for (ProcessDefinitionRef ref : processDefinitions) {
                    if (proDef.equals(ref.getName())) {
                        definitionId = ref.getId();
                    }
                }

        String theStatus = processStatusList.getValue(processStatusList.getSelectedIndex());
        Date theDate = startTime.getValue();
        if (theDate == null) {
          theDate = new Date(103,1,1);
        }
        Date edate = endTime.getValue();
        if (edate == null) {
          edate = new Date();
        }
        String ckey = correlationKey.getValue();
       
        ProcessSearchEvent event = new ProcessSearchEvent();
        event.setDefinitionKey(definitionId);
        event.setStatus(theStatus);
        event.setStartTime(theDate.getTime());
        event.setEndTime(edate.getTime());
       
        page--;
       
        if (page == 0) {
          prevButton.setEnabled(false);
        }
       
        pageLabel.setText(""+(page+1));
        event.setPage(page);
        event.setKey(ckey);
       
        controller.handleEvent(new Event(LoadProcessHistoryAction.ID, event));
      }
     
    });
        prevButton.setEnabled(false);

        nextButton=new Button("Next >>", new ClickHandler() {

      @Override
      public void onClick(ClickEvent clickEvent) {

                if (definitionList.getItemCount() < 1) {
                    return;
                }

        String proDef = definitionList.getValue(definitionList.getSelectedIndex());

                String definitionId = null;

                for (ProcessDefinitionRef ref : processDefinitions) {
                    if (proDef.equals(ref.getName())) {
                        definitionId = ref.getId();
                    }
                }

        String theStatus = processStatusList.getValue(processStatusList.getSelectedIndex());
        Date theDate = startTime.getValue();
        if (theDate == null) {
          theDate = new Date(103,1,1);
        }
        Date edate = endTime.getValue();
        if (edate == null) {
          edate = new Date();
        }
        String ckey = correlationKey.getValue();
       
        ProcessSearchEvent event = new ProcessSearchEvent();
        event.setDefinitionKey(definitionId);
        event.setStatus(theStatus);
        event.setStartTime(theDate.getTime());
        event.setEndTime(edate.getTime());
       
        page++;
       
        pageLabel.setText(""+(page+1));
       
        event.setPage(page);
        event.setKey(ckey);
       
        controller.handleEvent(new Event(LoadProcessHistoryAction.ID, event));
      }
     
    });
        nextButton.setEnabled(false);
       
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

  {
    final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
   
    // force reload instance list
    controller.handleEvent(
        new Event(UpdateInstancesAction.ID, def)
    );
  }
View Full Code Here

            {
              TaskRef task = getSelection(); // first call always null?
              if(task!=null)
              {
                controller.handleEvent(
                    new Event(UpdateDetailsAction.ID, new DetailViewEvent("OpenDetailView", task))
                );
              }
            }
          }
      );

      // toolbar
      final MosaicPanel toolBox = new MosaicPanel();
      toolBox.setPadding(0);
      toolBox.setWidgetSpacing(5);

      final ToolBar toolBar = new ToolBar();
      toolBar.add(
          new Button("Refresh", new ClickHandler() {
            public void onClick(ClickEvent clickEvent)
            {
              reload();


            }
          }
          )
      );

      toolBar.add(
          new Button("Claim", new ClickHandler() {
            public void onClick(ClickEvent clickEvent)
            {
              TaskRef selection = getSelection();

              if(selection!=null)
              {
                controller.handleEvent(
                    new Event(
                        ClaimTaskAction.ID,
                        new TaskIdentityEvent(appContext.getAuthentication().getUsername(), selection)
                    )
                );
              }
View Full Code Here

  private void reload()
  {
    // force loading
    controller.handleEvent(
        new Event(LoadTasksParticipationAction.ID, getAssignedIdentity())
    );
  }
View Full Code Here

       
        layout.add(tabPanel, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
       
        processEventsWindow = new WidgetWindowPanel("History Instance Activity", layout, true);

        controller.handleEvent(new Event(LoadProcessInstanceEventsAction.ID, selectedProcessInstanceId));

  }
View Full Code Here

    model.clear();

    // clear details
    controller.handleEvent(
        new Event(UpdateDetailsAction.ID, new DetailViewEvent("OpenDetailView", null))
    );
  }
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.