Example usage for com.google.gwt.user.client.ui HorizontalPanel setCellWidth

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

Introduction

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

Prototype

public void setCellWidth(IsWidget w, String width) 

Source Link

Document

Overloaded version for IsWidget.

Usage

From source file:org.overlord.sramp.ui.client.views.ArtifactView.java

License:Apache License

/**
 * @see org.overlord.sramp.ui.client.views.IArtifactView#onArtifactLoaded(org.overlord.sramp.ui.shared.beans.ArtifactDetails)
 *///from w  w w . ja  v a  2s  .  c o m
@Override
public void onArtifactLoaded(ArtifactDetails artifact) {
    main.clear();

    HorizontalPanel twoColContent = new HorizontalPanel();
    twoColContent.setStyleName("artifactView-content");
    twoColContent.setWidth("100%");
    main.add(twoColContent);

    VerticalPanel leftCol = new VerticalPanel();
    leftCol.setStyleName("leftCol");
    VerticalPanel rightCol = new VerticalPanel();
    rightCol.setStyleName("rightCol");
    leftCol.setWidth("100%");
    rightCol.setWidth("100%");
    twoColContent.add(leftCol);
    twoColContent.add(rightCol);
    twoColContent.setCellWidth(leftCol, "70%");
    twoColContent.setCellWidth(rightCol, "30%");
    twoColContent.setCellHorizontalAlignment(rightCol, HorizontalPanel.ALIGN_RIGHT);

    // Artifact details
    DisclosurePanel details = new DisclosurePanel(i18n().translate("views.artifact.details.label"));
    details.setStyleName("dpanel");
    details.setOpen(true);
    details.add(createDetailsForm(artifact));

    // Artifact description
    DisclosurePanel description = new DisclosurePanel(i18n().translate("views.artifact.description.label"));
    description.setStyleName("dpanel");
    description.setOpen(true);
    description.add(createDescriptionForm(artifact));

    // Relationships
    DisclosurePanel relationships = new DisclosurePanel(i18n().translate("views.artifact.relationships.label"));
    relationships.setStyleName("dpanel");
    relationships.setOpen(true);
    relationships.add(createRelationshipsForm(artifact));

    leftCol.add(details);
    leftCol.add(description);
    leftCol.add(relationships);
    leftCol.setCellWidth(details, "100%");
    leftCol.setCellWidth(description, "100%");
    leftCol.setCellWidth(relationships, "100%");

    // Artifact properties
    DisclosurePanel properties = new DisclosurePanel(i18n().translate("views.artifact.properties.label"));
    properties.setStyleName("dpanel");
    properties.setOpen(true);
    properties.add(createPropertiesForm(artifact));

    // Classifications
    DisclosurePanel classifications = new DisclosurePanel(
            i18n().translate("views.artifact.classifications.label"));
    classifications.setStyleName("dpanel");
    classifications.setOpen(true);
    classifications.add(createClassificationsForm(artifact));

    // Artifact links/urls
    DisclosurePanel links = new DisclosurePanel(i18n().translate("views.artifact.links.label"));
    links.setStyleName("dpanel");
    links.setOpen(true);
    links.add(createLinks(artifact));

    rightCol.add(properties);
    rightCol.add(classifications);
    rightCol.add(links);
    rightCol.setCellWidth(details, "100%");
}

From source file:org.overlord.sramp.ui.client.views.BrowseView.java

License:Apache License

/**
 * Constructor./*w  w  w  .ja  v  a 2  s .c o  m*/
 */
public BrowseView() {
    typeFilterPanel = new PlaceFilterPanel<BrowsePlace>(i18n().translate("views.browse.filter-panel.label")) {
        @Override
        protected boolean matches(BrowsePlace currentPlace, BrowsePlace targetPlace) {
            String currentTypeFilter = currentPlace.getTypeFilter();
            String targetTypeFilter = targetPlace.getTypeFilter();
            if (currentTypeFilter == targetTypeFilter)
                return true;
            else if (currentTypeFilter != null && currentTypeFilter.equals(targetTypeFilter))
                return true;
            return false;
        }
    };
    artifacts = createArtifactTable();
    nameFilterBox = new TextBox();
    nameFilterBox.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            BrowsePlace newPlace = currentPlace.clone();
            newPlace.setNameFilter(nameFilterBox.getValue());
            History.newItem(toHistoryToken(newPlace));
        }
    });
    summaryPanel = new ArtifactSummaryPanel();

    FlowPanel nameFilterPanel = new FlowPanel();
    nameFilterPanel.setStyleName("filterPanel");
    InlineLabel label = new InlineLabel("Filter by name:");
    label.setStyleName("label");
    nameFilterPanel.add(label);
    nameFilterPanel.add(nameFilterBox);

    VerticalPanel vpanel = new VerticalPanel();
    vpanel.add(typeFilterPanel);
    vpanel.add(nameFilterPanel);

    HorizontalPanel hpanel = new HorizontalPanel();
    hpanel.setWidth("100%");
    hpanel.add(vpanel);
    hpanel.add(artifacts);
    hpanel.add(summaryPanel);

    hpanel.setCellWidth(vpanel, "175px");
    hpanel.setCellWidth(summaryPanel, "300px");

    this.initWidget(hpanel);
}

From source file:org.overlord.sramp.ui.client.views.DashboardView.java

License:Apache License

/**
 * Constructor./* www  . j a v a  2  s  .  c  o m*/
 */
public DashboardView() {
    // Create the dashboard
    HorizontalPanel dashboardPanel = new HorizontalPanel();
    dashboardPanel.getElement().setId("dashboard");
    dashboardPanel.getElement().setAttribute("style", "width: 100%");

    // Create two columns
    VerticalPanel leftColumn = new VerticalPanel();
    leftColumn.getElement().setClassName("dashColumn");
    leftColumn.getElement().addClassName("left");
    VerticalPanel rightColumn = new VerticalPanel();
    rightColumn.getElement().setClassName("dashColumn");
    rightColumn.getElement().addClassName("right");
    dashboardPanel.add(leftColumn);
    dashboardPanel.add(rightColumn);

    // Create the Activities panel
    TitlePanel activitiesPanel = new TitlePanel(i18n().translate("views.dashboard.activities-panel.title"));
    activitiesPanel.getElement().setId("dash-activitiesPanel");
    UnorderedListPanel ulPanel = new UnorderedListPanel();
    List<Widget> activityLinks = createActivityLinks();
    for (Widget link : activityLinks)
        ulPanel.add(link);
    activitiesPanel.setWidget(ulPanel);

    // Create the Upload Artifact panel
    TitlePanel uploadPanel = new TitlePanel(i18n().translate("views.dashboard.upload-panel.title"));
    uploadPanel.getElement().setId("dash-uploadPanel");
    uploadPanel.setWidget(createUploadForm());

    // Create the Help panel
    TitlePanel helpPanel = new TitlePanel(i18n().translate("views.dashboard.help-panel.title"));
    helpPanel.getElement().setId("dash-helpPanel");
    HTMLPanel helpText = new HTMLPanel(i18n().translate("views.dashboard.help-panel.help-text"));
    helpPanel.setWidget(helpText);

    // Now size the columns properly
    dashboardPanel.setCellWidth(leftColumn, "50%");
    dashboardPanel.setCellWidth(rightColumn, "50%");

    // Add the panels to the dashboard
    leftColumn.add(activitiesPanel);
    leftColumn.add(uploadPanel);
    rightColumn.add(helpPanel);

    this.initWidget(dashboardPanel);
}

From source file:org.overlord.sramp.ui.client.widgets.dialogs.GrowlDialog.java

License:Apache License

/**
 * Sets the dialog's message (directly as a {@link Widget}).  This variant allows clients
 * to set rich HTML as the growl content, complete with behavior (event handlers).
 * @param message/*from  w  w w  .j av a2s.  co m*/
 */
public void setMessage(Widget message, GrowlType type) {
    if (this.message != null) {
        main.remove(this.message);
    }
    FlowPanel messageWrapper = new FlowPanel();
    messageWrapper.setStyleName("growlMessage");
    if (type == GrowlType.error) {
        HorizontalPanel errorPanel = new HorizontalPanel();
        Widget icon = new InlineLabel(" ");
        icon.setStyleName("errorMessage");

        errorPanel.add(icon);
        errorPanel.add(message);

        errorPanel.setCellWidth(icon, "1%");
        errorPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);

        messageWrapper.add(errorPanel);
    } else {
        messageWrapper.add(message);
    }
    this.message = messageWrapper;
    main.add(messageWrapper);
    setGrowlType(type);
}

From source file:org.pentaho.gwt.widgets.client.colorpicker.ColorPicker.java

License:Artistic License

public ColorPicker() {
    // UI Drawing
    // ------------------

    hue = 0;//  w  w  w  .ja  v  a 2  s .c o  m
    saturation = 100;
    brightness = 100;
    red = 255;
    green = 0;
    blue = 0;

    HorizontalPanel panel = new HorizontalPanel();
    FlexTable table = new FlexTable();

    // Add the large slider map
    slidermap = new SliderMap(this);
    panel.add(slidermap);
    panel.setCellWidth(slidermap, "258px"); //$NON-NLS-1$
    panel.setCellHeight(slidermap, "258px"); //$NON-NLS-1$

    // Add the small slider bar
    sliderbar = new SliderBar(this);
    panel.add(sliderbar);
    panel.setCellWidth(sliderbar, "40px"); //$NON-NLS-1$
    panel.setCellHeight(sliderbar, "258px"); //$NON-NLS-1$

    // Define the Flextable's content
    // Color preview at the top
    colorpreview = new HTML(""); //$NON-NLS-1$
    colorpreview.setWidth("50px"); //$NON-NLS-1$
    colorpreview.setHeight("50px"); //$NON-NLS-1$
    DOM.setStyleAttribute(colorpreview.getElement(), "border", "1px solid black"); //$NON-NLS-1$ //$NON-NLS-2$

    // Radio buttons
    rbHue = new RadioButton("color", "H:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbHue.addClickListener(this);
    rbSaturation = new RadioButton("color", "S:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbSaturation.addClickListener(this);
    rbBrightness = new RadioButton("color", "V:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbBrightness.addClickListener(this);
    rbRed = new RadioButton("color", "R:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbRed.addClickListener(this);
    rbGreen = new RadioButton("color", "G:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbGreen.addClickListener(this);
    rbBlue = new RadioButton("color", "B:"); //$NON-NLS-1$ //$NON-NLS-2$
    rbBlue.addClickListener(this);

    // Textboxes
    tbHue = new TextBox();
    tbHue.setText(new Integer(hue).toString());
    tbHue.setMaxLength(3);
    tbHue.setVisibleLength(4);
    tbHue.addKeyboardListener(this);
    tbHue.addChangeListener(this);
    tbSaturation = new TextBox();
    tbSaturation.setText(new Integer(saturation).toString());
    tbSaturation.setMaxLength(3);
    tbSaturation.setVisibleLength(4);
    tbSaturation.addKeyboardListener(this);
    tbSaturation.addChangeListener(this);
    tbBrightness = new TextBox();
    tbBrightness.setText(new Integer(brightness).toString());
    tbBrightness.setMaxLength(3);
    tbBrightness.setVisibleLength(4);
    tbBrightness.addKeyboardListener(this);
    tbBrightness.addChangeListener(this);
    tbRed = new TextBox();
    tbRed.setText(new Integer(red).toString());
    tbRed.setMaxLength(3);
    tbRed.setVisibleLength(4);
    tbRed.addKeyboardListener(this);
    tbRed.addChangeListener(this);
    tbGreen = new TextBox();
    tbGreen.setText(new Integer(green).toString());
    tbGreen.setMaxLength(3);
    tbGreen.setVisibleLength(4);
    tbGreen.addKeyboardListener(this);
    tbGreen.addChangeListener(this);
    tbBlue = new TextBox();
    tbBlue.setText(new Integer(blue).toString());
    tbBlue.setMaxLength(3);
    tbBlue.setVisibleLength(4);
    tbBlue.addKeyboardListener(this);
    tbBlue.addChangeListener(this);
    tbHexColor = new TextBox();
    tbHexColor.setText("ff0000"); //$NON-NLS-1$
    tbHexColor.setMaxLength(6);
    tbHexColor.setVisibleLength(6);
    tbHexColor.addKeyboardListener(this);
    tbHexColor.addChangeListener(this);

    // Put together the FlexTable
    table.setWidget(0, 0, colorpreview);
    table.getFlexCellFormatter().setColSpan(0, 0, 3);
    table.setWidget(1, 0, rbHue);
    table.setWidget(1, 1, tbHue);
    table.setWidget(1, 2, new HTML("&deg;")); //$NON-NLS-1$
    table.setWidget(2, 0, rbSaturation);
    table.setWidget(2, 1, tbSaturation);
    table.setText(2, 2, "%"); //$NON-NLS-1$
    table.setWidget(3, 0, rbBrightness);
    table.setWidget(3, 1, tbBrightness);
    table.setText(3, 2, "%"); //$NON-NLS-1$
    table.setWidget(4, 0, rbRed);
    table.setWidget(4, 1, tbRed);
    table.setWidget(5, 0, rbGreen);
    table.setWidget(5, 1, tbGreen);
    table.setWidget(6, 0, rbBlue);
    table.setWidget(6, 1, tbBlue);
    table.setText(7, 0, "#:"); //$NON-NLS-1$
    table.setWidget(7, 1, tbHexColor);
    table.getFlexCellFormatter().setColSpan(7, 1, 2);

    // Final setup
    panel.add(table);
    rbSaturation.setChecked(true);
    setPreview("ff0000"); //$NON-NLS-1$
    DOM.setStyleAttribute(colorpreview.getElement(), "cursor", "default"); //$NON-NLS-1$ //$NON-NLS-2$

    // First event
    onClick(rbSaturation);

    initWidget(panel);
}

From source file:org.pentaho.gwt.widgets.client.filechooser.FileChooser.java

License:Open Source License

public void initUI() {

    if (mode == FileChooserMode.OPEN_READ_ONLY) {
        fileNameTextBox.setReadOnly(true);
    }//from  w w  w.  j a v a2  s  .co m
    // We are here because we are initiating a fresh UI for a new directory
    // Since there is no file selected currently, we are setting file selected to false.
    setFileSelected(false);

    String path = this.selectedPath;

    // find the selected item from the list
    List<String> pathSegments = new ArrayList<String>();
    if (path != null) {
        int index = path.indexOf("/", 0); //$NON-NLS-1$
        while (index >= 0) {
            int oldIndex = index;
            index = path.indexOf("/", oldIndex + 1); //$NON-NLS-1$
            if (index >= 0) {
                pathSegments.add(path.substring(oldIndex + 1, index));
            }
        }
        pathSegments.add(path.substring(path.lastIndexOf("/") + 1)); //$NON-NLS-1$
    }

    selectedTreeItem = getTreeItem(pathSegments);
    navigationListBox = new ListBox();
    navigationListBox.getElement().setId("navigationListBox"); //$NON-NLS-1$
    navigationListBox.setWidth("350px"); //$NON-NLS-1$
    // now we can find the tree nodes who match the path segments
    navigationListBox.addItem("/", "/"); //$NON-NLS-1$ //$NON-NLS-2$

    for (int i = 0; i < pathSegments.size(); i++) {
        String segment = pathSegments.get(i);
        String fullPath = ""; //$NON-NLS-1$
        for (int j = 0; j <= i; j++) {
            String segmentPath = pathSegments.get(j);
            if (segmentPath != null && segmentPath.length() > 0) {
                fullPath += "/" + segmentPath; //$NON-NLS-1$
            }
        }
        if (!fullPath.equals("/")) { //$NON-NLS-1$
            navigationListBox.addItem(fullPath, segment);
        }
    }

    navigationListBox.setSelectedIndex(navigationListBox.getItemCount() - 1);
    navigationListBox.addChangeListener(new ChangeListener() {
        public void onChange(Widget sender) {
            changeToPath(navigationListBox.getItemText(navigationListBox.getSelectedIndex()));
        }
    });

    clear();

    VerticalPanel locationBar = new VerticalPanel();
    locationBar.add(new Label(FileChooserEntryPoint.messages.getString("location"))); //$NON-NLS-1$

    HorizontalPanel navigationBar = new HorizontalPanel();

    final Image upDirImage = new Image();
    upDirImage.setUrl(GWT.getModuleBaseURL() + "images/spacer.gif"); //$NON-NLS-1$
    upDirImage.addStyleName("pentaho-filechooseupbutton"); //$NON-NLS-1$
    upDirImage.setTitle(FileChooserEntryPoint.messages.getString("upOneLevel")); //$NON-NLS-1$
    upDirImage.addMouseListener(new MouseListener() {

        public void onMouseDown(Widget sender, int x, int y) {
        }

        public void onMouseEnter(Widget sender) {
        }

        public void onMouseLeave(Widget sender) {
        }

        public void onMouseMove(Widget sender, int x, int y) {
        }

        public void onMouseUp(Widget sender, int x, int y) {
        }

    });
    upDirImage.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            // go up a dir
            TreeItem tmpItem = selectedTreeItem;
            List<String> parentSegments = new ArrayList<String>();
            while (tmpItem != null) {
                RepositoryFileTree tree = (RepositoryFileTree) tmpItem.getUserObject();
                if (tree.getFile() != null && tree.getFile().getName() != null) {
                    parentSegments.add(tree.getFile().getName());
                }
                tmpItem = tmpItem.getParentItem();
            }
            Collections.reverse(parentSegments);
            String myPath = ""; //$NON-NLS-1$
            // If we have a file selected then we need to go one lesser level deep
            final int loopCount = isFileSelected() ? parentSegments.size() - 2 : parentSegments.size() - 1;
            for (int i = 0; i < loopCount; i++) {
                String pathSegment = parentSegments.get(i);
                if (pathSegment != null && pathSegment.length() > 0) {
                    myPath += "/" + pathSegment; //$NON-NLS-1$
                }
            }
            if (myPath.equals("")) { //$NON-NLS-1$
                myPath = "/"; //$NON-NLS-1$
            }
            selectedTreeItem = selectedTreeItem.getParentItem();
            if (selectedTreeItem == null) {
                selectedTreeItem = repositoryTree.getItem(0);
            }
            changeToPath(myPath);
        }
    });
    navigationBar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    navigationBar.add(navigationListBox);
    navigationBar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    navigationBar.add(upDirImage);
    navigationBar.setCellWidth(upDirImage, "100%"); //$NON-NLS-1$
    DOM.setStyleAttribute(upDirImage.getElement(), "marginLeft", "4px");
    navigationBar.setWidth("100%"); //$NON-NLS-1$

    locationBar.add(navigationBar);
    locationBar.setWidth("100%"); //$NON-NLS-1$

    Label filenameLabel = new Label(FileChooserEntryPoint.messages.getString("filename")); //$NON-NLS-1$
    filenameLabel.setWidth("550px"); //$NON-NLS-1$
    add(filenameLabel);
    fileNameTextBox.setWidth("300px"); //$NON-NLS-1$
    add(fileNameTextBox);
    add(locationBar);
    add(buildFilesList(selectedTreeItem));
}

From source file:org.pentaho.gwt.widgets.client.listbox.DefaultListItem.java

License:Open Source License

private void formatWidget(HorizontalPanel panel) {
    panel.sinkEvents(Event.MOUSEEVENTS);

    if (img != null) {
        Image i = new Image(img.getUrl(), img.getOriginLeft(), img.getOriginTop(), img.getWidth(),
                img.getHeight());//from  w w w  . j  a v  a 2  s .  c om
        panel.add(i);
        panel.setCellVerticalAlignment(i, HasVerticalAlignment.ALIGN_MIDDLE);
        i.getElement().getStyle().setProperty("marginRight", "5px"); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (extraWidget != null) {
        Element ele = DOM.clone(extraWidget.getElement(), true);
        Widget w = new WrapperWidget(ele);
        panel.add(w);
        panel.setCellVerticalAlignment(w, HasVerticalAlignment.ALIGN_MIDDLE);
        w.getElement().getStyle().setProperty("marginRight", "5px"); //$NON-NLS-1$ //$NON-NLS-2$
    }

    Label label = new Label(text);
    label.getElement().getStyle().setProperty("cursor", "pointer"); //$NON-NLS-1$ //$NON-NLS-2$
    label.setWidth("100%"); //$NON-NLS-1$
    SimplePanel sp = new SimplePanel();
    sp.getElement().getStyle().setProperty("overflowX", "auto"); //$NON-NLS-1$ //$NON-NLS-2$
    sp.add(label);

    panel.add(sp);
    panel.setCellWidth(sp, "100%"); //$NON-NLS-1$
    panel.setCellVerticalAlignment(label, HasVerticalAlignment.ALIGN_MIDDLE);

    ElementUtils.preventTextSelection(panel.getElement());

    //    label.setStylePrimaryName("custom-list-item"); //$NON-NLS-1$
    panel.setWidth("100%"); //$NON-NLS-1$
}

From source file:org.pentaho.mantle.client.admin.ChangePasswordDialog.java

License:Open Source License

public Panel getButtonPanel() {
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(acceptBtn);//w ww.j a v  a  2  s.  c  o  m
    hp.setCellWidth(acceptBtn, "100%");
    hp.setCellHorizontalAlignment(acceptBtn, HorizontalPanel.ALIGN_RIGHT);
    hp.add(cancelBtn);
    return hp;
}

From source file:org.pentaho.mantle.client.admin.UserRolesAdminPanel.java

License:Open Source License

private Widget createUsersPanel() {
    HorizontalPanel mainUsersPanel = new HorizontalPanel();
    mainUsersPanel.getElement().setId("admin-users-panel");

    // mainUsersPanel.setWidth("376px");
    SimplePanel hSpacer = new SimplePanel();
    hSpacer.setWidth("15px");
    mainUsersPanel.add(hSpacer);//w ww. ja  v  a 2s  .  com

    VerticalPanel availablePanel = new VerticalPanel();
    mainUsersPanel.add(availablePanel);
    hSpacer = new SimplePanel();
    hSpacer.setHeight("15px");
    availablePanel.add(hSpacer);

    HorizontalPanel labelAndButtonsPanel = new HorizontalPanel();
    labelAndButtonsPanel.setWidth("100%");
    availablePanel.add(labelAndButtonsPanel);
    Label usersColonLabel = new Label(Messages.getString("usersColon"));
    labelAndButtonsPanel.add(usersColonLabel);
    labelAndButtonsPanel.setCellWidth(usersColonLabel, "100%");
    hSpacer = new SimplePanel();
    hSpacer.setWidth("100%");
    labelAndButtonsPanel.add(hSpacer);
    labelAndButtonsPanel.setCellWidth(hSpacer, "100%");
    newUserButton = new ThemeableImageButton(addButtonStyles, null, Messages.getString("new"));
    labelAndButtonsPanel.add(newUserButton);
    hSpacer = new SimplePanel();
    hSpacer.setWidth("7px");
    labelAndButtonsPanel.add(hSpacer);
    deleteUserButton = new ThemeableImageButton(removeButtonStyles, null, Messages.getString("delete"));
    labelAndButtonsPanel.add(deleteUserButton);

    usersListBox = new ListBoxTitle(true);
    usersListBox.addStyleName("users-roles-list");
    HorizontalScrollWrapper usersListBoxWrapper = new HorizontalScrollWrapper(usersListBox);
    availablePanel.add(usersListBoxWrapper);
    availablePanel.setCellHeight(usersListBoxWrapper, "100%");
    usersListBox.setVisibleItemCount(20);

    hSpacer = new SimplePanel();
    hSpacer.setWidth("24px");
    mainUsersPanel.add(hSpacer);

    VerticalPanel detailsPanel = new VerticalPanel();
    mainUsersPanel.add(detailsPanel);
    mainUsersPanel.setCellWidth(detailsPanel, "100%");
    hSpacer = new SimplePanel();
    hSpacer.setHeight("32px");
    detailsPanel.add(hSpacer);

    detailsPanel.add(new Label(Messages.getString("password") + ":"));

    userPasswordTextBox = new PasswordTextBox();
    userPasswordTextBox.setEnabled(false);
    userPasswordTextBox.setWidth("200px");
    HorizontalPanel passwordPanel = new HorizontalPanel();
    passwordPanel.add(userPasswordTextBox);
    hSpacer = new SimplePanel();
    hSpacer.setWidth("10px");
    passwordPanel.add(hSpacer);
    editPasswordButton = new Button(Messages.getString("edit") + "...");
    editPasswordButton.setStylePrimaryName("pentaho-button");
    editPasswordButton.setEnabled(false);
    passwordPanel.add(editPasswordButton);
    detailsPanel.add(passwordPanel);

    hSpacer = new SimplePanel();
    hSpacer.setHeight("15px");
    detailsPanel.add(hSpacer);

    Label roleLabel = new Label(Messages.getString("roles"));
    roleLabel.setStyleName("pentaho-fieldgroup-minor");
    detailsPanel.add(roleLabel);

    hSpacer = new SimplePanel();
    hSpacer.setHeight("15px");
    detailsPanel.add(hSpacer);

    HorizontalPanel groupsPanel = new HorizontalPanel();
    groupsPanel.getElement().setId("groups-panel");
    detailsPanel.add(groupsPanel);

    VerticalPanel availableRolesPanel = new VerticalPanel();
    groupsPanel.add(availableRolesPanel);
    availableRolesPanel.add(new Label(Messages.getString("available") + ":"));
    availableRolesListBox = new ListBoxTitle(true);
    HorizontalScrollWrapper availableRolesListBoxWrapper = new HorizontalScrollWrapper(availableRolesListBox);
    availableRolesPanel.add(availableRolesListBoxWrapper);
    availableRolesListBox.setVisibleItemCount(20);
    availableRolesListBox.addStyleName("users-roles-selection-list");

    VerticalPanel vSpacer = new VerticalPanel();
    vSpacer.setWidth("15px");
    groupsPanel.add(vSpacer);

    VerticalPanel arrowsPanel = new VerticalPanel();
    groupsPanel.add(arrowsPanel);
    arrowsPanel.setWidth("35px");

    hSpacer = new SimplePanel();
    hSpacer.setHeight("110px");
    arrowsPanel.add(hSpacer);

    addRoleButton = new ThemeableImageButton(accumAddButtonStyles, null, null);
    arrowsPanel.add(addRoleButton);
    hSpacer = new SimplePanel();
    hSpacer.setHeight("10px");
    arrowsPanel.add(hSpacer);

    removeRoleButton = new ThemeableImageButton(accumRemoveButtonStyles, null, null);
    arrowsPanel.add(removeRoleButton);
    hSpacer = new SimplePanel();
    hSpacer.setHeight("30px");
    arrowsPanel.add(hSpacer);

    addAllRolesButton = new ThemeableImageButton(accumAddAllButtonStyles, null, null);
    arrowsPanel.add(addAllRolesButton);
    hSpacer = new SimplePanel();
    hSpacer.setHeight("10px");
    arrowsPanel.add(hSpacer);

    removeAllRolesButton = new ThemeableImageButton(accumRemoveAllButtonStyles, null, null);
    arrowsPanel.add(removeAllRolesButton);

    VerticalPanel selectedRolesPanel = new VerticalPanel();
    groupsPanel.add(selectedRolesPanel);
    selectedRolesPanel.add(new Label(Messages.getString("selected") + ":"));
    selectedRolesListBox = new ListBoxTitle(true);
    HorizontalScrollWrapper selectedRolesListBoxWrapper = new HorizontalScrollWrapper(selectedRolesListBox);
    selectedRolesPanel.add(selectedRolesListBoxWrapper);
    selectedRolesListBox.setVisibleItemCount(20);
    selectedRolesListBox.addStyleName("users-roles-selection-list");

    return mainUsersPanel;
}

From source file:org.pentaho.mantle.client.admin.UserRolesAdminPanel.java

License:Open Source License

private Widget createSystemRolesPanel() {
    HorizontalPanel mainSystemRolesPanel = new HorizontalPanel();
    mainSystemRolesPanel.getElement().setId("admin-system-roles-panel");
    SimplePanel hSpacer = new SimplePanel();
    hSpacer.setWidth("15px");
    mainSystemRolesPanel.add(hSpacer);//from   w ww. j  ava  2 s  .  com

    VerticalPanel availablePanel = new VerticalPanel();
    mainSystemRolesPanel.add(availablePanel);
    hSpacer = new SimplePanel();
    hSpacer.setHeight("15px");
    availablePanel.add(hSpacer);

    HorizontalPanel labelAndButtonsPanel = new HorizontalPanel();
    availablePanel.add(labelAndButtonsPanel);
    labelAndButtonsPanel.add(new Label(Messages.getString("rolesColon")));
    labelAndButtonsPanel.setStyleName("pentaho-fieldgroup-minor");

    systemRolesListBox = new ListBoxTitle(true);
    HorizontalScrollWrapper systemRolesListBoxWrapper = new HorizontalScrollWrapper(systemRolesListBox);
    availablePanel.add(systemRolesListBoxWrapper);
    availablePanel.setCellHeight(systemRolesListBoxWrapper, "100%");
    systemRolesListBox.setVisibleItemCount(20);
    systemRolesListBox.addStyleName("users-roles-list");

    hSpacer = new SimplePanel();
    hSpacer.setWidth("24px");
    mainSystemRolesPanel.add(hSpacer);

    VerticalPanel detailsPanel = new VerticalPanel();
    detailsPanel.getElement().setId("details-panel");
    mainSystemRolesPanel.add(detailsPanel);
    mainSystemRolesPanel.setCellWidth(detailsPanel, "100%");

    hSpacer = new SimplePanel();
    hSpacer.setHeight("15px");
    detailsPanel.add(hSpacer);

    //todo check if replacement required
    systemRolesPermissionsPanel = new PermissionsPanel(systemRolesListBox);
    detailsPanel.add(systemRolesPermissionsPanel);
    detailsPanel.setCellHeight(systemRolesPermissionsPanel, "100%");

    return mainSystemRolesPanel;
}