Search in sources :

Example 6 with Label

use of com.google.gwt.user.client.ui.Label 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 7 with Label

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

the class UnsavedChangesDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    // create cell table
    targetsCellTable_ = new CellTable<UnsavedChangesTarget>(15, UnsavedChangesCellTableResources.INSTANCE, KEY_PROVIDER);
    selectionModel_ = new MultiSelectionModel<UnsavedChangesTarget>(KEY_PROVIDER);
    targetsCellTable_.setSelectionModel(selectionModel_, DefaultSelectionEventManager.<UnsavedChangesTarget>createCheckboxManager());
    targetsCellTable_.setWidth("100%", true);
    // add columns
    addSelectionColumn();
    addIconColumn();
    addNameAndPathColumn();
    // hook-up data provider 
    dataProvider_ = new ListDataProvider<UnsavedChangesTarget>();
    dataProvider_.setList(targets_);
    dataProvider_.addDataDisplay(targetsCellTable_);
    targetsCellTable_.setPageSize(targets_.size());
    // select all by default
    for (UnsavedChangesTarget editingTarget : dataProvider_.getList()) selectionModel_.setSelected(editingTarget, true);
    // enclose cell table in scroll panel
    ScrollPanel scrollPanel = new ScrollPanel();
    scrollPanel.setStylePrimaryName(RESOURCES.styles().targetScrollPanel());
    scrollPanel.setWidget(targetsCellTable_);
    if (dataProvider_.getList().size() > 4)
        scrollPanel.setHeight("280px");
    // always save check box (may not be shown)
    chkAlwaysSave_ = new CheckBox(alwaysSaveOption_);
    // main widget
    VerticalPanel panel = new VerticalPanel();
    Label captionLabel = new Label("The following files have unsaved changes:");
    captionLabel.setStylePrimaryName(RESOURCES.styles().captionLabel());
    panel.add(captionLabel);
    panel.add(scrollPanel);
    if (!StringUtil.isNullOrEmpty(alwaysSaveOption_)) {
        panel.add(chkAlwaysSave_);
        panel.setCellHeight(chkAlwaysSave_, "30px");
        panel.setCellVerticalAlignment(chkAlwaysSave_, HasVerticalAlignment.ALIGN_MIDDLE);
    }
    return panel;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) UnsavedChangesTarget(org.rstudio.studio.client.workbench.model.UnsavedChangesTarget) CheckBox(com.google.gwt.user.client.ui.CheckBox) Label(com.google.gwt.user.client.ui.Label) ScrollPanel(com.google.gwt.user.client.ui.ScrollPanel)

Example 8 with Label

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

the class PaneStatusMessage method createStatusLabel.

private static Label createStatusLabel(String message) {
    Label label = new Label(message);
    label.getElement().getStyle().setColor("#888");
    return label;
}
Also used : Label(com.google.gwt.user.client.ui.Label)

Example 9 with Label

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

the class DataPane method createMainWidget.

@Override
protected Widget createMainWidget() {
    Label label = new Label("Under Construction");
    label.getElement().getStyle().setColor("#888");
    return new HorizontalCenterPanel(label, 100);
}
Also used : HorizontalCenterPanel(org.rstudio.core.client.widget.HorizontalCenterPanel) Label(com.google.gwt.user.client.ui.Label)

Example 10 with Label

use of com.google.gwt.user.client.ui.Label 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)

Aggregations

Label (com.google.gwt.user.client.ui.Label)89 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)19 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)15 Test (org.junit.Test)11 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)10 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)9 TextBox (com.google.gwt.user.client.ui.TextBox)9 Image (com.google.gwt.user.client.ui.Image)8 CheckBox (com.google.gwt.user.client.ui.CheckBox)7 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 JsArrayString (com.google.gwt.core.client.JsArrayString)5 Element (com.google.gwt.dom.client.Element)5 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)5 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)5 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 Grid (com.google.gwt.user.client.ui.Grid)5 HTML (com.google.gwt.user.client.ui.HTML)4