Package org.gwt.mosaic.ui.client.layout

Examples of org.gwt.mosaic.ui.client.layout.MosaicPanel


    this.add(getFormPanel(reportReference, callback));
  }

  private Widget getFormPanel(final ReportReference reportRef, final ReportParamCallback callback)
  {
    MosaicPanel p = new MosaicPanel();
    p.setPadding(5);
    p.add(createForm(reportRef, callback));   
    return p;
  }
View Full Code Here


  {
    boolean hasParameters = reportRef.getParameterMetaData().size()>0;
    int numRows = hasParameters ?
        reportRef.getParameterMetaData().size() + 1 : 2;

    MosaicPanel form = new MosaicPanel(new GridLayout(2, numRows));

    final Button createBtn = new Button("Create Report",
        new ClickHandler()
        {
          public void onClick(ClickEvent clickEvent)
          {
            Map<String, String> values = new HashMap<String, String>();
            for (InputField field : fields)
            {
              values.put(field.id, field.getValue());
            }

            if(!values.isEmpty())
            {
              writePrefs(values, reportRef);
            }

            callback.onSumbit(values);
          }
        });   

    Map<String,String> preferenceValues = readPrefs(reportRef);

    for(final ReportParameter reportParam : reportRef.getParameterMetaData())
    {
      String promptText = reportParam.getPromptText() != null ? reportParam.getPromptText() : reportParam.getName();
      String helpText = reportParam.getHelptext() != null ? reportParam.getHelptext() : "";

      final TextBox textBox = new TextBox();
      String prefValue = preferenceValues.get(reportParam.getName());
      if(prefValue !=null)
        textBox.setText(prefValue);     

      // retain reference to values
      final InputField field = new InputField()
      {
        String getValue()
        {
          return textBox.getText();
        }

        {
          widget = textBox;
          id = reportParam.getName();

        }
      };

      fields.add(field);

      form.add(new HTML("<b>"+promptText+"</b><br/>"+helpText));          
      form.add(textBox);
    }

    // fallback
    if(!hasParameters)
    {
      form.add(new HTML("This report doesn't require any paramters.")
      , new GridLayoutData(2,1, HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_TOP));     
    }

    // submit
    form.add(new HTML(""));
    form.add(createBtn, new GridLayoutData(HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_BOTTOM));

    return form;
  }
View Full Code Here

    controller = Registry.get(Controller.class);
  }
 
  public void provideWidget(ProvisioningCallback callback)
  {
    panel = new MosaicPanel();

    listBox = createListBox();

    initialize();
View Full Code Here

  public void initialize()
  {
    if(!initialized)
    {
      jobList = new MosaicPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
      jobList.setPadding(0);
      jobList.setWidgetSpacing(0);

      // toolbar

      final MosaicPanel toolBox = new MosaicPanel();
      toolBox.setPadding(0);
      toolBox.setWidgetSpacing(0);
      toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));

      // toolbar
      final ToolBar toolBar = new ToolBar();
      toolBar.add(
          new Button("Refresh", new ClickHandler() {
            public void onClick(ClickEvent clickEvent)
            {             
              // force loading
              controller.handleEvent(
                  new Event(UpdateJobsAction.ID, null)
              );
            }
          }
          )
      );

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

            public void onClick(ClickEvent clickEvent)
            {             
              JobRef selection = getSelection();
              if(null==selection)
              {
                MessageBox.alert("Missing selection", "Please select a job!");
              }
              else
              {
                controller.handleEvent(
                    new Event(ExecuteJobAction.ID, selection.getId())
                );
              }
            }
          }
          )
      );

      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("Timers");
      dropBox.addItem("Messages");

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

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

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

      this.jobList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
      this.jobList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
View Full Code Here

        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);
       
    MosaicPanel buttonBox = new MosaicPanel(new BoxLayout());
    buttonBox.add(prevButton);
    buttonBox.add(nextButton);
   
    pageLabel = new Label("1");
   
    buttonBox.add(pageLabel);   
       
    buttonBox.setWidgetSpacing(10);
   
    panel.add(buttonBox, new BoxLayoutData());
   
    ProcessHistoryInstanceListView listview = new ProcessHistoryInstanceListView();
    final DecoratedTabLayoutPanel tabPanel = new DecoratedTabLayoutPanel(false);
View Full Code Here

    prevButton.setEnabled(page > 0);
  }

 
  private MosaicPanel createEndTimeDateBox(BoxLayoutData bld1) {
    MosaicPanel box4 = new MosaicPanel(new BoxLayout());
    endTime = new DateBox();
    endTime.setWidth("550px");
    box4.add(new Label("End Time: "), bld1);
    box4.add(endTime);
    return box4;
  }
View Full Code Here

    return box4;
  }


  private MosaicPanel createStartTimeDateBox(BoxLayoutData bld1) {
    MosaicPanel box3 = new MosaicPanel(new BoxLayout());
    startTime = new DateBox();
    startTime.setWidth("550px");
    box3.add(new Label("Start Time: "), bld1);
    box3.add(startTime);
    return box3;
  }
View Full Code Here

    return box3;
  }


  private MosaicPanel createCorrelationKeyTextBox(BoxLayoutData bld1) {
    MosaicPanel box2 = new MosaicPanel(new BoxLayout());
    correlationKey = new TextBox();
    correlationKey.setWidth("550px");
    box2.add(new Label("Correlation Key: "), bld1);
    box2.add(correlationKey);
    box2.add(new Label(" format: correlation name = [correlation value], e.g Session=[1]"));
    return box2;
  }
View Full Code Here

    return box2;
  }


  private MosaicPanel createProcessStatusListBox(BoxLayoutData bld1) {
    MosaicPanel box1 = new MosaicPanel(new BoxLayout());
    processStatusList = new ListBox();
    processStatusList.addItem("COMPLETED");
    processStatusList.addItem("FAILED");
    processStatusList.addItem("TERMINATED");   
    box1.add(new Label("Process Status: "), bld1);
    box1.add(processStatusList);
    return box1;
  }
View Full Code Here

TOP

Related Classes of org.gwt.mosaic.ui.client.layout.MosaicPanel

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.