Package com.sencha.gxt.widget.core.client.event.SelectEvent

Examples of com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler


    this.appearance = appearance;
    this.pageSize = pageSize;

    first = new TextButton();
    first.setIcon(appearance.first());
    first.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        first();
      }
    });

    prev = new TextButton();
    prev.setIcon(appearance.prev());
    prev.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        previous();
      }
    });

    next = new TextButton();
    next.setIcon(appearance.next());
    next.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        next();
      }
    });

    last = new TextButton();
    last.setIcon(appearance.last());
    last.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        last();
      }
    });

    refresh = new TextButton();
    refresh.setIcon(appearance.refresh());
    refresh.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        refresh();
      }
View Full Code Here


   * @return the collapse button or null if field set not collapsible
   */
  public ToolButton getCollapseButton() {
    if (collapseButton == null) {
      collapseButton = new ToolButton(ToolButton.UP);
      collapseButton.addSelectHandler(new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          setExpanded(!isExpanded());
        }
View Full Code Here

    this.closable = closable;
    appearance.getToolsElement(getElement()).removeChildren();
    if (closable) {
      if (close == null) {
        close = new ToolButton(ToolButton.CLOSE);
        close.addSelectHandler(new SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
            hide();
          }
        });
View Full Code Here

  protected void initTools() {
    super.initTools();

    if (minimizable) {
      minBtn = new ToolButton(ToolButton.MINIMIZE);
      minBtn.addSelectHandler(new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          minimize();
        }
      });
      header.addTool(minBtn);
    }

    if (maximizable) {
      maxBtn = new ToolButton(ToolButton.MAXIMIZE);
      maxBtn.addSelectHandler(new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          maximize();
        }
      });
      header.addTool(maxBtn);

      restoreBtn = new ToolButton(ToolButton.RESTORE);
      restoreBtn.setVisible(false);
      restoreBtn.addSelectHandler(new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          restore();
        }
      });
      header.addTool(restoreBtn);
    }

    if (closable) {
      closeBtn = new ToolButton(ToolButton.CLOSE);
      closeBtn.addSelectHandler(new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          hide();
        }
View Full Code Here

    buttonBar.getElement().getStyle().setProperty("margin", "7px");
    buttonBar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    up = new IconButton(appearance.up());
    up.setToolTip(getMessages().moveUp());
    up.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        onUp();
      }
    });

    allRight = new IconButton(appearance.allRight());
    allRight.setToolTip(getMessages().addAll());
    allRight.addSelectHandler(new SelectHandler() {
      @Override
      public void onSelect(SelectEvent event) {
        onAllRight();
      }
    });

    right = new IconButton(appearance.right());
    right.setToolTip(getMessages().addSelected());
    right.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        onRight();
      }
    });

    left = new IconButton(appearance.left());
    left.setToolTip(getMessages().removeSelected());
    left.addSelectHandler(new SelectHandler() {
      @Override
      public void onSelect(SelectEvent event) {
        onLeft();
      }
    });

    allLeft = new IconButton(appearance.allLeft());
    allLeft.setToolTip(getMessages().removeAll());
    allLeft.addSelectHandler(new SelectHandler() {
      @Override
      public void onSelect(SelectEvent event) {
        onAllLeft();
      }
    });

    down = new IconButton(appearance.down());
    down.setToolTip(getMessages().moveDown());
    down.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        onDown();
      }
View Full Code Here

  protected void initToolBar() {
    if (!showToolBar) {
      return;
    }

    buttonHandler = new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        Widget button = (Widget) event.getSource();

        if (button == fontIncrease) {
          int i = fontSizesConstants.indexOf(activeFontSize);
          if (i < (fontSizesConstants.size() - 1)) {
            i++;
            activeFontSize = fontSizesConstants.get(i);
            textArea.getFormatter().setFontSize(activeFontSize);
          } else {
            // brings focus back to the editor
            focus();
          }
        } else if (button == fontDecrease) {
          int i = fontSizesConstants.indexOf(activeFontSize);
          if (i > 0) {
            i--;
            activeFontSize = fontSizesConstants.get(i);
            textArea.getFormatter().setFontSize(activeFontSize);
          } else {
            // brings focus back to the editor
            focus();
          }
        } else if (button == bold) {
          textArea.getFormatter().toggleBold();
        } else if (button == italic) {
          textArea.getFormatter().toggleItalic();
        } else if (button == underline) {
          textArea.getFormatter().toggleUnderline();
        } else if (button == justifyLeft) {
          textArea.getFormatter().setJustification(Justification.LEFT);
        } else if (button == justifyCenter) {
          textArea.getFormatter().setJustification(Justification.CENTER);
        } else if (button == justifyRight) {
          textArea.getFormatter().setJustification(Justification.RIGHT);
        } else if (button == ol) {
          textArea.getFormatter().insertOrderedList();
        } else if (button == ul) {
          textArea.getFormatter().insertUnorderedList();
        } else if (button == link) {
          String link = Window.prompt(getMessages().createLinkText(), "http://");
          if (link != null && link.length() > 0) {
            textArea.getFormatter().createLink(link);
          } else {
            textArea.getFormatter().removeLink();
          }
        }
      }
    };

    HtmlEditorMessages m = getMessages();

    if (enableFont) {
      final ListBox fonts = new ListBox();
      fonts.addItem("Arial");
      fonts.addItem("Courier New");
      fonts.addItem("Times New Roman");
      fonts.addItem("Verdana");
      fonts.setItemSelected(0, true);

      fonts.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
          int index = fonts.getSelectedIndex();
          if (index != 0) {
            textArea.getFormatter().setFontName(fonts.getItemText(index));
          }
        }
      });

      toolBar.add(fonts);
      toolBar.add(new SeparatorToolItem());
    }

    if (enableFontSize) {
      fontIncrease = new TextButton();
      configureButton(fontIncrease, appearance.fontIncrease(), m.increaseFontSizeTipTitle(),
          m.increaseFontSizeTipText());
      fontIncrease.addSelectHandler(buttonHandler);
      toolBar.add(fontIncrease);

      fontDecrease = new TextButton();
      configureButton(fontDecrease, appearance.fontDecrease(), m.decreaseFontSizeTipTitle(),
          m.decreaseFontSizeTipText());
      fontDecrease.addSelectHandler(buttonHandler);
      toolBar.add(fontDecrease);

      toolBar.add(new SeparatorToolItem());
    }

    if (enableFormat) {
      bold = new ToggleButton();
      configureButton(bold, appearance.bold(), m.boldTipTitle(), m.boldTipText());
      bold.addSelectHandler(buttonHandler);
      toolBar.add(bold);

      italic = new ToggleButton();
      configureButton(italic, appearance.italic(), m.italicTipTitle(), m.italicTipText());
      italic.addSelectHandler(buttonHandler);
      toolBar.add(italic);

      underline = new ToggleButton();
      configureButton(underline, appearance.underline(), m.underlineTipTitle(), m.underlineTipText());
      underline.addSelectHandler(buttonHandler);
      toolBar.add(underline);

      toolBar.add(new SeparatorToolItem());
    }

    if (enableAlignments) {
      justifyLeft = new TextButton();
      configureButton(justifyLeft, appearance.justifyLeft(), m.justifyLeftTipTitle(), m.justifyLeftTipText());
      justifyLeft.addSelectHandler(buttonHandler);
      toolBar.add(justifyLeft);

      justifyCenter = new TextButton();
      configureButton(justifyCenter, appearance.justifyCenter(), m.justifyCenterTipTitle(), m.justifyCenterTipText());
      justifyCenter.addSelectHandler(buttonHandler);
      toolBar.add(justifyCenter);

      justifyRight = new TextButton();
      configureButton(justifyRight, appearance.justifyRight(), m.justifyRightTipTitle(), m.justifyRightTipText());
      justifyRight.addSelectHandler(buttonHandler);
      toolBar.add(justifyRight);

      toolBar.add(new SeparatorToolItem());
    }

    if (enableLists) {
      ol = new TextButton();
      configureButton(ol, appearance.ol(), m.olTipTitle(), m.olTipText());
      ol.addSelectHandler(buttonHandler);
      toolBar.add(ol);

      ul = new TextButton();
      configureButton(ul, appearance.ul(), m.ulTipTitle(), m.ulTipText());
      ul.addSelectHandler(buttonHandler);
      toolBar.add(ul);

      toolBar.add(new SeparatorToolItem());
    }

    if (enableLinks) {
      link = new TextButton();
      configureButton(link, appearance.link(), m.linkTipTitle(), m.linkTipText());
      link.addSelectHandler(buttonHandler);
      toolBar.add(link);

      toolBar.add(new SeparatorToolItem());
    }

    if (enableColors) {
      fontColor = new TextButton();
      configureButton(fontColor, appearance.fontColor(), m.foreColorTipTitle(), m.foreColorTipText());
      final ColorMenu fontColorMenu = new ColorMenu();
      fontColorMenu.setFocusOnShow(false);
      fontColorMenu.getPalette().addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
          fontColorMenu.hide();
          textArea.getFormatter().setForeColor(event.getValue());
        }
      });

      fontColor.setMenu(fontColorMenu);

      toolBar.add(fontColor);

      fontHighlight = new TextButton();
      configureButton(fontHighlight, appearance.fontHighlight(), m.backColorTipTitle(), m.backColorTipText());

      final ColorMenu fontHighlightMenu = new ColorMenu();
      fontHighlightMenu.setFocusOnShow(false);
      fontHighlightMenu.getPalette().addValueChangeHandler(new ValueChangeHandler<String>() {
        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
          fontHighlightMenu.hide();
          textArea.getFormatter().setBackColor(event.getValue());
        }
      });
      fontHighlight.setMenu(fontHighlightMenu);

      toolBar.add(fontHighlight);
    }

    if (enableSourceEditMode) {
      toolBar.add(new SeparatorToolItem());
      sourceEdit = new ToggleButton();
      configureButton(sourceEdit, appearance.source(), m.sourceEditTipTitle(), m.sourceEditTipText());

      sourceEdit.addSelectHandler(new SelectHandler() {
        @Override
        public void onSelect(SelectEvent event) {
          toggleSourceEditMode();
        }
      });
View Full Code Here

    setAllowTextSelection(false);

    setStartDay(constants.firstDayOfTheWeek());

    todayBtn = new TextButton(getMessages().todayText());
    todayBtn.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        selectToday();
      }
    });

    todayBtn.setToolTip(getMessages().todayTip(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).format(new Date())));

    getElement().selectNode(appearance.todayButtonSelector()).appendChild(todayBtn.getElement());

    monthPickerOkButton = new TextButton(getMessages().okText());
    monthPickerOkButton.addSelectHandler(new SelectHandler() {
      @Override
      public void onSelect(SelectEvent event) {
        DateWrapper d = new DateWrapper(mpSelYear, mpSelMonth, 1);
        update(d);
        hideMonthPicker();
      }
    });

    monthPickerCancelButton = new TextButton(getMessages().cancelText());
    monthPickerCancelButton.addSelectHandler(new SelectHandler() {
      @Override
      public void onSelect(SelectEvent event) {
        hideMonthPicker();
      }
    });
View Full Code Here

   * @return the collapse button or null if field set not collapsible
   */
  public ToolButton getCollapseButton() {
    if (collapseButton == null) {
      collapseButton = new ToolButton(ToolButton.UP);
      collapseButton.addSelectHandler(new SelectHandler() {

        @Override
        public void onSelect(SelectEvent event) {
          setExpanded(!isExpanded());
        }
View Full Code Here

    this.closable = closable;
    appearance.getToolsElement(getElement()).removeChildren();
    if (closable) {
      if (close == null) {
        close = new ToolButton(ToolButton.CLOSE);
        close.addSelectHandler(new SelectHandler() {
          @Override
          public void onSelect(SelectEvent event) {
            hide();
          }
        });
View Full Code Here

    this.appearance = appearance;
    this.pageSize = pageSize;

    first = new TextButton();
    first.setIcon(appearance.first());
    first.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        first();
      }
    });

    prev = new TextButton();
    prev.setIcon(appearance.prev());
    prev.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        previous();
      }
    });

    next = new TextButton();
    next.setIcon(appearance.next());
    next.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        next();
      }
    });

    last = new TextButton();
    last.setIcon(appearance.last());
    last.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        last();
      }
    });

    refresh = new TextButton();
    refresh.setIcon(appearance.refresh());
    refresh.addSelectHandler(new SelectHandler() {

      @Override
      public void onSelect(SelectEvent event) {
        refresh();
      }
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler

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.