Search in sources :

Example 1 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project opentsdb by OpenTSDB.

the class MetricForm method assembleUi.

private void assembleUi() {
    setWidth("100%");
    {
        // Left hand-side panel.
        final HorizontalPanel hbox = new HorizontalPanel();
        final InlineLabel l = new InlineLabel();
        l.setText("Metric:");
        hbox.add(l);
        final SuggestBox suggest = RemoteOracle.newSuggestBox("metrics", metric);
        suggest.setLimit(40);
        hbox.add(suggest);
        hbox.setWidth("100%");
        metric.setWidth("100%");
        tagtable.setWidget(0, 0, hbox);
        tagtable.getFlexCellFormatter().setColSpan(0, 0, 3);
        addTag();
        tagtable.setText(1, 0, "Tags");
        add(tagtable);
    }
    {
        // Right hand-side panel.
        final VerticalPanel vbox = new VerticalPanel();
        {
            final HorizontalPanel hbox = new HorizontalPanel();
            hbox.add(rate);
            hbox.add(rate_counter);
            hbox.add(x1y2);
            vbox.add(hbox);
        }
        {
            final HorizontalPanel hbox = new HorizontalPanel();
            final InlineLabel l = new InlineLabel("Rate Ctr Max:");
            hbox.add(l);
            hbox.add(counter_max);
            vbox.add(hbox);
        }
        {
            final HorizontalPanel hbox = new HorizontalPanel();
            final InlineLabel l = new InlineLabel("Rate Ctr Reset:");
            hbox.add(l);
            hbox.add(counter_reset_value);
            vbox.add(hbox);
        }
        {
            final HorizontalPanel hbox = new HorizontalPanel();
            final InlineLabel l = new InlineLabel();
            l.setText("Aggregator:");
            hbox.add(l);
            hbox.add(aggregators);
            vbox.add(hbox);
        }
        vbox.add(downsample);
        {
            final HorizontalPanel hbox = new HorizontalPanel();
            hbox.add(downsampler);
            hbox.add(interval);
            hbox.add(fill_policy);
            vbox.add(hbox);
        }
        add(vbox);
    }
}
Also used : SuggestBox(com.google.gwt.user.client.ui.SuggestBox) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) InlineLabel(com.google.gwt.user.client.ui.InlineLabel)

Example 2 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project goldenorb by jzachr.

the class OrbTrackerStatus method onModuleLoad.

@Override
public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();
    mainPanel = new VerticalPanel();
    rootPanel.add(mainPanel);
    Image image = new Image("images/logo-full.jpg");
    mainPanel.add(image);
    // Label titleLabel = new Label("GoldenOrb");
    // mainPanel.add(titleLabel);
    lastUpdatedLabel = new Label("Last Updated : ");
    mainPanel.add(lastUpdatedLabel);
    Label lblOrbtrackermembers = new Label("OrbTrackerMembers");
    mainPanel.add(lblOrbtrackermembers);
    orbTrackerFlexTable = new FlexTable();
    mainPanel.add(orbTrackerFlexTable);
    orbTrackerFlexTable.setSize("761px", "116px");
    orbTrackerFlexTable.setText(0, 0, "Node Name");
    orbTrackerFlexTable.setText(0, 1, "Partition Capacity");
    orbTrackerFlexTable.setText(0, 2, "Available Partitions");
    orbTrackerFlexTable.setText(0, 3, "Reserved Partitions");
    orbTrackerFlexTable.setText(0, 4, "In Use Partitions");
    orbTrackerFlexTable.setText(0, 5, "Host Name");
    orbTrackerFlexTable.setText(0, 6, "Leader");
    orbTrackerFlexTable.setText(0, 7, "Port");
    jobsGroupedPanel = new HorizontalPanel();
    mainPanel.add(jobsGroupedPanel);
    jobsGroupedPanel.setSize("258px", "100px");
    jobsInProgressPanel = new FlexTable();
    jobsInProgressPanel.setText(0, 0, "Jobs In Progress");
    jobsGroupedPanel.add(jobsInProgressPanel);
    jobsInQueuePanel = new FlexTable();
    jobsInQueuePanel.setText(0, 0, "Jobs In Queue");
    jobsGroupedPanel.add(jobsInQueuePanel);
    jobsInProgressPanel.setTitle("Jobs In Progress");
    jobsInQueuePanel.setTitle("Jobs in Queue");
    errorLabelOTM = new Label("");
    mainPanel.add(errorLabelOTM);
    errorLabelJIP = new Label("");
    mainPanel.add(errorLabelJIP);
    errorLabelJQ = new Label("");
    mainPanel.add(errorLabelJQ);
    Timer refreshTimer = new Timer() {

        public void run() {
            refreshWatchDataList();
            refreshJobsInProgress();
            refreshJobsInQueue();
        }
    };
    refreshTimer.scheduleRepeating(REFRESH_INTERVAL);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Timer(com.google.gwt.user.client.Timer) Label(com.google.gwt.user.client.ui.Label) FlexTable(com.google.gwt.user.client.ui.FlexTable) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) RootPanel(com.google.gwt.user.client.ui.RootPanel) Image(com.google.gwt.user.client.ui.Image)

Example 3 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.

the class RPubsUploadDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    Styles styles = RESOURCES.styles();
    SimplePanel mainPanel = new SimplePanel();
    mainPanel.addStyleName(styles.mainWidget());
    VerticalPanel verticalPanel = new VerticalPanel();
    HorizontalPanel headerPanel = new HorizontalPanel();
    headerPanel.addStyleName(styles.headerPanel());
    headerPanel.add(new Image(new ImageResource2x(RESOURCES.publishLarge2x())));
    Label headerLabel = new Label("Publish to RPubs");
    headerLabel.addStyleName(styles.headerLabel());
    headerPanel.add(headerLabel);
    headerPanel.setCellVerticalAlignment(headerLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.add(headerPanel);
    String msg;
    if (!isPublished_ && uploadId_.isEmpty()) {
        msg = "RPubs is a free service from RStudio for sharing " + "documents on the web. Click Publish to get " + "started.";
    } else {
        msg = "This document has already been published on RPubs. You can " + "choose to either update the existing RPubs document, or " + "create a new one.";
    }
    Label descLabel = new Label(msg);
    descLabel.addStyleName(styles.descLabel());
    verticalPanel.add(descLabel);
    // if we have a generator then show title and comment UI
    if (htmlGenerator_ != null) {
        Label titleLabel = new Label("Title (optional):");
        titleLabel.addStyleName(styles.fieldLabel());
        verticalPanel.add(titleLabel);
        titleTextBox_ = new TextBox();
        titleTextBox_.addStyleName(styles.titleTextBox());
        titleTextBox_.getElement().setAttribute("spellcheck", "false");
        verticalPanel.add(titleTextBox_);
        Label commentLabel = new Label("Comment (optional):");
        commentLabel.addStyleName(styles.fieldLabel());
        verticalPanel.add(commentLabel);
        commentTextArea_ = new FixedTextArea(6);
        commentTextArea_.addStyleName(styles.commentTextArea());
        verticalPanel.add(commentTextArea_);
        // not using either for now
        titleLabel.setVisible(false);
        titleTextBox_.setVisible(false);
        commentLabel.setVisible(false);
        commentTextArea_.setVisible(false);
        previewButton_ = new ThemedButton("Preview");
        previewButton_.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                htmlGenerator_.generateStaticHtml(titleTextBox_.getText().trim(), commentTextArea_.getText().trim(), new CommandWithArg<String>() {

                    @Override
                    public void execute(String rpubsFile) {
                        globalDisplay_.showHtmlFile(rpubsFile);
                    }
                });
            }
        });
        addLeftButton(previewButton_);
    }
    HTML warningLabel = new HTML("<strong>IMPORTANT: All documents published to RPubs are " + "publicly visible.</strong> You should " + "only publish documents that you wish to share publicly.");
    warningLabel.addStyleName(styles.warningLabel());
    verticalPanel.add(warningLabel);
    ThemedButton cancelButton = createCancelButton(new Operation() {

        @Override
        public void execute() {
            // if an upload is in progress then terminate it
            if (uploader_.isUploadInProgress()) {
                uploader_.terminateUpload();
            }
        }
    });
    continueButton_ = new ThemedButton("Publish", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            performUpload(false);
        }
    });
    updateButton_ = new ThemedButton("Update Existing", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            performUpload(true);
        }
    });
    createButton_ = new ThemedButton("Create New", new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            performUpload(false);
        }
    });
    if (!isPublished_ && uploadId_.isEmpty()) {
        addOkButton(continueButton_);
        addCancelButton(cancelButton);
    } else {
        addOkButton(updateButton_);
        addButton(createButton_);
        addCancelButton(cancelButton);
    }
    mainPanel.setWidget(verticalPanel);
    return mainPanel;
}
Also used : ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Label(com.google.gwt.user.client.ui.Label) SimplePanel(com.google.gwt.user.client.ui.SimplePanel) HTML(com.google.gwt.user.client.ui.HTML) TextBox(com.google.gwt.user.client.ui.TextBox) CommandWithArg(org.rstudio.core.client.CommandWithArg) Operation(org.rstudio.core.client.widget.Operation) Image(com.google.gwt.user.client.ui.Image) ProgressImage(org.rstudio.core.client.widget.ProgressImage) ThemedButton(org.rstudio.core.client.widget.ThemedButton) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) FixedTextArea(org.rstudio.core.client.widget.FixedTextArea) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ImageResource2x(org.rstudio.core.client.resources.ImageResource2x)

Example 4 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.

the class SavePlotAsPdfDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    ExportPlotResources.Styles styles = ExportPlotResources.INSTANCE.styles();
    Grid grid = new Grid(7, 2);
    grid.setStylePrimaryName(styles.savePdfMainWidget());
    // paper size
    grid.setWidget(0, 0, new Label("PDF Size:"));
    // paper size label
    paperSizeEditor_ = new PaperSizeEditor();
    grid.setWidget(0, 1, paperSizeEditor_);
    // orientation
    grid.setWidget(1, 0, new Label("Orientation:"));
    HorizontalPanel orientationPanel = new HorizontalPanel();
    orientationPanel.setSpacing(kComponentSpacing);
    VerticalPanel orientationGroupPanel = new VerticalPanel();
    final String kOrientationGroup = new String("Orientation");
    portraitRadioButton_ = new RadioButton(kOrientationGroup, "Portrait");
    orientationGroupPanel.add(portraitRadioButton_);
    landscapeRadioButton_ = new RadioButton(kOrientationGroup, "Landscape");
    orientationGroupPanel.add(landscapeRadioButton_);
    orientationPanel.add(orientationGroupPanel);
    grid.setWidget(1, 1, orientationPanel);
    boolean haveCairoPdf = sessionInfo_.isCairoPdfAvailable();
    if (haveCairoPdf)
        grid.setWidget(2, 0, new Label("Options:"));
    HorizontalPanel cairoPdfPanel = new HorizontalPanel();
    String label = "Use cairo_pdf device";
    if (BrowseCap.isMacintoshDesktop())
        label = label + " (requires X11)";
    chkCairoPdf_ = new CheckBox(label);
    chkCairoPdf_.getElement().getStyle().setMarginLeft(kComponentSpacing, Unit.PX);
    cairoPdfPanel.add(chkCairoPdf_);
    chkCairoPdf_.setValue(haveCairoPdf && options_.getCairoPdf());
    if (haveCairoPdf)
        grid.setWidget(2, 1, cairoPdfPanel);
    grid.setWidget(3, 0, new HTML("&nbsp;"));
    ThemedButton directoryButton = new ThemedButton("Directory...");
    directoryButton.setStylePrimaryName(styles.directoryButton());
    directoryButton.getElement().getStyle().setMarginLeft(-2, Unit.PX);
    grid.setWidget(4, 0, directoryButton);
    directoryButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            fileDialogs_.chooseFolder("Choose Directory", fileSystemContext_, FileSystemItem.createDir(directoryLabel_.getTitle().trim()), new ProgressOperationWithInput<FileSystemItem>() {

                public void execute(FileSystemItem input, ProgressIndicator indicator) {
                    if (input == null)
                        return;
                    indicator.onCompleted();
                    // update default
                    ExportPlotUtils.setDefaultSaveDirectory(input);
                    // set display
                    setDirectory(input);
                }
            });
        }
    });
    directoryLabel_ = new Label();
    setDirectory(defaultDirectory_);
    directoryLabel_.setStylePrimaryName(styles.savePdfDirectoryLabel());
    grid.setWidget(4, 1, directoryLabel_);
    Label fileNameLabel = new Label("File name:");
    fileNameLabel.setStylePrimaryName(styles.savePdfFileNameLabel());
    grid.setWidget(5, 0, fileNameLabel);
    fileNameTextBox_ = new TextBox();
    fileNameTextBox_.setText(defaultPlotName_);
    fileNameTextBox_.setStylePrimaryName(styles.savePdfFileNameTextBox());
    grid.setWidget(5, 1, fileNameTextBox_);
    // view after size
    viewAfterSaveCheckBox_ = new CheckBox("View plot after saving");
    viewAfterSaveCheckBox_.setStylePrimaryName(styles.savePdfViewAfterCheckbox());
    viewAfterSaveCheckBox_.setValue(options_.getViewAfterSave());
    grid.setWidget(6, 1, viewAfterSaveCheckBox_);
    // set default value
    if (options_.getPortrait())
        portraitRadioButton_.setValue(true);
    else
        landscapeRadioButton_.setValue(true);
    // return the widget
    return grid;
}
Also used : Grid(com.google.gwt.user.client.ui.Grid) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Label(com.google.gwt.user.client.ui.Label) HTML(com.google.gwt.user.client.ui.HTML) RadioButton(com.google.gwt.user.client.ui.RadioButton) TextBox(com.google.gwt.user.client.ui.TextBox) ProgressOperationWithInput(org.rstudio.core.client.widget.ProgressOperationWithInput) ThemedButton(org.rstudio.core.client.widget.ThemedButton) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) FileSystemItem(org.rstudio.core.client.files.FileSystemItem) ExportPlotResources(org.rstudio.studio.client.workbench.exportplot.ExportPlotResources) CheckBox(com.google.gwt.user.client.ui.CheckBox) ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel)

Example 5 with HorizontalPanel

use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.

the class PresentationPane method zoom.

@Override
public void zoom(String title, String url, final Command onClosed) {
    // create the titlebar (no title for now)
    HorizontalPanel titlePanel = new HorizontalPanel();
    ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
    Label titleLabel = new Label(title);
    titleLabel.addStyleName(styles.fullscreenCaptionLabel());
    titlePanel.add(titleLabel);
    // create the frame
    AnchorableFrame frame = new PresentationFrame(true);
    frame.setSize("100%", "100%");
    // create the popup panel & add close handler 
    activeZoomPanel_ = new FullscreenPopupPanel(titlePanel, frame, false);
    activeZoomPanel_.addCloseHandler(new CloseHandler<PopupPanel>() {

        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            activeZoomPanel_ = null;
            onClosed.execute();
        }
    });
    // load the frame and show the zoom panel
    frame.navigate(url);
    activeZoomPanel_.center();
}
Also used : FullscreenPopupPanel(org.rstudio.core.client.widget.FullscreenPopupPanel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ThemeStyles(org.rstudio.core.client.theme.res.ThemeStyles) Label(com.google.gwt.user.client.ui.Label) PopupPanel(com.google.gwt.user.client.ui.PopupPanel) FullscreenPopupPanel(org.rstudio.core.client.widget.FullscreenPopupPanel) AnchorableFrame(org.rstudio.core.client.widget.AnchorableFrame)

Aggregations

HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)37 Label (com.google.gwt.user.client.ui.Label)19 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)9 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)9 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)9 Image (com.google.gwt.user.client.ui.Image)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 TextBox (com.google.gwt.user.client.ui.TextBox)6 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)4 Grid (com.google.gwt.user.client.ui.Grid)4 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)4 KeyPressEvent (com.google.gwt.event.dom.client.KeyPressEvent)3 Anchor (com.google.gwt.user.client.ui.Anchor)3 CheckBox (com.google.gwt.user.client.ui.CheckBox)3 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)3 GerritUiExtensionPoint (com.google.gerrit.client.GerritUiExtensionPoint)2 RestApi (com.google.gerrit.client.rpc.RestApi)2 HintTextBox (com.google.gerrit.client.ui.HintTextBox)2