예제 #1
0
  /**
   * Skeleton of toolbar creation
   *
   * @return
   */
  protected Widget buildStepBar() {
    HorizontalPanel uiToolbar = new HorizontalPanel();
    uiToolbar.setStylePrimaryName("blockSteps");
    uiToolbar.setWidth("100%");
    uiToolbar.setHorizontalAlignment(ALIGN_RIGHT);
    uiToolbar.setVerticalAlignment(ALIGN_MIDDLE);

    // Build stepBar
    int nbSteps = controller.getNbViews();

    Grid table = new Grid(1, nbSteps);
    table.setCellSpacing(3);
    Image currentImg = null;
    for (int i = 0; i < nbSteps; i++) {
      if (i == stepNumber) {
        currentImg = new Image("img/red_round_button.jpg");
      } else if (i < stepNumber) {
        currentImg = new Image("img/green_round_tick.jpg");
      } else {
        currentImg = new Image("img/green_round_button.jpg");
      }
      table.setWidget(0, i, currentImg);
    }

    uiToolbar.add(table);
    return uiToolbar;
  }
예제 #2
0
 /** Constructs a Toolbar part. */
 public Toolbar() {
   resources = GWT.create(MyResources.class);
   buttons = new ArrayList<Widget>();
   toolBar = new HorizontalPanel();
   toolBar.setHeight("30px");
   toolBar.setWidth("100%");
   toolBar.setStylePrimaryName("lab-Tools-Panel");
   toolBar.add(buildToolBar());
   initWidget(toolBar);
 }
예제 #3
0
 /**
  * Skeleton of toolbar creation
  *
  * @return
  */
 protected Widget buildToolbar() {
   HorizontalPanel uiToolbar = new HorizontalPanel();
   uiToolbar.setStylePrimaryName("blockAction");
   uiToolbar.setWidth("100%");
   uiToolbar.setHorizontalAlignment(ALIGN_RIGHT);
   uiToolbar.setVerticalAlignment(ALIGN_MIDDLE);
   uiToolbar.setSpacing(10);
   uiToolbar.setHeight("60px");
   uiToolbar.add(buildStepToolbar());
   return uiToolbar;
 }
예제 #4
0
  /** Initializes and assembles all commands into buttons in the toolbar. */
  public Toolbar() {
    buttonMap = new HashMap<String, TextButton>();
    dropDownButtonMap = new HashMap<String, DropDownButton>();

    leftButtons = new HorizontalPanel();
    leftButtons.setSpacing(4);

    rightButtons = new HorizontalPanel();
    rightButtons.setSpacing(4);
    rightButtons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);

    HorizontalPanel toolbar = new HorizontalPanel();
    toolbar.add(leftButtons); // this nesting keeps buttons left aligned
    toolbar.add(rightButtons);
    toolbar.setCellHorizontalAlignment(rightButtons, HorizontalPanel.ALIGN_RIGHT);
    toolbar.setWidth("100%");
    toolbar.setStylePrimaryName("ya-Toolbar");

    initWidget(toolbar);
  }
 // Additional widget for CEP Window operator parameter
 private Widget getOperatorExtension() {
   parametersContainer.setStylePrimaryName(GuidedRuleEditorResources.INSTANCE.css().container());
   return parametersContainer;
 }
 public CEPWindowOperatorsDropdown() {
   windowContainer.setStylePrimaryName(GuidedRuleEditorResources.INSTANCE.css().container());
   initWidget(windowContainer);
 }
예제 #7
0
 public CEPWindowOperatorsDropdown() {
   windowContainer.setStylePrimaryName(css.container());
   initWidget(windowContainer);
 }
예제 #8
0
 // Additional widget for CEP Window operator parameter
 private Widget getOperatorExtension() {
   parametersContainer.setStylePrimaryName(css.container());
   return parametersContainer;
 }
예제 #9
0
    private DocTab(
        ImageResource icon,
        String docId,
        String title,
        String tooltip,
        TabCloseObserver closeHandler) {
      docId_ = docId;

      final HorizontalPanel layoutPanel = new HorizontalPanel();
      layoutPanel.setStylePrimaryName(styles_.tabLayout());
      layoutPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
      layoutPanel.getElement().setDraggable("true");
      layoutPanel.addDomHandler(
          new DragStartHandler() {
            @Override
            public void onDragStart(DragStartEvent evt) {
              evt.getDataTransfer()
                  .setData(
                      getDataTransferFormat(),
                      docId_ + "|" + SourceWindowManager.getSourceWindowId());
              JsObject dt = evt.getDataTransfer().cast();
              dt.setString("effectAllowed", "move");

              // figure out where the cursor is inside the element; because the
              // drag shows an image of the tab, knowing where the cursor is
              // inside that image is necessary for us to know the screen
              // location of the dragged image
              int evtX = evt.getNativeEvent().getClientX();
              ElementEx ele = getElement().cast();
              events_.fireEvent(
                  new DocTabDragInitiatedEvent(
                      docId_,
                      getElement().getClientWidth(),
                      evtX - ele.getBoundingClientRect().getLeft()));
            }
          },
          DragStartEvent.getType());

      HTML left = new HTML();
      left.setStylePrimaryName(styles_.tabLayoutLeft());
      layoutPanel.add(left);

      contentPanel_ = new HorizontalPanel();
      contentPanel_.setTitle(tooltip);
      contentPanel_.setStylePrimaryName(styles_.tabLayoutCenter());
      contentPanel_.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

      if (icon != null) contentPanel_.add(imageForIcon(icon));

      label_ = new Label(title, false);
      label_.addStyleName(styles_.docTabLabel());
      contentPanel_.add(label_);

      appendDirtyMarker();

      Image img = new Image(ThemeResources.INSTANCE.closeTab());
      img.setStylePrimaryName(styles_.closeTabButton());
      img.addStyleName(ThemeStyles.INSTANCE.handCursor());
      contentPanel_.add(img);

      layoutPanel.add(contentPanel_);

      HTML right = new HTML();
      right.setStylePrimaryName(styles_.tabLayoutRight());
      layoutPanel.add(right);

      initWidget(layoutPanel);

      this.sinkEvents(Event.ONCLICK);
      closeHandler_ = closeHandler;
      closeElement_ = img.getElement();
    }