Exemple #1
0
    public CmdButton(String name, Widget icon, Command cmd, String label, String desc) {
      this.name = name;
      this.command = cmd;
      this.name = name;
      String htmlstr = label == null ? name : label;
      html = new HTML(htmlstr);
      if (desc != null) {
        html.setTitle(desc);
      }
      this.command = cmd;
      html.setWordWrap(false);
      if (command instanceof GeneralCommand) {
        addListeners();
        setButtonEnabled(((GeneralCommand) command).isEnabled());
      }

      GwtUtil.setStyles(iconHolderLeft, "padding", "none", "marginRight", "3px");
      GwtUtil.setStyle(html, "padding", "6px 0");
      container = GwtUtil.makeHoriPanel(null, null, iconHolderLeft, html, iconHolderRight);
      container.setCellVerticalAlignment(iconHolderLeft, VerticalPanel.ALIGN_MIDDLE);
      container.setCellVerticalAlignment(iconHolderRight, VerticalPanel.ALIGN_MIDDLE);
      setIconLeft(icon);
      setIconRight(null);
      GwtUtil.setStyle(container, "margin", "0px auto");
      initWidget(new SimplePanel(container));
    }
Exemple #2
0
 public void addButton(Button button, Align align, int idx, String width) {
   TTabBar tb =
       align == Align.LEFT ? leftToolbar : align == Align.CENTER ? centerToolbar : rightToolbar;
   idx = idx < 0 || idx > tb.getTabCount() ? tb.getTabCount() : idx;
   tb.insertTab(button.asWidget(), idx);
   TabBar.Tab t = tb.getTab(idx);
   tabs.put(button.getName(), new TabHolder(t, button, tb));
   width = StringUtils.isEmpty(width) ? defaultWidth : width;
   GwtUtil.setStyle(button.asWidget(), "minWidth", width);
 }
Exemple #3
0
 private void setButtonEnabled(boolean enabled) {
   GwtUtil.setStyle(html, "color", enabled ? "black" : "gray");
 }
Exemple #4
0
 public SearchSummaryPanel(String name, String shortDesc) {
   setName(name);
   setShortDesc(shortDesc);
   initWidget(mainPanel);
   GwtUtil.setStyle(this, "marginTop", "10px");
 }