Package com.extjs.gxt.ui.client.widget.toolbar

Examples of com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem


   
    // cancel
    createCancelToolbarButton(mb, "Cancel", contentSection.getSelectedItemsId());
   
    //
    mb.add(new SeparatorToolItem());
   
    // Selected paragraph
    Button selectionMenuHead = new Button("Selected Paragraph");
    Menu selectionMenu = new Menu();
    selectionMenuHead.setMenu(selectionMenu);
    mb.add(selectionMenuHead);
   
    Button getInformation = new Button("More Information");
    getInformation.setIconStyle("icon-menu-information");
    getInformation.addSelectionListener(new SelectionListener<ButtonEvent>(){

      @Override
      public void componentSelected(ButtonEvent ce) {
        String id = tcSection.getSelectedItemsId();
        if(null == id)
          Window.alert("Please select item");
        else
          Commands.getInstance().getInformationOn(id, ClientUtils.DERIVED);
      }
    });
    selectionMenu.add(getInformation);
   
    selectionMenu.add(new SeparatorMenuItem());
   
    Button createLink = new Button("Create Link");
    createLink.addSelectionListener(new SelectionListener<ButtonEvent>(){

      @Override
      public void componentSelected(ButtonEvent ce) {
        try{
          LinkableItem linkItem = tcSection.getLinkableItem();
          Commands.getInstance().createLink(contentSection.getSelectedItemsId(),linkItem );
        } catch(IllegalStateException e){
          Window.alert("Please select item");
        }
      }
    });
    selectionMenu.add(createLink);
   
    //
    mb.add(new SeparatorToolItem());
   
    // Navigation
    createNavigateInSectionMenu(mb, ClientState.getCurrentlyDerivedFile(), ClientState.selectedSectionDerived, new CommandCallback<Section>(){
        public void cc_callback(Section value) {
          // display section in master panel
View Full Code Here


    displayText = new Label();
    displayText.setStyleName("my-paging-display");

    toolBar.add(first);
    toolBar.add(prev);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(new AdapterToolItem(beforePage));
    toolBar.add(new AdapterToolItem(pageText));
    toolBar.add(new AdapterToolItem(afterText));
    toolBar.add(new SeparatorToolItem());
    toolBar.add(next);
    toolBar.add(last);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(refresh);

    for (ToolItem item : items) {
      toolBar.add(item);
    }
View Full Code Here

        }
      });
      ComponentHelper.setParent(this, tb);
      if (sourceEditMode) {
        tb.add(sourceEdit = createToggleButton(g.getSource(), m.getSourceEditTipText(), m.getSourceEditTipTitle()));
        tb.add(new SeparatorToolItem());
      }

      if (getBasicFormatter() != null) {
        if (enableFont) {
          final ListBox fonts = new ListBox();
          fonts.addItem("");
          fonts.addItem("Arial");
          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) {
                getBasicFormatter().setFontName(fonts.getItemText(index));
              }
              fonts.setItemSelected(0, true);
            }
          });

          tb.add(new WidgetComponent(fonts));
          tb.add(new SeparatorToolItem());
        }
        if (enableFontSize) {
          tb.add(increasefontsize = createButton(g.getFontIncrease(), m.getIncreaseFontSizeTipText(),
              m.getIncreaseFontSizeTipTitle()));
          tb.add(decreasefontsize = createButton(g.getFontDecrease(), m.getDecreaseFontSizeTipText(),
              m.getDecreaseFontSizeTipTitle()));

          tb.add(new SeparatorToolItem());
        }
        if (enableFormat) {
          tb.add(bold = createToggleButton(g.getBold(), m.getBoldTipText(), m.getBoldTipTitle()));
          tb.add(italic = createToggleButton(g.getItalic(), m.getItalicTipText(), m.getItalicTipTitle()));
          tb.add(underline = createToggleButton(g.getUnderline(), m.getUnderlineTipText(), m.getUnderlineTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableAlignments) {
          tb.add(justifyLeft = createButton(g.getJustifyLeft(), m.getJustifyLeftTipText(), m.getJustifyLeftTipTitle()));
          tb.add(justifyCenter = createButton(g.getJustifyCenter(), m.getJustifyCenterTipText(),
              m.getJustifyCenterTipTitle()));
          tb.add(justifyRight = createButton(g.getJustifyRight(), m.getJustifyRightTipText(),
              m.getJustifyRightTipTitle()));
          tb.add(new SeparatorToolItem());
        }
      }

      if (getExtendedFormatter() != null) {
        if (enableLists) {
          tb.add(ol = createButton(g.getOl(), m.getOlTipText(), m.getOlTipTitle()));
          tb.add(ul = createButton(g.getUl(), m.getUlTipText(), m.getUlTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableLinks) {
          tb.add(link = createButton(g.getLink(), m.getLinkTipText(), m.getLinkTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableColors) {
          tb.add(forecolor = createColorButton(g.getFontColor(), m.getForeColorTipText(), m.getForColorTipTitle(),
              new Listener<ComponentEvent>() {
                public void handleEvent(ComponentEvent be) {
View Full Code Here

      toolbar = new ToolBar();
      if (sourceEditMode) {
        toolbar.add(sourceEdit = createToggleButton(getImages().getSource(), getMessages().getSourceEditTipText(),
            getMessages().getSourceEditTipTitle()));
        toolbar.add(new SeparatorToolItem());
      }

      if (getBasicFormatter() != null) {
        if (enableFont) {

          final ListBox listBox = new ListBox();
          listBox.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent event) {
              ListBox listBox = (ListBox) event.getSource();
              getBasicFormatter().setFontName(listBox.getValue(listBox.getSelectedIndex()));
            }
          });
          listBox.addItem("Arial");

          listBox.addItem("Times New Roman");
          listBox.addItem("Verdana");

          toolbar.add(new WidgetComponent(listBox));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableFontSize) {
          toolbar.add(increasefontsize = createButton(getImages().getFontIncrease(),
              getMessages().getIncreaseFontSizeTipText(), getMessages().getIncreaseFontSizeTipTitle()));
          toolbar.add(decreasefontsize = createButton(getImages().getFontDecrease(),
              getMessages().getDecreaseFontSizeTipText(), getMessages().getDecreaseFontSizeTipTitle()));

          toolbar.add(new SeparatorToolItem());
        }
        if (enableFormat) {
          toolbar.add(bold = createToggleButton(getImages().getBold(), getMessages().getBoldTipText(),
              getMessages().getBackColorTipTitle()));
          toolbar.add(italic = createToggleButton(getImages().getItalic(), getMessages().getItalicTipText(),
              getMessages().getItalicTipTitle()));
          toolbar.add(underline = createToggleButton(getImages().getUnderline(), getMessages().getUnderlineTipText(),
              getMessages().getUnderlineTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableAlignments) {
          toolbar.add(justifyLeft = createButton(getImages().getJustifyLeft(), getMessages().getJustifyLeftTipText(),
              getMessages().getJustifyLeftTipTitle()));
          toolbar.add(justifyCenter = createButton(getImages().getJustifyCenter(),
              getMessages().getJustifyCenterTipText(), getMessages().getJustifyCenterTipTitle()));
          toolbar.add(justifyRight = createButton(getImages().getJustifyRight(),
              getMessages().getJustifyRightTipText(), getMessages().getJustifyRightTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
      }

      if (getExtendedFormatter() != null) {
        if (enableLists) {
          toolbar.add(ol = createButton(getImages().getOl(), getMessages().getOlTipText(),
              getMessages().getOlTipTitle()));
          toolbar.add(ul = createButton(getImages().getUl(), getMessages().getUlTipText(),
              getMessages().getUlTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableLinks) {
          toolbar.add(link = createButton(getImages().getLink(), getMessages().getLinkTipText(),
              getMessages().getLinkTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableColors) {
          toolbar.add(forecolor = createColorButton(getImages().getFontColor(), getMessages().getForeColorTipText(),
              getMessages().getForColorTipTitle(), new Listener<ComponentEvent>() {
                public void handleEvent(ComponentEvent be) {
View Full Code Here

        }
      });
      ComponentHelper.setParent(this, tb);
      if (sourceEditMode) {
        tb.add(sourceEdit = createToggleButton(g.getSource(), m.getSourceEditTipText(), m.getSourceEditTipTitle()));
        tb.add(new SeparatorToolItem());
      }

      if (getBasicFormatter() != null) {
        if (enableFont) {
          final ListBox fonts = new ListBox();
          fonts.addItem("");
          fonts.addItem("Arial");
          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) {
                getBasicFormatter().setFontName(fonts.getItemText(index));
              }
              fonts.setItemSelected(0, true);
            }
          });

          tb.add(new WidgetComponent(fonts));
          tb.add(new SeparatorToolItem());
        }
        if (enableFontSize) {
          tb.add(increasefontsize = createButton(g.getFontIncrease(), m.getIncreaseFontSizeTipText(),
              m.getIncreaseFontSizeTipTitle()));
          tb.add(decreasefontsize = createButton(g.getFontDecrease(), m.getDecreaseFontSizeTipText(),
              m.getDecreaseFontSizeTipTitle()));

          tb.add(new SeparatorToolItem());
        }
        if (enableFormat) {
          tb.add(bold = createToggleButton(g.getBold(), m.getBoldTipText(), m.getBoldTipTitle()));
          tb.add(italic = createToggleButton(g.getItalic(), m.getItalicTipText(), m.getItalicTipTitle()));
          tb.add(underline = createToggleButton(g.getUnderline(), m.getUnderlineTipText(), m.getUnderlineTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableAlignments) {
          tb.add(justifyLeft = createButton(g.getJustifyLeft(), m.getJustifyLeftTipText(), m.getJustifyLeftTipTitle()));
          tb.add(justifyCenter = createButton(g.getJustifyCenter(), m.getJustifyCenterTipText(),
              m.getJustifyCenterTipTitle()));
          tb.add(justifyRight = createButton(g.getJustifyRight(), m.getJustifyRightTipText(),
              m.getJustifyRightTipTitle()));
          tb.add(new SeparatorToolItem());
        }
      }

      if (getExtendedFormatter() != null) {
        if (enableLists) {
          tb.add(ol = createButton(g.getOl(), m.getOlTipText(), m.getOlTipTitle()));
          tb.add(ul = createButton(g.getUl(), m.getUlTipText(), m.getUlTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableLinks) {
          tb.add(link = createButton(g.getLink(), m.getLinkTipText(), m.getLinkTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableColors) {
          tb.add(forecolor = createColorButton(g.getFontColor(), m.getForeColorTipText(), m.getForColorTipTitle(),
              new Listener<ComponentEvent>() {
                public void handleEvent(ComponentEvent be) {
View Full Code Here

        }
      });
      ComponentHelper.setParent(this, tb);
      if (sourceEditMode) {
        tb.add(sourceEdit = createToggleButton(g.getSource(), m.getSourceEditTipText(), m.getSourceEditTipTitle()));
        tb.add(new SeparatorToolItem());
      }

      if (getBasicFormatter() != null) {
        if (enableFont) {
          final ListBox fonts = new ListBox();
          fonts.addItem("");
          fonts.addItem("Arial");
          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) {
                getBasicFormatter().setFontName(fonts.getItemText(index));
              }
              fonts.setItemSelected(0, true);
            }
          });

          tb.add(new WidgetComponent(fonts));
          tb.add(new SeparatorToolItem());
        }
        if (enableFontSize) {
          tb.add(increasefontsize = createButton(g.getFontIncrease(), m.getIncreaseFontSizeTipText(),
              m.getIncreaseFontSizeTipTitle()));
          tb.add(decreasefontsize = createButton(g.getFontDecrease(), m.getDecreaseFontSizeTipText(),
              m.getDecreaseFontSizeTipTitle()));

          tb.add(new SeparatorToolItem());
        }
        if (enableFormat) {
          tb.add(bold = createToggleButton(g.getBold(), m.getBoldTipText(), m.getBoldTipTitle()));
          tb.add(italic = createToggleButton(g.getItalic(), m.getItalicTipText(), m.getItalicTipTitle()));
          tb.add(underline = createToggleButton(g.getUnderline(), m.getUnderlineTipText(), m.getUnderlineTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableAlignments) {
          tb.add(justifyLeft = createButton(g.getJustifyLeft(), m.getJustifyLeftTipText(), m.getJustifyLeftTipTitle()));
          tb.add(justifyCenter = createButton(g.getJustifyCenter(), m.getJustifyCenterTipText(),
              m.getJustifyCenterTipTitle()));
          tb.add(justifyRight = createButton(g.getJustifyRight(), m.getJustifyRightTipText(),
              m.getJustifyRightTipTitle()));
          tb.add(new SeparatorToolItem());
        }
      }

      if (getExtendedFormatter() != null) {
        if (enableLists) {
          tb.add(ol = createButton(g.getOl(), m.getOlTipText(), m.getOlTipTitle()));
          tb.add(ul = createButton(g.getUl(), m.getUlTipText(), m.getUlTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableLinks) {
          tb.add(link = createButton(g.getLink(), m.getLinkTipText(), m.getLinkTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableColors) {
          tb.add(forecolor = createColorButton(g.getFontColor(), m.getForeColorTipText(), m.getForColorTipTitle(),
              new Listener<ComponentEvent>() {
                public void handleEvent(ComponentEvent be) {
View Full Code Here

        }
      });
      ComponentHelper.setParent(this, tb);
      if (sourceEditMode) {
        tb.add(sourceEdit = createToggleButton(g.getSource(), m.getSourceEditTipText(), m.getSourceEditTipTitle()));
        tb.add(new SeparatorToolItem());
      }

      if (getBasicFormatter() != null) {
        if (enableFont) {
          final ListBox fonts = new ListBox();
          fonts.addItem("");
          fonts.addItem("Arial");
          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) {
                getBasicFormatter().setFontName(fonts.getItemText(index));
              }
              fonts.setItemSelected(0, true);
            }
          });

          tb.add(new WidgetComponent(fonts));
          tb.add(new SeparatorToolItem());
        }
        if (enableFontSize) {
          tb.add(increasefontsize = createButton(g.getFontIncrease(), m.getIncreaseFontSizeTipText(),
              m.getIncreaseFontSizeTipTitle()));
          tb.add(decreasefontsize = createButton(g.getFontDecrease(), m.getDecreaseFontSizeTipText(),
              m.getDecreaseFontSizeTipTitle()));

          tb.add(new SeparatorToolItem());
        }
        if (enableFormat) {
          tb.add(bold = createToggleButton(g.getBold(), m.getBoldTipText(), m.getBoldTipTitle()));
          tb.add(italic = createToggleButton(g.getItalic(), m.getItalicTipText(), m.getItalicTipTitle()));
          tb.add(underline = createToggleButton(g.getUnderline(), m.getUnderlineTipText(), m.getUnderlineTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableAlignments) {
          tb.add(justifyLeft = createButton(g.getJustifyLeft(), m.getJustifyLeftTipText(), m.getJustifyLeftTipTitle()));
          tb.add(justifyCenter = createButton(g.getJustifyCenter(), m.getJustifyCenterTipText(),
              m.getJustifyCenterTipTitle()));
          tb.add(justifyRight = createButton(g.getJustifyRight(), m.getJustifyRightTipText(),
              m.getJustifyRightTipTitle()));
          tb.add(new SeparatorToolItem());
        }
      }

      if (getExtendedFormatter() != null) {
        if (enableLists) {
          tb.add(ol = createButton(g.getOl(), m.getOlTipText(), m.getOlTipTitle()));
          tb.add(ul = createButton(g.getUl(), m.getUlTipText(), m.getUlTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableLinks) {
          tb.add(link = createButton(g.getLink(), m.getLinkTipText(), m.getLinkTipTitle()));
          tb.add(new SeparatorToolItem());
        }
        if (enableColors) {
          tb.add(forecolor = createColorButton(g.getFontColor(), m.getForeColorTipText(), m.getForColorTipTitle(),
              new Listener<ComponentEvent>() {
                public void handleEvent(ComponentEvent be) {
View Full Code Here

    displayText = new Label();
    displayText.setStyleName("my-paging-display");

    toolBar.add(first);
    toolBar.add(prev);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(new AdapterToolItem(beforePage));
    toolBar.add(new AdapterToolItem(pageText));
    toolBar.add(new AdapterToolItem(afterText));
    toolBar.add(new SeparatorToolItem());
    toolBar.add(next);
    toolBar.add(last);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(refresh);
    toolBar.add(new FillToolItem());
    toolBar.add(new AdapterToolItem(displayText));

    toolBar.render(target, index);
View Full Code Here

    displayText = new Label();
    displayText.setStyleName("my-paging-display");

    toolBar.add(first);
    toolBar.add(prev);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(new AdapterToolItem(beforePage));
    toolBar.add(new AdapterToolItem(pageText));
    toolBar.add(new AdapterToolItem(afterText));
    toolBar.add(new SeparatorToolItem());
    toolBar.add(next);
    toolBar.add(last);
    toolBar.add(new SeparatorToolItem());
    toolBar.add(refresh);
   
    for (ToolItem item : items) {
      toolBar.add(item);
    }
View Full Code Here

      toolbar = new ToolBar();
      if (sourceEditMode) {
        toolbar.add(sourceEdit = createToggleButton(getImages().getSource(), getMessages().getSourceEditTipText(),
            getMessages().getSourceEditTipTitle()));
        toolbar.add(new SeparatorToolItem());
      }

      if (getBasicFormatter() != null) {
        if (enableFont) {
          SimpleComboBox<String> scbf = new SimpleComboBox<String>();
          scbf.setTabIndex(-1);
          scbf.add("Arial");
          scbf.add("Times New Roman");
          scbf.add("Verdana");
          scbf.setEditable(false);
          scbf.addListener(Events.Select, new Listener<FieldEvent>() {
            @SuppressWarnings("unchecked")
            public void handleEvent(FieldEvent be) {
              SimpleComboBox<String> field = (SimpleComboBox<String>) be.getField();
              getBasicFormatter().setFontName(field.getSimpleValue());
            }
          });
          toolbar.add(scbf);
          toolbar.add(new SeparatorToolItem());
        }
        if (enableFontSize) {
          toolbar.add(increasefontsize = createButton(getImages().getFontIncrease(),
              getMessages().getIncreaseFontSizeTipText(), getMessages().getIncreaseFontSizeTipTitle()));
          toolbar.add(decreasefontsize = createButton(getImages().getFontDecrease(),
              getMessages().getDecreaseFontSizeTipText(), getMessages().getDecreaseFontSizeTipTitle()));

          toolbar.add(new SeparatorToolItem());
        }
        if (enableFormat) {
          toolbar.add(bold = createToggleButton(getImages().getBold(), getMessages().getBoldTipText(),
              getMessages().getBackColorTipTitle()));
          toolbar.add(italic = createToggleButton(getImages().getItalic(), getMessages().getItalicTipText(),
              getMessages().getItalicTipTitle()));
          toolbar.add(underline = createToggleButton(getImages().getUnderline(), getMessages().getUnderlineTipText(),
              getMessages().getUnderlineTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableAlignments) {
          toolbar.add(justifyLeft = createButton(getImages().getJustifyLeft(), getMessages().getJustifyLeftTipText(),
              getMessages().getJustifyLeftTipTitle()));
          toolbar.add(justifyCenter = createButton(getImages().getJustifyCenter(),
              getMessages().getJustifyCenterTipText(), getMessages().getJustifyCenterTipTitle()));
          toolbar.add(justifyRight = createButton(getImages().getJustifyRight(),
              getMessages().getJustifyRightTipText(), getMessages().getJustifyRightTipTitle()));
        }
      }

      if (getExtendedFormatter() != null) {
        if (enableLists) {
          toolbar.add(new SeparatorToolItem());
          toolbar.add(ol = createButton(getImages().getOl(), getMessages().getOlTipText(),
              getMessages().getOlTipTitle()));
          toolbar.add(ul = createButton(getImages().getUl(), getMessages().getUlTipText(),
              getMessages().getUlTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableLinks) {
          toolbar.add(link = createButton(getImages().getLink(), getMessages().getLinkTipText(),
              getMessages().getLinkTipTitle()));
          toolbar.add(new SeparatorToolItem());
        }
        if (enableColors) {
          toolbar.add(forecolor = createColorButton(getImages().getFontColor(), getMessages().getForeColorTipText(),
              getMessages().getForColorTipTitle(), new Listener<ComponentEvent>() {
                public void handleEvent(ComponentEvent be) {
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem

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.