Exemplo n.º 1
0
  /** Constructs a new instance of this widget. */
  public TextBox() {

    setEnabled(true);
    m_textbox.setStyleName(CSS.textBox());
    m_textbox.getElement().setId("CmsTextBox_" + (idCounter++));

    TextBoxHandler handler = new TextBoxHandler("");
    m_textbox.addMouseOverHandler(handler);
    m_textbox.addMouseOutHandler(handler);
    m_textbox.addFocusHandler(handler);
    m_textbox.addBlurHandler(handler);
    m_textbox.addValueChangeHandler(handler);
    m_textbox.addKeyPressHandler(handler);

    m_handler = handler;

    m_textboxContainer.setStyleName(CSS.textBoxPanel());
    m_textboxContainer.addStyleName(I_LayoutBundle.INSTANCE.generalCss().cornerAll());
    m_textboxContainer.addStyleName(I_LayoutBundle.INSTANCE.generalCss().textMedium());
    m_panel.add(m_textboxContainer);
    m_panel.add(m_error);
    m_textboxContainer.add(m_textbox);
    m_textboxContainer.setPaddingX(4);
    sinkEvents(Event.ONPASTE);
    initWidget(m_panel);
  }
  @Override
  protected void renderView(View view) {
    contentPanel.add(view.asWidget());

    // Render bottom buttons
    List<KSButton> buttons = viewButtonsMap.get(view.getViewEnum());
    if (buttons != null) {
      for (KSButton button : buttons) {
        bottomButtonPanel.add(button);
      }
    }

    // Render top buttons
    buttons = topViewButtonsMap.get(view.getViewEnum());
    if (buttons != null) {
      for (KSButton button : buttons) {
        topButtonPanel.add(button);
      }
    }

    KSMenuItemData item = viewMenuItemMap.get(view.getViewEnum());
    if (item != null) {
      item.setSelected(true, false);
    }
  }
Exemplo n.º 3
0
  private void countCharacters(int input, TextBox tb) {

    int ilen = tb.getText().length();
    String len = Integer.toString(ilen);

    switch (input) {
      case 3: // secret 1
        pSecretCount1.clear();
        pSecretCount1.add(new HTML(len));
        if (ilen > consumerSecret_Len) {
          pSecretCount1.removeStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount1.setStyleName("core-CreateUserAccount-CharCountPass");
        } else {
          pSecretCount1.setStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount1.removeStyleName("core-CreateUserAccount-CharCountPass");
        }
        break;
      case 4: // secret 2
        pSecretCount2.clear();
        pSecretCount2.add(new HTML(len));
        if (ilen > consumerSecret_Len) {
          pSecretCount2.removeStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount2.setStyleName("core-CreateUserAccount-CharCountPass");
        } else {
          pSecretCount2.setStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount2.removeStyleName("core-CreateUserAccount-CharCountPass");
        }
        break;
    }
  }
Exemplo n.º 4
0
  public ShapeDrawToolbar(DrawAppModel drawingModel) {
    this.drawingModel = drawingModel;

    FlowPanel panel = new FlowPanel();
    initWidget(panel);

    drawingModel.setCurrentTool(new LineDrawTool(drawingModel));
    panel.add(createToolButton(drawingModel.getCurrentTool(), "Line"));
    panel.add(createToolButton(new LineDragTool(drawingModel), "Line Drag"));
    panel.add(createToolButton(new MoveDrawTool(drawingModel), "Hand"));

    drawingModel.addToolChangeHandler(
        new ToolChangeHandler() {
          @Override
          public void onToolChange(ToolChangeEvent event) {
            // TODO change visuals on tools
          }
        });

    panel.add(
        new Button(
            "Reset Size",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                ShapeDrawToolbar.this.drawingModel.getDrawingLayerModel().center();
                ShapeDrawToolbar.this.drawingModel.getDrawingLayerModel().setZoomFactor(0);
                ShapeDrawToolbar.this.drawingModel.getDrawingLayerModel().repaint();
              }
            }));
  }
Exemplo n.º 5
0
  public SimpleComposite() {

    label = new Label();

    img = new Image("img/logo.PNG");
    img.getElement().setId("pc-template-img");

    // The wrapper panel
    FlowPanel panel = new FlowPanel();
    panel.getElement().setClassName("composite");
    panel.add(img);
    panel.add(label);

    // All composites must call initWidget() in their constructors.
    initWidget(panel);

    // Add mouse move handler to the image
    img.addMouseMoveHandler(
        new MouseMoveHandler() {

          public void onMouseMove(MouseMoveEvent event) {
            label.setText("mouse moved on picture !");
          }
        });
  }
Exemplo n.º 6
0
  public DetailContentPanel(GroupDetail detail) {
    _detail = detail;

    setStyleName("ContentPanel");
    add(_title = MsoyUI.createSimplePanel(null, "ContentPanelTitle"));

    // contains content and discussions button for css min-height
    FlowPanel container = new FlowPanel();
    container.setStyleName("ContentPanelContainer");
    add(container);
    container.add(_content = new SimplePanel());
    _content.setStyleName("ContentPanelContent");

    // back to discussions button hidden by default
    container.add(_backButton = new Label(_msgs.detailBackToDiscussions()));
    _backButton.setVisible(false);
    _backButton.addStyleName("actionLabel");
    _backButton.addStyleName("ContentBackButton");
    ClickHandler backClick =
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            showDiscussions();
          }
        };
    _backButton.addClickHandler(backClick);
  }
Exemplo n.º 7
0
  /**
   * panel with a {@link #sensorOnOff "sensor-on-off" button}, a {@link #captionLabel label} with
   * the name of the sensor and a {@link #collapse button} to expand/collapse the settings for this
   * sensor. if sensor is turned off, it stops logging the data values of this sensor.
   */
  private void addCaption() {
    FlowPanel caption = new FlowPanel();
    caption.addStyleName("panelTitle");
    this.captionLabel = new Label();
    updateCaptionLabel();

    collapse =
        new ToggleButton(
            new Image(GuiResources.INSTANCE.collapse()), new Image(GuiResources.INSTANCE.expand()));
    collapse.addStyleName("collapse");
    collapse.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            dataValues.setVisible(!collapse.isDown());
          }
        });

    sensorOnOff = new SimplePanel();
    sensorON = new Image(AppResources.INSTANCE.shown());
    sensorOFF = new Image(AppResources.INSTANCE.hidden());
    sensorOnOff.add(sensorOFF);
    sensorOnOff.addStyleName("sensorOnOffButton");

    caption.add(sensorOnOff);
    caption.add(this.captionLabel);
    caption.add(collapse);
    this.add(caption);
  }
Exemplo n.º 8
0
  protected Widget newTaxonomyLink(
      final TaxonomiesUiHandlers handlers, final TaxonomyDto taxonomy) {
    FlowPanel titlePanel = new FlowPanel();
    Label taxonomyTitle = new Label(taxonomy.getName());
    taxonomyTitle.addStyleName("inline-block");
    taxonomyTitle.setTitle(taxonomy.getName());
    taxonomyTitle.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent clickEvent) {
            handlers.onTaxonomySelection(taxonomy);
          }
        });

    titlePanel.add(taxonomyTitle);
    IconAnchor edit = new IconAnchor();
    edit.setIcon(IconType.EDIT);
    edit.addStyleName("small-dual-indent");
    edit.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent clickEvent) {
            handlers.onTaxonomyEdit(taxonomy);
          }
        });

    titlePanel.add(edit);

    Heading head = new Heading(4);
    head.addStyleName("inline-block small-right-indent");
    head.add(titlePanel);
    return head;
  }
Exemplo n.º 9
0
  /** Constructor. */
  private ExportBox() {
    super(false);

    panel = new VerticalPanel();
    panel.getElement().getStyle().setMarginTop(1, Unit.EM);

    setHeadline(R.lang.Export());
    setDraggable(true);
    setWidth(WIDTH_PX + "px");

    btnExportXML = new Button(R.lang.exportInFile());
    btnExportXML.getElement().getStyle().setFloat(Float.RIGHT);
    btnExportXML.addClickHandler(this);

    btnClose = new Button(R.lang.Close());
    btnClose.getElement().getStyle().setMarginLeft(1, Unit.EM);
    btnClose.getElement().getStyle().setFloat(Float.RIGHT);
    btnClose.addClickHandler(this);

    textarea = new TextArea();
    textarea.setWidth((WIDTH_PX - 10) + "px");
    textarea.setHeight("200px");

    btnPanel = new FlowPanel();
    btnPanel.add(btnClose);
    btnPanel.add(btnExportXML);

    panel.add(textarea);
    panel.add(btnPanel);

    setContentWidget(panel);
  }
Exemplo n.º 10
0
 public SampleViewImpl() {
   initWidget(binder.createAndBindUi(this));
   panel.add(new SingleColorPickerTest());
   SingleInputPickerTest sp = new SingleInputPickerTest();
   panel.add(sp);
   panel.add(new SingleSelectPickerTest());
 }
Exemplo n.º 11
0
  private void showNonDatastoreConsumingWizardSelection(
      final FlowPanel panel, final List<WizardIdentifier> wizards, final List<RadioButton> radios) {
    if (wizards == null || wizards.isEmpty()) {
      // do nothing
      return;
    }

    panel.add(new Label("Or select a different job type ..."));
    for (final WizardIdentifier wizard : wizards) {
      final RadioButton radio = new RadioButton("initialSelection", wizard.getDisplayName());
      radio.addClickHandler(
          new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
              GWT.log(
                  "Clicked: " + wizard + " - expected " + wizard.getExpectedPageCount() + " pages");
              _stepsBeforeWizardPages = 1;
              setSteps(wizard.getExpectedPageCount() + getStepsBeforeWizardPages(), false);
              setProgress(0);
            }
          });
      panel.add(radio);
      radios.add(radio);
    }

    getWizardPanel().refreshUI();
  }
Exemplo n.º 12
0
  public Slider(
      int width,
      int height,
      double min,
      double max,
      double initialPercentage,
      boolean includeTextBox) {
    this.percentage = initialPercentage;
    this.min = min;
    this.max = max;
    // TODO Consistency check in the min-max-initialPercentage
    this.canvas = Canvas.createIfSupported();
    if (this.canvas != null) {
      this.canvas.setWidth(width + "px");
      this.canvas.setHeight(height + "px");
      this.canvas.setCoordinateSpaceWidth(width);
      this.canvas.setCoordinateSpaceHeight(height);
      this.canvas.setStyleName(RESOURCES.getCSS().slider());
      FlowPanel fp = new FlowPanel();
      fp.add(this.canvas);

      if (includeTextBox) {
        this.valueTb = new ValueBox(initialPercentage);
        fp.add(this.valueTb);
      }

      this.initWidget(fp);
      this.initialise(width, height, initialPercentage);
    }
  }
Exemplo n.º 13
0
  private void init() {
    // TODO Auto-generated method stub
    main = new FlowPanel();
    initWidget(main);

    header = new UIHomeHeader();
    main.add(header);

    container = new DeckPanel();
    container.setAnimationEnabled(true);
    main.add(container);

    uiPrestamo = new UIPrestamoImpl(this);
    container.add(uiPrestamo);

    uiMantPrestamo = new UIMantPrestamoImpl(this);
    container.add(uiMantPrestamo);

    uiCliente = new UIClienteImpl(this);
    container.add(uiCliente);

    uiAmortizacion = new UIAmortizacionImpl(this);
    container.add(uiAmortizacion);

    uiMantAmortizacion = new UIMantAmortizacionImpl(this);
    container.add(uiMantAmortizacion);

    container.showWidget(0);
    uiPrestamo.scrollPanel.refresh();
  }
Exemplo n.º 14
0
  private void createGUI() {

    getCaption().setText(app.getMenu("Exercise.CreateNew"));

    setWidget(mainWidget = new VerticalPanel());
    addDomHandlers(mainWidget);
    assignmentsTable = new FlexTable();
    FlexCellFormatter cellFormatter = assignmentsTable.getFlexCellFormatter();
    cellFormatter.setColSpan(0, 1, 2);

    assignmentsTable.setWidget(0, 1, new Label(app.getPlain("Tool")));
    assignmentsTable.setWidget(0, 2, new Label(app.getPlain("HintForCorrect")));
    assignmentsTable.setWidget(0, 3, new Label(app.getPlain("Fraction")));

    createAssignmentsTable();
    checkAssignmentsTable = new FlexTable();
    checkAssignmentsTable.setVisible(false);

    mainWidget.add(assignmentsTable);
    mainWidget.add(checkAssignmentsTable);

    addList = new UnorderedList();
    addDomHandlers(addList);
    // addIcon = new ListItem();
    Image addIcon = new Image(GuiResources.INSTANCE.menu_icon_file_new());
    ListItem addListItem = new ListItem();
    addListItem.addStyleName("toolbar_item");
    addListItem.add(addIcon);
    addList.add(addListItem);

    userAddModes = new ToolbarSubemuW(app, 1);
    userAddModes.addStyleName("toolbar_item");
    userAddModes.setVisible(false);
    for (int i = 0; i < app.getKernel().getMacroNumber(); i++) {
      if (!exercise.usesMacro(i)) {
        ListItem item = userAddModes.addItem(i + EuclidianConstants.MACRO_MODE_ID_OFFSET);
        addDomHandlers(item);
      }
    }
    addList.add(userAddModes);
    mainWidget.add(addList);

    mainWidget.add(bottomWidget = new FlowPanel());
    bottomWidget.setStyleName("DialogButtonPanel");

    btApply = new Button(app.getPlain("OK"));
    btApply.addClickHandler(this);
    btApply.getElement().getStyle().setMargin(3, Style.Unit.PX);

    addCancelButton();

    btTest = new Button(app.getPlain("Test"));
    btTest.addClickHandler(this);
    btTest.getElement().getStyle().setMargin(3, Style.Unit.PX);

    bottomWidget.add(btTest);
    bottomWidget.add(btApply);
    // bottomWidget.add(btCancel);

  }
Exemplo n.º 15
0
  @Override
  protected IsWidget body(final ApplyContext context) {
    FlowPanel body = new FlowPanel();
    body.add(new HTML(TEMPLATES.errorPanel(Console.CONSTANTS.patch_manager_apply_error_body())));

    errorDetails =
        new ErrorDetails(
            Console.CONSTANTS.patch_manager_show_details(),
            Console.CONSTANTS.patch_manager_hide_details());
    body.add(errorDetails);

    body.add(
        new HTML(
            "<h3 class=\"patch-followup-header\">"
                + Console.CONSTANTS.patch_manager_possible_actions()
                + "</h3>"));
    HTMLPanel actions =
        new HTMLPanel(
            TEMPLATES.appliedFailed(
                Console.CONSTANTS.patch_manager_apply_error_cancel_title(),
                Console.CONSTANTS.patch_manager_apply_error_cancel_body(),
                Console.CONSTANTS.patch_manager_apply_error_select_title(),
                Console.CONSTANTS.patch_manager_apply_error_select_body()));
    selectPatch = new DefaultButton(Console.CONSTANTS.patch_manager_select_patch_title());
    selectPatch.getElement().setAttribute("style", "min-width:60px;");
    selectPatch.addStyleName("primary");
    actions.add(selectPatch, "select-different-patch");
    body.add(actions);

    return body;
  }
  // Adds all the content to main panel
  public void initialize() {
    resultPanel = new FlowPanel();
    FlowPanel innerPanel = new FlowPanel();
    innerPanel.addStyleName("content-box");

    innerPanel.add(new HTML("<h2>Search results for " + filterString + "</h2>"));
    onlyLoanableButton = new Button("");
    onlyLoanableButton.addStyleName("onlyLoanable");
    onlyLoanableButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onlyLoanable = !onlyLoanable;
            resultsTableList = new ArrayList<ShopItem>(results);
            if (onlyLoanable)
              for (ShopItem i : resultsTableList) if (!i.isLoanable()) resultsTableList.remove(i);
            updateTable();
          }
        });
    innerPanel.add(onlyLoanableButton);
    innerPanel.add(createResultTable());

    resultPanel.add(innerPanel);
    initWidget(resultPanel);
    layout.add(this);
  }
Exemplo n.º 17
0
 private final void addChild(IsWidget child, String width) {
   if (horizontal) {
     panel.add(horizontalWrapper(child, width));
   } else {
     panel.add(child);
   }
 }
Exemplo n.º 18
0
  public TilePopup() {
    super(true, false);
    // init widgets
    FlowPanel Content = new FlowPanel();
    Label levelLabel = new Label("Level:");
    levelBox = new IntegerBox();

    // setup widgets
    levelBox.setWidth("50px");
    levelBox.setMaxLength(2);
    levelBox.addKeyUpHandler(
        new KeyUpHandler() {

          @Override
          public void onKeyUp(KeyUpEvent event) {
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
              hide();
            }
          }
        });

    // build
    Content.add(levelLabel);
    Content.add(levelBox);
    this.add(Content);
  }
Exemplo n.º 19
0
  void repaint() {
    files.clear();
    for (final String key : idOrdering) {
      files.add(
          new LinkButton(
              "icon-remove",
              id2name.get(key),
              "",
              new ClickHandler() {
                HandlerRegistration handler;

                @Override
                public void onClick(ClickEvent event) {
                  deleteName.setText(key);
                  handler =
                      deleteForm.addSubmitCompleteHandler(
                          new SubmitCompleteHandler() {
                            @Override
                            public void onSubmitComplete(SubmitCompleteEvent event) {
                              handler.removeHandler();
                              idOrdering.remove(key);
                              id2name.remove(key);
                              repaint();
                            }
                          });
                  deleteForm.submit();
                }
              }));
      files.add(new InlineLabel(" "));
    }
    if (id2name.size() > 0) files.add(new HTML("<br/>"));
  }
Exemplo n.º 20
0
  public CollapsiblePanel(String heading) {
    disclosurePanel = new DisclosurePanel();

    FlowPanel h = new FlowPanel();
    h.add(icon = new Icon(IconType.PLUS));
    h.add(header = new InlineLabel(heading));
    header.addStyleName("small-indent");
    setHeader(h);

    disclosurePanel.addCloseHandler(
        new CloseHandler<DisclosurePanel>() {
          @Override
          public void onClose(CloseEvent<DisclosurePanel> event) {
            icon.setIcon(IconType.PLUS);
          }
        });

    disclosurePanel.addOpenHandler(
        new OpenHandler<DisclosurePanel>() {
          @Override
          public void onOpen(OpenEvent<DisclosurePanel> event) {
            icon.setIcon(IconType.MINUS);
          }
        });

    disclosurePanel.add(content = new FlowPanel());
    disclosurePanel.removeStyleName("gwt-DisclosurePanel");
    disclosurePanel.setAnimationEnabled(true);
    addStyleName("collapsible");
    setWidget(disclosurePanel);
  }
  public TransferElementPanel() {

    mainPnl = new FlowPanel();
    nodeList = new ArrayList<String>();
    container = new FlowPanel();
    container.setStyleName("trnsfrElmt-containerPnl");

    closeBtn = new Button();
    closeBtn.setStyleName("endpt-list-pnl-close-btn");

    HTMLPanel hdr = new HTMLPanel("Transfer Element");
    hdr.setStyleName("trnsfrElmnt-list-hdr");
    hdr.add(closeBtn);

    trnsfrElmntOkBtn = new SwitchButton("OK");
    trnsfrElmntOkBtn.setStyleName("priLvl-btn");
    FlowPanel btnPnl = new FlowPanel();
    btnPnl.setStyleName("trnsfrElem-btnPnl");
    btnPnl.add(trnsfrElmntOkBtn);

    nodeContainer = new FlowPanel();
    nodeContainer.setStyleName("node-wdgt-cntr");
    container.add(hdr);
    container.add(nodeContainer);
    container.add(btnPnl);

    mainPnl.setStyleName("endpt-list-pnl");
    mainPnl.add(container);
    // mainPnl.add(btnPnl);

    hide();

    initWidget(mainPnl);
  }
Exemplo n.º 22
0
  private Panel buildPanelBrowse() {

    this._panelBrowse.setSpacing(Constantes.SPACING_MIN);
    this._panelBrowse.setHeight(Constantes.Dim50PX);
    this._panelBrowse.setWidth(Constantes.MAX_SIZE);
    this._panelBrowse.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
    this._panelBrowse.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

    // radio button
    final VerticalPanel vPanelLabel = new VerticalPanel();
    vPanelLabel.add(this._rbChoisirArchive);
    vPanelLabel.add(this._rbChoisirRepSource);
    this._panelBrowse.add(vPanelLabel);
    this._panelBrowse.setCellWidth(vPanelLabel, "300px");

    // action panel
    final FlowPanel actionPanel = new FlowPanel();
    actionPanel.add(this._fileUploader);
    actionPanel.add(this.buildAppletButton());
    this._panelBrowse.add(actionPanel);
    this._panelBrowse.setCellWidth(actionPanel, "350px");

    // buttons
    this._panelBrowse.add(this._btGoInfo);
    this._panelBrowse.setCellWidth(this._btGoInfo, "50px");

    this._panelBrowse.add(this._btDemo);

    return this._panelBrowse;
  }
Exemplo n.º 23
0
  @Override
  protected Widget onInitialization() {
    setHeight100();

    lockInfo = new LockInfoWidget();
    HeaderWidget header = new HeaderWidget();
    sidebar = new SwitcherWidget(true);
    workarea.setStyleName("Workspace-body-center-content");

    ScrollPanel workareaScroller =
        new ScrollPanel(Gwt.createDiv("Workspace-body-center-content", workarea));
    workareaScroller.getElement().setId("workarea-scroller");
    workareaScroller.setHeight("100%");
    workarea.setScrollPanel(workareaScroller);

    FlowPanel body = new FlowPanel();
    body.setStyleName("Workspace-body");
    body.add(Gwt.createDiv("Workspace-body-west", sidebar));
    body.add(Gwt.createDiv("Workspace-body-center", workareaScroller));

    FlowPanel workspace = Gwt.createFlowPanel(Gwt.createDiv("Workspace-header", header), body);
    workspace.setStyleName("Workspace");

    locker = new LockWidget(workspace);

    return new FullscreenPanel(locker);
  }
Exemplo n.º 24
0
  private void addToolbar(Element el, boolean isSetupChunk, AceEditorNative editor) {
    FlowPanel toolbarPanel = new FlowPanel();
    toolbarPanel.addStyleName(ThemeStyles.INSTANCE.inlineChunkToolbar());

    boolean isDark = themes_.isDark(themes_.getEffectiveThemeName(uiPrefs_.theme().getValue()));

    if (isSetupChunk) {
      Image optionsIcon = createOptionsIcon(isDark, true);
      toolbarPanel.add(optionsIcon);
    } else {
      Image optionsIcon = createOptionsIcon(isDark, false);
      optionsIcon.getElement().getStyle().setMarginRight(9, Unit.PX);
      toolbarPanel.add(optionsIcon);

      // Note that 'run current chunk' currently only operates within Rmd
      if (editor.getSession().getMode().getId().equals("mode/rmarkdown")) {
        Image runPreviousIcon = createRunPreviousIcon(isDark);
        runPreviousIcon.getElement().getStyle().setMarginRight(8, Unit.PX);
        toolbarPanel.add(runPreviousIcon);

        Image runIcon = createRunIcon();
        toolbarPanel.add(runIcon);
      }
    }

    display(toolbarPanel, el);
  }
Exemplo n.º 25
0
  /** Creates a control panel for adjusting the number of histogram classes */
  private void createNumClassesPanel() {

    int numClasses = getModel().getSettings().getNumClasses();
    fldNumClasses = (new InputPanelW(null, app, -1, false)).getTextComponent();
    fldNumClasses.setEditable(false);
    fldNumClasses.setOpaque(true);
    fldNumClasses.setColumns(2);
    fldNumClasses.setVisible(false);

    sliderNumClasses = new Slider(3, 20);
    sliderNumClasses.setValue(numClasses);

    sliderNumClasses.setMajorTickSpacing(1);

    sliderNumClasses.addChangeHandler(
        new ChangeHandler() {

          public void onChange(ChangeEvent event) {
            getModel().getSettings().setNumClasses(sliderNumClasses.getValue());
            fldNumClasses.setText(("" + getModel().getSettings().getNumClasses()));
            getModel().updatePlot(true);
          }
        });

    numClassesPanel = new FlowPanel();
    numClassesPanel.add(sliderNumClasses);
    numClassesPanel.add(fldNumClasses);
  }
  /**
   * Page widgets.
   *
   * @param cellTree the cell tree
   */
  public void createPageView(CellTree cellTree) {
    this.cellTree = cellTree;
    mainPanel.setStyleName("div-wrapper"); // main div

    SimplePanel leftPanel = new SimplePanel();
    leftPanel.getElement().setId("leftPanel_SimplePanel");
    leftPanel.setStyleName("div-first bottomPadding10px"); // left side div which will  have tree

    SimplePanel rightPanel = new SimplePanel();
    rightPanel.getElement().setId("rightPanel_SimplePanel");
    rightPanel.setStyleName("div-second"); // right div having tree creation inputs.

    VerticalPanel treePanel = new VerticalPanel();
    treePanel.getElement().setId("treePanel_VerticalPanel");
    HorizontalPanel expandCollapse = new HorizontalPanel();
    expandCollapse.getElement().setId("expandCollapse_HorizontalPanel");
    expandCollapse.setStyleName("leftAndTopPadding");
    expandCollapse.setSize("100px", "20px");
    buttonExpand.setStylePrimaryName("expandAllButton");
    buttonCollapse.setStylePrimaryName("collapseAllButton");
    buttonExpand.setTitle("Expand All (Shift +)");
    buttonCollapse.setTitle("Collapse All (Shift -)");
    expandCollapse.add(buttonExpand);
    expandCollapse.add(buttonCollapse);
    buttonExpand.setFocus(true);
    buttonCollapse.setVisible(true);

    treePanel.add(expandCollapse);
    treePanel.add(cellTree);
    leftPanel.add(treePanel);

    SimplePanel bottomSavePanel = new SimplePanel();
    bottomSavePanel.getElement().setId("bottomSavePanel_SimplePanel");
    bottomSavePanel.setStyleName("div-first buttonPadding");
    VerticalPanel vp = new VerticalPanel();
    HorizontalPanel savePanel = new HorizontalPanel();
    savePanel.getElement().setId("savePanel_VerticalPanel");
    savePanel.add(new SpacerWidget());
    //		savePanel.add(errorMessageDisplay);
    vp.add(successMessageDisplay);
    //		saveBtn.setTitle("Ctrl+Alt+s");
    savePanel.add(saveBtn);
    validateBtn.setTitle("Validate");
    savePanel.add(validateBtn);
    vp.add(warningMessageDisplay);
    vp.add(savePanel);
    bottomSavePanel.add(vp);

    SimplePanel errPanel = new SimplePanel();
    errPanel.getElement().setId("errPanel_SimplePanel");
    errPanel.add(errorMessageDisplay);
    mainPanel.add(errPanel);
    mainPanel.add(leftPanel);
    mainPanel.add(rightPanel);
    mainPanel.add(bottomSavePanel);
    focusPanel.addKeyDownHandler(this);
    focusPanel.addFocusHandler(this);
    cellTreeHandlers();
  }
Exemplo n.º 27
0
 private Widget createDayContent(Date date) {
   FlowPanel panel = new FlowPanel();
   for (String info : calendar.getInfos(date)) {
     panel.add(Gwt.createDiv("DayListWidget-date-info", info));
   }
   panel.add(createEventList(date));
   return panel;
 }
 private void init() {
   FlowPanel p = new FlowPanel();
   p.add(new Label(category.getDisplayName()));
   p.add(scrollable);
   p.addStyleName("pagerWrapper");
   scrollable.addStyleName("pager");
   initWidget(p);
 }
Exemplo n.º 29
0
  public FacebookPage(final TabletEventBus eventBus) {
    this.eventBus = eventBus;
    setStyleName("bCommunityPage");
    // setSize("1024px", "600px");
    // setPopupPosition(0, 0);
    setWidth("700px");

    this.getElement().getStyle().setOpacity(0);
    setPopupPosition(336, 88);
    show();

    ImageButton btnProfile = new ImageButton(RES.cGames());
    ImageButton btnFriends = new ImageButton(RES.cFriends());
    ImageButton btnFacebook = new ImageButton(RES.cFacebook());
    ImageButton btnTwitter = new ImageButton(RES.cTwitter());

    btnProfile.addMouseDownHandler(
        new MouseDownHandler() {
          @Override
          public void onMouseDown(MouseDownEvent event) {
            doHide();
            eventBus.fireEvent(new ShowFacebookOptionEvent(ShowFacebookOptionEvent.Type.GAMES));
          }
        });
    btnFriends.addMouseDownHandler(
        new MouseDownHandler() {
          @Override
          public void onMouseDown(MouseDownEvent event) {
            doHide();
            eventBus.fireEvent(new ShowFacebookOptionEvent(ShowFacebookOptionEvent.Type.FRIENDS));
          }
        });
    btnFacebook.addMouseDownHandler(
        new MouseDownHandler() {
          @Override
          public void onMouseDown(MouseDownEvent event) {
            doHide();
            eventBus.fireEvent(new ShowFacebookOptionEvent(ShowFacebookOptionEvent.Type.NEWS_FEED));
          }
        });
    btnTwitter.addMouseDownHandler(
        new MouseDownHandler() {
          @Override
          public void onMouseDown(MouseDownEvent event) {
            doHide();
            eventBus.fireEvent(new ShowFacebookOptionEvent(ShowFacebookOptionEvent.Type.PROFILE));
          }
        });

    FlowPanel content = new FlowPanel();
    setWidget(content);

    content.add(btnProfile);
    content.add(btnFriends);
    content.add(btnFacebook);
    content.add(btnTwitter);
  }
 @Override
 public void setupContent(LayoutTemplate layoutTemplate) {
   container.clear();
   layoutEditorWidget.setup(container, layoutTemplate);
   for (LayoutRow row : layoutTemplate.getRows()) {
     container.add(createRowView(row));
   }
   container.add(createDropRowPanel());
 }