Example usage for com.google.gwt.user.client.ui CheckBox setWordWrap

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

Introduction

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

Prototype

@Override
    public void setWordWrap(boolean wrap) 

Source Link

Usage

From source file:edu.colorado.csdms.wmt.client.ui.menu.LabelsMenu.java

License:Open Source License

/**
 * A helper that loads the {@link LabelsMenu} with {@link CheckBox} labels.
 * Each CheckBox has a handler that maps the selection state of the box to the
 * labels variable stored in the {@link DataManager}.
 *//*from   w  ww  . j  a v  a2s  .  c  o m*/
public void populateMenu() {
    labelPanel.clear();
    for (Map.Entry<String, LabelJSO> entry : data.modelLabels.entrySet()) {
        CheckBox labelBox = new CheckBox(entry.getKey());
        labelBox.setWordWrap(false);
        labelBox.setStyleName("wmt-PopupPanelCheckBoxItem");
        labelBox.setValue(entry.getValue().isSelected());
        if (!data.security.getWmtUsername().equals(entry.getValue().getOwner())) {
            labelBox.addStyleDependentName("public");
        }
        labelBox.addClickHandler(new LabelSelectionHandler(data, entry));

        // Add each labelBox to the labelPanel. Force the "public" label to the 
        // top; suppress the username label.
        if (entry.getKey().equals("public")) {
            labelBox.addStyleDependentName("header");
            labelPanel.insert(labelBox, 0);
        } else {
            if (!entry.getKey().equals(data.security.getWmtUsername())) {
                labelPanel.add(labelBox);
            }
        }
    }
}

From source file:edu.colorado.csdms.wmt.client.ui.menu.LabelsOpenModelMenu.java

License:Open Source License

/**
 * A helper that loads the {@link LabelsOpenModelMenu} with {@link CheckBox}
 * labels. Each CheckBox has a handler that maps the selection state of the
 * labels menu to the droplist in the {@link OpenDialogBox}.
 *///from w  w  w .j av a 2 s.c  o m
public void populateMenu() {
    labelPanel.clear();
    for (Map.Entry<String, LabelJSO> entry : data.modelLabels.entrySet()) {
        CheckBox labelBox = new CheckBox(entry.getKey());
        labelBox.setWordWrap(false);
        labelBox.setStyleName("wmt-PopupPanelCheckBoxItem");
        if (!data.security.getWmtUsername().equals(entry.getValue().getOwner())) {
            labelBox.addStyleDependentName("public");
        }
        labelBox.addClickHandler(new LabelSelectionHandler());

        // Force the "public" and username labels to the top, in either order.
        if (entry.getKey().equals("public") || entry.getKey().equals(data.security.getWmtUsername())) {
            labelBox.addStyleDependentName("header");
            labelPanel.insert(labelBox, 0);
        } else {
            labelPanel.add(labelBox);
        }

        // Select the username label, by default.
        if (entry.getKey().equals(data.security.getWmtUsername())) {
            labelBox.setValue(true);
            entry.getValue().isSelected(true);
            selectedLabelIds.add(entry.getValue().getId());
        }
    }
}

From source file:org.pentaho.mantle.client.solutionbrowser.fileproperties.GeneralPanel.java

License:Open Source License

/**
 * Accept metadata response object and parse for use in General panel
 * //from  w  w  w  .j a va  2 s .  c  o  m
 * @param response
 */
protected void setMetadataResponse(Response response) {
    JSONObject json = (JSONObject) JSONParser.parseLenient(response.getText());
    if (json != null) {
        JSONArray arr = (JSONArray) json.get("stringKeyStringValueDto");
        for (int i = 0; i < arr.size(); i++) {
            JSONValue arrVal = arr.get(i);
            String key = arrVal.isObject().get("key").isString().stringValue();
            if (key != null && SolutionBrowserPanel.getInstance().isAdministrator()) {
                if (key.equals(org.pentaho.platform.api.repository2.unified.RepositoryFile.SCHEDULABLE_KEY)
                        && !fileSummary.isFolder()
                        || key.equals(org.pentaho.platform.api.repository2.unified.RepositoryFile.HIDDEN_KEY)) {
                    String value = arrVal.isObject().get("value").isString().stringValue();
                    if (key.startsWith(METADATA_PERM_PREFIX)) {
                        JSONObject nv = new JSONObject();
                        nv.put(key, new JSONString(value));
                        metadataPerms.add(nv);
                    }
                }
            }
        }
        for (final JSONObject nv : metadataPerms) {
            Set<String> keys = nv.keySet();
            for (final String key : keys) {
                if (key != null && SolutionBrowserPanel.getInstance().isAdministrator()) {
                    if (key.equals(org.pentaho.platform.api.repository2.unified.RepositoryFile.SCHEDULABLE_KEY)
                            && !fileSummary.isFolder()
                            || key.equals(
                                    org.pentaho.platform.api.repository2.unified.RepositoryFile.HIDDEN_KEY)) {
                        final CheckBox cb = new CheckBox(
                                Messages.getString(key.substring(METADATA_PERM_PREFIX.length()).toLowerCase()));
                        cb.setWordWrap(false);
                        cb.setValue(Boolean.parseBoolean(nv.get(key).isString().stringValue()));
                        cb.addClickHandler(new ClickHandler() {
                            @Override
                            public void onClick(ClickEvent event) {
                                dirty = true;
                                nv.put(key, new JSONString(cb.getValue().toString()));
                            }
                        });
                        metadataPermsPanel.add(cb);
                    }
                }
            }
        }
    }
}