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

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


  public boolean remove(int index) {
    return getLayoutPanel().remove(index);
  }

  public void add(Widget widget) {
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.add(widget);
    if (((BoxLayout) layoutPanel.getLayout()).getOrient() == Orientation.HORIZONTAL) {
      getLayoutPanel().add(widget, new BoxLayoutData(FillStyle.VERTICAL));
    } else {
      getLayoutPanel().add(widget, new BoxLayoutData(FillStyle.HORIZONTAL));
    }
  }
View Full Code Here


  /**
   * Constructs a ButtonStackBuilder on a default JPanel using a preconfigured
   * FormLayout as layout manager.
   */
  public ButtonStackBuilder() {
    this(new LayoutPanel());
  }
View Full Code Here

    this(DEFAULT_STYLENAME);
  }

  protected ComboBoxBase(String styleName) {
    super();
    final LayoutPanel layoutPanel = super.getLayoutPanel();
    layoutPanel.setLayout(new BoxLayout(Orientation.HORIZONTAL));
    layoutPanel.setPadding(0);
    layoutPanel.setWidgetSpacing(0);

    input = new TextBox();
    layoutPanel.add(input, new BoxLayoutData(FillStyle.BOTH));
    input.addKeyboardListener(new KeyboardListener() {
      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        switch (keyCode) {
          case KEY_ENTER:
          case KEY_TAB:
          case KEY_ESCAPE:
            hidePopup();
            break;
          case KEY_DOWN:
            if (!popup.isAttached()) {
              new DelayedRunnable(1) {
                @Override
                public void run() {
                  showPopup();
                }
              };
            }
            break;
          default:
        }
      }

      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
        // Nothing to do here!
      }

      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
        // Nothing to do here!
      }

    });

    button = new Button();
    button.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        if (cancelNextClick) {
          cancelNextClick = false;
        } else {
          showPopup();
        }
      }
    });
    layoutPanel.add(button, new BoxLayoutData(FillStyle.VERTICAL));

    popup = new DropDownPanel(this);
    popup.addPopupListener(new PopupListener() {
      public void onPopupClosed(PopupPanel sender, boolean autoClosed) {
        if (!autoClosed) {
View Full Code Here

    this(text, Separator.ALIGN_LEFT);
  }

  public Separator(String text, HorizontalAlignmentConstant align) {
    this.align = checkHorizontalAlignment(align);
    final LayoutPanel layoutPanel = getLayoutPanel();
    layoutPanel.setLayout(new BoxLayout(Alignment.CENTER));
    layoutPanel.setPadding(0);
    layoutPanel.setWidgetSpacing(8);
   
    final Label l = new Label(text);
    l.setWordWrap(false);
   
    final HTML hr = new HTML("<hr></hr>");
   
    if (this.align == Separator.ALIGN_LEFT) {
      layoutPanel.add(l);
      layoutPanel.add(hr, new BoxLayoutData(FillStyle.HORIZONTAL));
    } else {
      layoutPanel.add(hr, new BoxLayoutData(FillStyle.HORIZONTAL));
      layoutPanel.add(l);
    }
    setStyleName(DEFAULT_STYLENAME);
  }
View Full Code Here

  /**
   * Constructs an instance of {@code ButtonBarBuilder} on a {@link LayoutPanel}
   * using a preconfigured {@link FormLayout} as layout manager.
   */
  public ButtonBarBuilder() {
    this(new LayoutPanel());
  }
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

  }

  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

  private LayoutPanel layout;

  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

  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 void initialize(final List<ProcessDefinitionRef> processDefinitions) {

    final LayoutPanel panel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
      panel.getElement().setId("process-history-search-view");
    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.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);
       
    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);
    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

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.