Package com.google.gwt.topspin.ui.client

Examples of com.google.gwt.topspin.ui.client.Button


        setIsRecordingTitle(recordStopButton.isDown());
        Controller.this.monitor.setIsRecording(recordStopButton.isDown());
      }
    });

    final Button resetButton = new Button(controllerContainer);
    resetButton.setStyleName(css.control() + " " + css.resetButton());
    resetButton.getElement().setAttribute("title", "Discard Data and Reset");
    resetButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        doReset();
      }
    });

    final Button saveButton = new Button(controllerContainer);
    saveButton.setStyleName(css.control() + " " + css.saveButton());
    saveButton.getElement().setAttribute("title", "Save Data to a File");
    saveButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        Controller me = Controller.this;
        saveRecords(getVisitedUrls(), monitor.getVersion(),
            me.dataDispatcher.getTraceCopy());
      }

      // TODO(jaimeyap): Revisit this since it is kinda yucky to be using a
      // view component as a model.
      private JSOArray<String> getVisitedUrls() {
        JSOArray<String> visitedUrls = JSOArray.create();
        int numberVisited = pages.getOptionCount();
        for (int i = 0; i < numberVisited; i++) {
          visitedUrls.push(getPageUrlForIndex(i));
        }
        return visitedUrls;
      }
    });

    infoScreen = new InfoScreen(this, css);

    final Button zoomOutButton = new Button(controllerContainer);
    zoomOutButton.setStyleName(css.control() + " " + css.zoomOutButton());
    zoomOutButton.getElement().setAttribute("title", "Zoom Out");
    zoomOutButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        overviewTimeline.zoom(-2);
      }
    });

    final Button zoomInButton = new Button(controllerContainer);
    zoomInButton.setStyleName(css.control() + " " + css.zoomInButton());
    zoomInButton.getElement().setAttribute("title", "Zoom In");
    zoomInButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        overviewTimeline.zoom(2);
      }
    });

    final Button zoomAllButton = new Button(controllerContainer);
    zoomAllButton.setStyleName(css.control() + " " + css.zoomAllButton());
    zoomAllButton.getElement().setAttribute("title", "Zoom All");
    zoomAllButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        overviewTimeline.zoomAll();
      }
    });

    // TODO(jaimeyap): Is this the best way to do the capability detection?
    if (hasSetProfilingOptionsApi()) {
      final Button settingsButton = new Button(controllerContainer);
      settingsButton.setStyleName(css.control() + " " + css.settingsButton());
      settingsButton.getElement().setAttribute("title", "Set Profiling Options");
      profilingOptions = ProfilingOptionsPanel.create(getElement(),
          settingsButton.getAbsoluteLeft() + 10,
          settingsButton.getOffsetHeight(), dataDispatcher);
      settingsButton.addClickListener(new ClickListener() {
        public void onClick(ClickEvent event) {
          profilingOptions.show();
        }
      });
    }

    pages = new Select(controllerContainer);
    pages.setStyleName(css.control() + " " + css.pageSelect());
    pages.addChangeListener(new ChangeListener() {
      public void onChange(ChangeEvent event) {
        int selected = pages.getSelectedIndex();
        Controller.this.monitor.setStateForPageAtIndex(selected);
        // If we are not selecting the most resent ApplicationState, we should
        // disable the record/stop button
        if (selected != Controller.this.monitor.getNumberOfPagesViewed() - 1) {
          recordStopButton.getElement().setPropertyBoolean("disabled", true);
        } else {
          recordStopButton.getElement().setPropertyBoolean("disabled", false);
        }
      }
    });

    final Button reportButton = new Button(controllerContainer);
    reportButton.setStyleName(css.control() + " " + css.reportButton());
    reportButton.getElement().setAttribute("title",
        "Display the Hintlet Report");
    reportButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        reportDialog.setVisible(true);
      }
    });
View Full Code Here


   * @param listenerManager an object to own event listeners
   * @return the newly created {@link Button}
   */
  public Button createButton(Container parent,
      ManagesEventListeners listenerManager) {
    Button button = new Button(parent);
    button.getElement().setClassName(cssClassSelector);
    button.getElement().setAttribute("title", toolTip);
    listenerManager.manageEventListener(button.addClickListener(behavior));
    return button;
  }
View Full Code Here

      Controller controller, Container controllerContainer) {
    this.controller = controller;
    this.controllerContainer = controllerContainer;

    init();
    /**
     * A button that allows the mock data sets to be selected at runtime.
     */
    final Button testMenuButton = new Button(controllerContainer);
    testMenuButton.setStyleName(controllerResources.controllerCss().control()
        + " " + css.testMenuButton());
    testMenuButton.getElement().setAttribute("title", "Mock Data");
    testMenuButton.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        int startX = testMenuButton.getAbsoluteLeft() + 10;
        int startY = testMenuButton.getOffsetHeight();
        base.getElement().getStyle().setLeft(startX, Unit.PX);
        base.getElement().getStyle().setTop(startY, Unit.PX);
        base.show();
      }
    });
View Full Code Here

import com.google.gwt.topspin.ui.client.Window;

public class TopSpinExample implements EntryPoint {

  public void onModuleLoad() {
    Button b = new Button(Root.getContainer());
    b.setText("Hello?");

    b.addClickListener(new ClickListener() {
      public void onClick(ClickEvent event) {
        Window.alert("Hello!");
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.topspin.ui.client.Button

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.