Example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

List of usage examples for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel.

Prototype

private HTMLPanel(Element elem) 

Source Link

Document

Construct a new HTMLPanel with the specified element.

Usage

From source file:org.jboss.as.console.client.shared.patching.wizard.StopServersFailedStep.java

License:Open Source License

@Override
protected IsWidget body(final C context) {
    FlowPanel body = new FlowPanel();
    errorText = new Label();
    body.add(errorText);/*from www .  j av a2  s  .  c  o  m*/

    errorDetails = new ErrorDetails(Console.CONSTANTS.patch_manager_show_details(),
            Console.CONSTANTS.patch_manager_hide_details());
    body.add(errorDetails);

    body.add(new HTML("<h3 class=\"patch-followup-header\">"
            + Console.CONSTANTS.patch_manager_possible_actions() + "</h3>"));
    HTMLPanel actions = new HTMLPanel(
            ACTIONS_TEMPLATE.stopServers(Console.CONSTANTS.patch_manager_stop_server_error_cancel_title(),
                    Console.CONSTANTS.patch_manager_stop_server_error_cancel_body(),
                    Console.CONSTANTS.patch_manager_stop_server_error_continue_title(),
                    Console.CONSTANTS.patch_manager_stop_server_error_continue_body()));
    body.add(actions);

    return body;
}

From source file:org.jboss.ballroom.client.widgets.forms.DefaultGroupRenderer.java

License:Open Source License

@Override
public Widget render(RenderMetaData metaData, String groupName, Map<String, FormItem> groupItems) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    builder.appendHtmlConstant(tablePrefix);

    // build html structure
    ArrayList<String> itemKeys = new ArrayList<String>(groupItems.keySet());
    ArrayList<FormItem> values = new ArrayList<FormItem>(groupItems.values());

    // Remove the hidden items from both lists. Iterate from the back so that removal doesn't
    // require adjustment of the numbering.
    for (int i = values.size() - 1; i >= 0; i--) {
        if (!values.get(i).render()) {
            values.remove(i);//from  w w  w .j a  v  a  2s .c  o m
            itemKeys.remove(i);
        }
    }

    //int colWidth = 100/(metaData.getNumColumns()*2);

    int numColumns = metaData.getNumColumns();
    builder.appendHtmlConstant("<colgroup class='cols_" + numColumns + "'>");
    for (int col = 0; col < numColumns; col++) {
        // it's two TD's per item (title & value)
        builder.appendHtmlConstant("<col class='form-item-title-col'/>");
        builder.appendHtmlConstant("<col class='form-item-col'/>");

    }
    builder.appendHtmlConstant("</colgroup>");

    int i = 0;
    while (i < itemKeys.size()) {
        builder.appendHtmlConstant(
                "<tr class='form-attribute-row' data-dmr-attr='" + values.get(i).getName() + "'>"); // TODO only works with single column

        int col = 0;
        for (col = 0; col < numColumns; col++) {
            int next = i + col;
            if (next < itemKeys.size()) {
                FormItem item = values.get(next);
                createItemCell(metaData, builder, itemKeys.get(next), item);
            } else {
                break;
            }
        }

        builder.appendHtmlConstant("</tr>");
        i += col;
    }

    builder.appendHtmlConstant(tableSuffix);
    builder.appendHtmlConstant(
            "<p style='color:#999999;padding-left:8px'> Required fields are marked with an asterisk (<abbr class='req' title='required'>*</abbr>).</p>");

    HTMLPanel panel = new HTMLPanel(builder.toSafeHtml());

    // inline widget
    for (String key : itemKeys) {
        FormItem item = groupItems.get(key);
        final String widgetId = id + key;
        final String labelId = id + key + "_l"; // aria property key
        final String insertId = id + key + "_i";

        Element input = item.getInputElement();
        if (input != null) {
            input.setAttribute("id", widgetId);
            //widget.getElement().setAttribute("tabindex", "0");
            input.setAttribute("aria-labelledby", labelId);
            input.setAttribute("aria-required", String.valueOf(item.isRequired()));
        }
        panel.add(item.asWidget(), insertId);

    }

    return panel;
}

From source file:org.jboss.ballroom.client.widgets.forms.FieldsetRenderer.java

License:Open Source License

private HTMLPanel createFieldsetPanel(String groupName) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();

    builder.appendHtmlConstant("<fieldset id='" + id + "' class='default-fieldset'>");
    builder.appendHtmlConstant("<legend class='default-legend'>").appendEscaped(groupName)
            .appendHtmlConstant("</legend>");
    builder.appendHtmlConstant("</fieldset>");

    return new HTMLPanel(builder.toSafeHtml());
}

From source file:org.jbpm.console.ng.cm.client.details.CaseDetailsViewImpl.java

License:Apache License

@Override
public void init(CaseDetailsPresenter presenter) {
    this.presenter = presenter;

    taskDescriptionLabel.add(new HTMLPanel(constants.Description()));

}

From source file:org.jbpm.console.ng.gc.client.experimental.details.base.DetailsTabbedPanel.java

License:Apache License

public void addTab(String placeToGo, String label) {

    HTMLPanel content = new HTMLPanel("");
    tabsContainer.add(content, label);
}

From source file:org.jbpm.console.ng.ht.client.editors.quicknewgroup.QuickNewGroupViewImpl.java

License:Apache License

private void initializeHtml() {
    groupLabel.add(new HTMLPanel(constants.Group()));
    parentGroupLabel.setText(constants.Parent_Group());

    Controls descriptionControl = new Controls();
    descriptionControl.add(descriptionText);
    descriptionControl.add(descriptionHelpLabel);
    descriptionControlGroup.add(groupLabel);
    descriptionControlGroup.add(descriptionControl);

    addGroupButton.setText(constants.Create());

    initializeListParentGroup();//from w ww.j  a v a 2 s.co m
}

From source file:org.jbpm.console.ng.ht.client.editors.quicknewtask.QuickNewTaskViewImpl.java

License:Apache License

@Override
public void init(QuickNewTaskPresenter presenter) {
    this.presenter = presenter;

    KeyPressHandler keyPressHandlerText = new KeyPressHandler() {
        @Override//from   w ww .  j  a  v  a2s .c om
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == 13) {
                addTask();
            }
        }
    };
    textKeyPressHandler = taskNameText.addKeyPressHandler(keyPressHandlerText);

    KeyPressHandler keyPressHandlerCheck = new KeyPressHandler() {
        @Override
        public void onKeyPress(KeyPressEvent event) {
            if (event.getNativeEvent().getKeyCode() == 13) {
                addTask();
            }
        }
    };
    checkKeyPressHandler = quickTaskCheck.addKeyPressHandler(keyPressHandlerCheck);
    quickTaskCheck.setHTML(" " + constants.Quick_Task());
    taskNameText.setFocus(true);

    userText.setText(identity.getName());
    taskPriorityListBox.setText("5");
    dueDate.setValue(new Date());

    addTaskButton.setText(constants.Create());
    dueDateLabel.add(new HTMLPanel(constants.Due_On()));
    userLabel.add(new HTMLPanel(constants.User()));
    taskPriorityLabel.add(new HTMLPanel(constants.Priority()));

    advancedLabel.add(new HTMLPanel(constants.Advanced()));
    taskNameLabel.add(new HTMLPanel(constants.Task_Name()));

}

From source file:org.jbpm.console.ng.ht.client.editors.quicknewtyperole.QuickNewTypeRoleViewImpl.java

License:Apache License

private void initializeHtml() {
    typeRoleLabel.add(new HTMLPanel(constants.Type_Role()));

    Controls descriptionControl = new Controls();
    descriptionControl.add(descriptionText);
    descriptionControl.add(descriptionHelpLabel);
    descriptionControlGroup.add(typeRoleLabel);
    descriptionControlGroup.add(descriptionControl);

    addTypeRoleButton.setText(constants.Create());
}

From source file:org.jbpm.console.ng.ht.client.editors.quicknewuser.QuickNewUserViewImpl.java

License:Apache License

private void initializeHtml() {
    groupsList.setMultipleSelect(true);/*from   www . j  a v  a  2 s.co  m*/
    typeRoleList.setMultipleSelect(true);
    groupLabel.setText(constants.Group());
    typeRoleListLabel.setText(constants.Type_Role());

    userLabel.add(new HTMLPanel(constants.User()));

    Controls descriptionControl = new Controls();
    descriptionControl.add(descriptionText);
    descriptionControl.add(descriptionHelpLabel);
    descriptionControlUser.add(userLabel);
    descriptionControlUser.add(descriptionControl);

    addUserButton.setText(constants.Create());

    initializeListGroup();
    initializeListTypesRole();
}

From source file:org.jbpm.console.ng.ht.client.editors.taskassignments.popup.TaskAssignmentsPopupViewImpl.java

License:Apache License

@Override
public void init(TaskAssignmentsPopupPresenter presenter) {
    this.presenter = presenter;
    userOrGroupLabel.setText(constants.UserOrGroup());
    detailsAccordionLabel.add(new HTMLPanel(constants.Details()));
    delegateButton.setText(constants.Delegate());
    usersGroupsControlsLabel.setText(constants.Potential_Owners());
    usersGroupsControlsPanel.setStyleName("");
}