Package com.sencha.gxt.widget.core.client.button

Examples of com.sencha.gxt.widget.core.client.button.ToggleButton


      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());
      ColorMenu menu = new ColorMenu();
      menu.getPalette().addValueChangeHandler(new ValueChangeHandler<String>() {

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

      toolBar.add(fontColor);

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

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

      toolBar.add(fontHighlight);
    }

    if (sourceEditMode) {
      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) {
View Full Code Here


        }
      }

      menu.add(new SeparatorMenuItem());
    } else if (w instanceof ToggleButton) {
      final ToggleButton b = (ToggleButton) w;

      final CheckMenuItem item = new CheckMenuItem(b.getText());
      item.setItemId(b.getItemId());
      item.setChecked(b.getValue());

      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }

      item.setEnabled(b.isEnabled());

      item.addCheckChangeHandler(new CheckChangeHandler<CheckMenuItem>() {

        @Override
        public void onCheckChange(CheckChangeEvent<CheckMenuItem> event) {
          // must pass true to cause value change event to fire
          b.setValue(event.getItem().isChecked(), true);
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
View Full Code Here

      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) {
View Full Code Here

        }
      }

      menu.add(new SeparatorMenuItem());
    } else if (w instanceof ToggleButton) {
      final ToggleButton b = (ToggleButton)w;
     
      final CheckMenuItem item = new CheckMenuItem(b.getText());
      item.setItemId(b.getItemId());
      item.setChecked(b.getValue());
     
      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }

      item.setEnabled(b.isEnabled());
     
      item.addCheckChangeHandler(new CheckChangeHandler<CheckMenuItem>() {

        @Override
        public void onCheckChange(CheckChangeEvent<CheckMenuItem> event) {
          b.setValue(event.getItem().isChecked());
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
     
View Full Code Here

        panel.setBodyStyleName("white-bg");

        try {
          chart = ChartFactory.getChart(dsConfig,result,ChartType.VERTICAL_BAR);

          final ToggleButton toggleLive = new ToggleButton("Live");
          toggleLive.setValue(true,false);
//          toggleLive.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
//           
//            public void onValueChange(ValueChangeEvent<Boolean> event) {
//              if (event.getValue()) {
//                enableLive();
//              } else {
//                disableLive();
//              }
//             
//            }
//          });
          toggleLive.addSelectHandler(new SelectHandler() {
            public void onSelect(SelectEvent event) {             
              if (pushListener == null){
                enableLive();
                toggleLive.setValue(true, false, true);
              } else {
                disableLive();
                toggleLive.setValue(false, false, true);
              }
            }
          });

//          final ComboBox<LineSeries<TimeSeriesDataVO>> box = new ComboBox<LineSeries<TimeSeriesDataVO>>(fieldStore,
View Full Code Here

   
   
    allBtnContainer.setVBoxLayoutAlign(VBoxLayoutAlign.STRETCH);
    BoxLayoutData vBoxData = new BoxLayoutData(new Margins(5, 5, 5, 5));
    ToggleGroup tg=new ToggleGroup();
    ToggleButton runningTrend=new ToggleButton("每日失败任务趋势");
    runningTrend.setAllowDepress(false);
    runningTrend.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
      private RunningJobTrend trend=new RunningJobTrend();
      public void onValueChange(ValueChangeEvent<Boolean> event) {
        if(event.getValue()){
          if(allChartContainer.getWidgetIndex(trend)==-1){
            allChartContainer.add(trend);
          }
          allChartContainer.setActiveWidget(trend);
        }
      }
    });
    ToggleButton ownerTrend=new ToggleButton("负责人失败任务趋势");
    ownerTrend.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
      private OwnerJobTrend trend=new OwnerJobTrend();
      public void onValueChange(ValueChangeEvent<Boolean> event) {
        if(event.getValue()){
          if(allChartContainer.getWidgetIndex(trend)==-1){
            allChartContainer.add(trend);
          }
          allChartContainer.setActiveWidget(trend);
        }
      }
    });
    ownerTrend.setAllowDepress(false);
    tg.add(runningTrend);
    tg.add(ownerTrend);
    allBtnContainer.add(runningTrend,vBoxData);
    allBtnContainer.add(ownerTrend,vBoxData);
    allContainer.setWestWidget(allBtnContainer,new BorderLayoutData(300));
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.button.ToggleButton

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.