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

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


    this.callbackComment = callbackComment;
   
    commentDeck = new DeckLayoutPanel();   

    // ----
    editPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));   
    textBox = new TextArea();
    textBox.setCharacterWidth(50);
    textBox.setVisibleLines(2);
    editPanel.add(textBox);
   
    editPanel.add(new Button("Save", new ClickHandler()
    {
      public void onClick(ClickEvent clickEvent)
      {
        // chart callback
        suggestion.setTitle(textBox.getText());
        addComment(suggestion); // TODO: save entity
        callbackComment.onSaveComment(suggestion);
        resetEditState();
      }
    }));
   
    HTML cancel = new HTML("cancel");
    cancel.addClickHandler(new ClickHandler()
    {
      public void onClick(ClickEvent clickEvent)
      {
        callbackComment.onCancelComment(suggestion);
        resetEditState();
      }
    });
    editPanel.add(cancel);

    // ----
    listPanel = new LayoutPanel();
    comments = new ListBox<ChartComment>(new String[]{"Title", ""});
    comments.setCellRenderer(new ListBox.CellRenderer<ChartComment>() {
      public void renderCell(ListBox listBox, int row, int col, final ChartComment item)
      {
        switch (col)
View Full Code Here


  private ListBox<String> processInstances;
  private ListBox<String> activities;

  public void provideWidget(ProvisioningCallback callback)
  {
    panel = new LayoutPanel();

    CaptionLayoutPanel wrapper = new CaptionLayoutPanel("BPAF Data Keys");
    wrapper.setLayout(new ColumnLayout());
       
    LayoutPanel leftPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));

    wrapper.getHeader().add(new Button("Reload",
        new ClickHandler()
        {
          public void onClick(ClickEvent clickEvent)
          {
            loadDefinitions();
          }
        })
    );

    processDefinitions = new ListBox<String>(new String[] {"processDefinitionID"});
    processDefinitions.setMinimumColumnWidth(0, 190);
    processDefinitions.setCellRenderer(
        new ListBox.CellRenderer<String>()
        {
          public void renderCell(ListBox<String> stringListBox, int row, int column, String item)
          {
            switch (column)
            {
              case 0:               
                processDefinitions.setText(row, column, item);
                break;
              default:
                throw new IllegalArgumentException("unknown column");
            }
          }
        }
    );
    processDefinitions.addRowSelectionHandler(
        new RowSelectionHandler()
        {
          public void onRowSelection(RowSelectionEvent rowSelectionEvent)
          {
            loadInstances();
          }
        }
    );

    leftPanel.add(processDefinitions, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));

    // -----
    LayoutPanel rightPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));

    processInstances = new ListBox<String>(new String[] {"processInstanceID"});
    processInstances.setMinimumColumnWidth(0, 190);
    processInstances.setCellRenderer(
        new ListBox.CellRenderer<String>()
        {
          public void renderCell(ListBox<String> stringListBox, int row, int column, String item)
          {
            switch (column)
            {
              case 0:               
                processInstances.setText(row, column, item);
                break;
              default:
                throw new IllegalArgumentException("unknown column");
            }
          }
        }
    );
    processInstances.addRowSelectionHandler(
        new RowSelectionHandler()
        {
          public void onRowSelection(RowSelectionEvent rowSelectionEvent)
          {
            loadActivities();
          }
        }
    );

    activities = new ListBox<String>(new String[] {"activityDefinitionID"});
       activities.setMinimumColumnWidth(0, 190);
       activities.setCellRenderer(
           new ListBox.CellRenderer<String>()
           {
             public void renderCell(ListBox<String> stringListBox, int row, int column, String item)
             {
               switch (column)
               {
                 case 0:
                   activities.setText(row, column, item);
                   break;
                 default:
                   throw new IllegalArgumentException("unknown column");
               }
             }
           }
       );


    rightPanel.add(processInstances, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
    rightPanel.add(activities, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
   
    // -----
    wrapper.add(leftPanel);
    wrapper.add(rightPanel);
View Full Code Here

 
  private void createInfoPanel()
  {

    // ----------- logo panel
    LayoutPanel logoPanel = new LayoutPanel(new BoxLayout());
    logoPanel.setStyleName("bpm-header-left");

    /*Image logo = new Image(appContext.getConfig().getLogo());
    logo.setHeight("50");
    logoPanel.add(logo);*/

 
View Full Code Here

    }

  private void createLayoutWindowPanel() {
        windowPanel = new WindowPanel("Authentication required");
        windowPanel.setAnimationEnabled(false);
        LayoutPanel panel = new LayoutPanel();
        //panel.addStyleName("WSLogin");
        windowPanel.setWidget(panel);


        // create contents
        panel.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
        Grid grid = new Grid(3, 2);
        grid.setWidget(0, 0, new Label("Username:"));
        grid.setWidget(0, 1, userNameInput);

        grid.setWidget(1, 0, new Label("Password:"));
        grid.setWidget(1, 1, passwordInput);

        grid.setWidget(2, 0, new HTML(""));
        grid.setWidget(2, 1, loginButton);

        /**
         * Create a handler so that striking enter automatically
         * submits the login.
         */
        KeyDownHandler clickOnEnter = new KeyDownHandler() {
           
            public void onKeyDown(KeyDownEvent event) {
                if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                    loginButton.click();
                }
            }
        };

        userNameInput.addKeyDownHandler(clickOnEnter);
        passwordInput.addKeyDownHandler(clickOnEnter);

        /**
         * Close the window immediately upon submission.
         */
        loginButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                windowPanel.hide();
            }
        });

        panel.add(grid);

        windowPanel.getHeader().add(Caption.IMAGES.window().createImage());

        windowPanel.addCloseHandler(new CloseHandler<PopupPanel>() {
            public void onClose(CloseEvent<PopupPanel> event) {
View Full Code Here

   
  }

  public void initialize(final List<ProcessDefinitionRef> processDefinitions) {

    final LayoutPanel panel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
    panel.setPadding(0);
    panel.setWidgetSpacing(5);

    final ToolBar toolbar = new ToolBar();
    panel.add(toolbar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
   
    toolbar.add(new Button("Search", 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());
        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));

   
    ProcessHistoryInstanceListView listview = new ProcessHistoryInstanceListView();
    final DecoratedTabLayoutPanel tabPanel = new DecoratedTabLayoutPanel(false);
    listview.provideWidget(new ProvisioningCallback(){

      @Override
      public void onSuccess(Widget instance) {
        tabPanel.add(instance, "History Instances");     
      }

      @Override
      public void onUnavailable() {
       
      }
     
    });
   
    panel.add(tabPanel, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));

        callback.onSuccess(panel);
  }
View Full Code Here

    }

    public SourceViewWidget(String[] sourceNames) {
        super(new BoxLayout(BoxLayout.Orientation.VERTICAL));

        LayoutPanel toolbar = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
        final ListBox listBox = new ListBox();
        for (String s : sourceNames)
            listBox.addItem(s);
        toolbar.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
        toolbar.add(new Button("View", new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                requestSource(listBox.getItemText(listBox.getSelectedIndex()));
            }
        }));
View Full Code Here

  public WSWindowPanel()
  {
    windowPanel = new WindowPanel();
    windowPanel.setAnimationEnabled(true);
    layout = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
    layout.setPadding(5);
    windowPanel.setWidget(layout);
  }
View Full Code Here

   * @param headerTable the header table
   * @param images the images to use in the table
   */
  private void init(FixedWidthGrid dataTable, FixedWidthFlexTable headerTable,
      ScrollTableImages images) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setLayout(new BorderLayout());
    layoutPanel.setPadding(0);
    layoutPanel.setWidgetSpacing(0);

    this.dataTable = dataTable;
    this.headerTable = headerTable;
    this.images = images;
    resizeWorker.setColumnWidget(this);

    // Prepare the header and data tables
    prepareTable(dataTable, "dataTable");
    if (headerTable != null) {
      prepareTable(headerTable, "headerTable");
    }
    if (dataTable.getSelectionPolicy().hasInputColumn()) {
      headerTable.setColumnWidth(0, getInputColumnWidth());
    }

    setStylePrimaryName(DEFAULT_STYLENAME);

    // Create the table wrapper and spacer
    if (headerTable != null) {
      headerWrapper = createWrapper("headerWrapper");
      headerSpacer = createSpacer(headerWrapper.getElement());
    }
    dataWrapper = createWrapper("dataWrapper");

    // Create image to fill width
    fillWidthImage = new Image() {
      @Override
      public void onBrowserEvent(Event event) {
        super.onBrowserEvent(event);
        if (DOM.eventGetType(event) == Event.ONCLICK) {
          fillWidth();
        }
      }
    };

    // Adopt the header and the data tables into the panel
    if (headerTable != null) {
      adoptTable(headerTable, headerWrapper, Region.NORTH);
    }
    adoptTable(dataTable, dataWrapper, Region.CENTER);

    fillWidthImage.setTitle("Shrink/Expand to fill visible area");
    images.scrollTableFillWidth().applyTo(fillWidthImage);
    Element fillWidthImageElem = fillWidthImage.getElement();
    DOM.setStyleAttribute(fillWidthImageElem, "cursor", "pointer");
    DOM.setStyleAttribute(fillWidthImageElem, "position", "absolute");
    DOM.setStyleAttribute(fillWidthImageElem, "top", "0px");
    DOM.setStyleAttribute(fillWidthImageElem, "right", "0px");
    DOM.setStyleAttribute(fillWidthImageElem, "zIndex", "1");
    // Add after the dataTable, so that to be ignored by the layout manager!!!
    layoutPanel.add(fillWidthImage);

    // Create the sort indicator Image
    sortedColumnWrapper = DOM.createSpan();
    DOM.setInnerHTML(sortedColumnWrapper, "&nbsp;");
    DOM.appendChild(sortedColumnWrapper, sortedColumnIndicator.getElement());
View Full Code Here

      setColumnsCount(columns.length);
    } else {
      headerTable = null;
    }

    final LayoutPanel layoutPanel = getLayoutPanel();
    columnWidget = new ColumnWidget(dataTable, headerTable) {
      @Override
      protected int getInputColumnWidth() {
        return dataTable.getInputColumnWidth();
      }

      @Override
      protected void hoverCell(Element cellElem) {
        dataTable.hoverCell(cellElem);
      }
    };
    setMultipleSelect(false);
    columnWidget.setResizePolicy(ResizePolicy.FILL_WIDTH);
    layoutPanel.add(columnWidget);

    // sinkEvents(Event.FOCUSEVENTS | Event.KEYEVENTS | Event.ONCLICK
    // | Event.MOUSEEVENTS | Event.ONMOUSEWHEEL);
    sinkEvents(Event.ONCLICK | Event.ONMOUSEOVER | Event.ONMOUSEOUT
        | Event.ONFOCUS | Event.ONKEYDOWN);
View Full Code Here

   */
  protected DecoratedLayoutPopupPanel(boolean autoHide, boolean modal,
      String prefix) {
    super(autoHide, modal, prefix);

    layoutPanel = new LayoutPanel();
    layoutPanel.setPadding(0);
    super.setWidget(layoutPanel);
  }
View Full Code Here

TOP

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

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.