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

Examples of com.sencha.gxt.widget.core.client.FramedPanel


  }
  public void debug(String msg) {
    debugLog.setText(msg + "\n" + debugLog.getText());
  }
  public Widget asWidget() {
    final ContentPanel panel = new FramedPanel();
    panel.setCollapsible(true);
    new Resizable(panel);

    panel.getElement().getStyle().setMargin(2, Unit.PX);
    // set a header of the panel
    panel.setHeadingText("Debug Messages");
    panel.setBodyBorder(true);
    panel.setBodyStyleName("white-bg");
    debugLog.setVisibleLines(10);
    debugLog.setWidth("100%");
    debugLog.setHeight("10%");
    // debugLog.setVisibleLines(40);
    debugLog.setReadOnly(true);
    ScrollPanel debugScrollable = new ScrollPanel(debugLog);
    panel.add(debugScrollable);
    return debugScrollable;
  }
View Full Code Here


    this.width = width;
    this.height = height;
    flexTable = createInfoTable(dsConfig.getPublisherID(), dsConfig.getDsName(), dsConfig.getDsTimeoutInterval());
  }
  private Widget createChart(final DataSourceConfiguration dsConfig, final int width, final int height) {
    final ContentPanel panel = new FramedPanel();
    dashboardService.getDataUpdate(dsConfig.getDsID(), "1", dsConfig.getSeriesCount(), 50, new AsyncCallback<ArrayList<DataVO>>() {

      public void onFailure(Throwable caught) {
        dbg.debug("Failed in getDataUpdate " + caught);
      }

      public void onSuccess(ArrayList<DataVO> result) {
        // the panel that will hold the chart

        //panel.setCollapsible(true);
        dbg.debug("seriesSetCount=" + result.size());

        new Draggable(panel, panel.getHeader()).setUseProxy(false);
        final Resizable resize = new Resizable(panel, Dir.E, Dir.SE, Dir.S);
        resize.setMinHeight(400);
        resize.setMinWidth(400);
        panel.setLayoutData(HasHorizontalAlignment.ALIGN_LEFT);
        panel.getElement().getStyle().setMargin(2, Unit.PX);
        // set a header of the panel
        panel.setHeadingText(dsConfig.getDsName());
        panel.setPixelSize(width, height);
        panel.setBodyBorder(true);
        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,
//              new LabelProvider<LineSeries<TimeSeriesDataVO>>() {
//                public String getLabel(LineSeries<TimeSeriesDataVO> item) {
//                  return item.getYField().getPath();
//                }
//              });

          final TextField fieldInput = new TextField();
          fieldInput.setValue("first");
          fieldInput.setAllowBlank(false);
          fieldInput.addValidator(new MaxLengthValidator(20));
          final RegExp regex = RegExp.compile("\\s");
          fieldInput.addValidator(new Validator<String>() {
            public List<EditorError> validate(Editor<String> editor, String value) {
              if (regex.test(value)) {
                List<EditorError> errors = new ArrayList<EditorError>();
                errors.add(new DefaultEditorError(editor, "Field name cannot contain spaces.", ""));
                return errors;
              }
              return null;
            }
          });

          TextButton add = new TextButton("Add");
          add.addSelectHandler(new SelectHandler() {
            public void onSelect(SelectEvent event) {
//              String field = fieldInput.getValue();
//              if (fieldInput.isCurrentValid() && field.length() > 0 && fieldStore.findModelWithKey(field) == null && fieldStore.size() < 10) {
//                for (int i = 0; i < store.size(); i++) {
//                  TimeSeriesDataVO item = store.get(i);
//                  item.put(field, Math.random() * 100);
//                }
//                LineSeries<TimeSeriesDataVO> series = createLine(field);
//                fieldStore.add(series);
//                axis.addField(series.getYField());
//                chart.addSeries(series);
//                chart.redrawChart();
//              }
            }
          });

          TextButton remove = new TextButton("Remove");
          remove.addSelectHandler(new SelectHandler() {
            public void onSelect(SelectEvent event) {
//              String field = box.getText();
//              LineSeries<TimeSeriesDataVO> series = fieldStore.findModelWithKey(field);
//              if (field.length() > 0 && series != null && fieldStore.size() > 0) {
//                for (int i = 0; i < store.size(); i++) {
//                  TimeSeriesDataVO item = store.get(i);
//                  item.remove(field);
//                }
//                fieldStore.remove(series);
//                axis.removeField(series.getYField());
//                chart.removeSeries(series);
//                chart.redrawChart();
//              }
//              box.clear();
            }
          });

          ToolBar toolBar = new ToolBar();
          toolBar.add(toggleLive);
          toolBar.add(new SeparatorToolItem());
          toolBar.add(add);
          toolBar.add(fieldInput);
          toolBar.add(new SeparatorToolItem());
          toolBar.add(remove);
//          toolBar.add(box);

          VerticalLayoutContainer layout2 = new VerticalLayoutContainer();

          toolBar.setLayoutData(new VerticalLayoutData(1, -1));
          layout2.add(toolBar);

//          chart.setLayoutData(new VerticalLayoutData(1, 1));
          layout2.add(chart.asWidget());
          final VerticalLayoutContainer layout = new VerticalLayoutContainer();

          layout.setBorders(true);
          // table that provide the data source information
          layout.add(flexTable, new VerticalLayoutData(1, height / 10));
          errorLabel.setHeight("20px");
          errorLabel.setText("");

          layout.add(layout2,new VerticalLayoutData(1, 1));
          layout.add(errorLabel);
          enableLive();
          panel.add(layout);
         

        } catch (ChartSettingsNotValidException e) {
          errorLabel.setText(e.getMessage());
          dbg.debug("Failed in createChart " + e);
View Full Code Here

    this.callback=callback;
    setModal(true);
    setSize("400", "150");
    setHeadingText("上传资源文件");
   
    FramedPanel fp=new FramedPanel();
    fp.setHeaderVisible(false);
    fp.setButtonAlign(BoxLayoutPack.CENTER);
   
    final FormPanel panel = new FormPanel();
    panel.setAction("upload.do?type="+type+"&id="+id);
    panel.setEncoding(Encoding.MULTIPART);
    panel.setMethod(Method.POST);

    fp.add(panel);

   
   
    file = new FileUploadField();
    file.setAllowBlank(false);
    file.setName("uploadedfile");
    panel.add(new FieldLabel(file,"选择文件"));

    TextButton btn = new TextButton("重置",new SelectHandler() {
      public void onSelect(SelectEvent event) {
        panel.reset();
      }
    });
    fp.addButton(btn);

    btn = new TextButton("上传",new SelectHandler() {
      public void onSelect(SelectEvent event) {
        if (panel.isValid()) {
          panel.submit();
          return;
        }
      }
    });
    fp.addButton(btn);

    panel.addSubmitCompleteHandler(new SubmitCompleteHandler() {
      public void onSubmitComplete(SubmitCompleteEvent event) {
        String html=event.getResults().trim();
        if(html.contains("[[uri=")){
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.FramedPanel

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.