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

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

Introduction

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

Prototype

@Override
public Boolean getValue() 

Source Link

Document

Determines whether this check box is currently checked.

Usage

From source file:org.ednovo.gooru.client.mvp.home.SearchHomeFilterVc.java

License:Open Source License

/**
 * set enabled or disabled for for filters
 * @param filterFlowPanel selected filter panel
 * @param checkedValues selected filter values 
 *//*from  ww  w. ja  v  a  2  s .  c om*/
private void setSelectedFilter(FlowPanel filterFlowPanel, String checkedValues) {
    List<String> items = Arrays.asList(checkedValues.split("\\s*,\\s*"));
    for (Widget filterWidget : filterFlowPanel) {
        if (filterWidget instanceof CheckBox) {
            CheckBox filterCheckBox = (CheckBox) filterWidget;
            for (String item : items) {
                if (filterCheckBox != null && (filterCheckBox.getValue().equals(item))) {
                    filterCheckBox.setEnabled(true);
                }
            }
        }
    }
}

From source file:org.ednovo.gooru.client.mvp.search.SearchFilterVc.java

License:Open Source License

/**
 * Get filters for search/*w ww . ja v  a2 s.  co  m*/
 * @param filterDisclosurePanell instance of {@link DisclosurePanelUc} which has filters widget
 * @param separator concatenation of the filters with separator
 * @return concatenation of selected filters
 */
private String getSelectedFilter(DisclosurePanelUc filterDisclosurePanell, String separator) {
    String selectedFilter = "";
    for (Widget filterWidget : filterDisclosurePanell.getContent()) {
        if (filterWidget instanceof CheckBox) {
            CheckBox filterCheckBox = (CheckBox) filterWidget;
            if (filterCheckBox != null && filterCheckBox.getValue()) {
                if (!selectedFilter.isEmpty()) {
                    selectedFilter += separator;
                }
                selectedFilter += filterCheckBox.getName();
                MixpanelUtil.mixpanelEvent("search_" + selectedFilter + "_filter_selected");
            }
        }
    }

    return selectedFilter;
}

From source file:org.eurekastreams.web.client.ui.common.stream.FollowDialogContent.java

License:Apache License

/**
 * Default constructor./*from  ww w.ja  v a2  s.co m*/
 *
 * @param inStreamName
 *            the stream name.
 * @param streamRequest
 *            the stream request.
 * @param inStreamId
 *            the stream id.
 * @param inSubscribeModel
 *            Model for subscribing to activity on the stream.
 * @param inEntityUniqueId
 *            Unique ID of entity owning the stream.
 * @param streamType
 *            Type of entity of the stream.
 */
public FollowDialogContent(final String inStreamName, final String streamRequest, final Long inStreamId,
        final EntityType streamType, final BaseActivitySubscriptionModel inSubscribeModel,
        final String inEntityUniqueId) {
    Label saveButton = new Label("");
    Label closeButton = new Label("No Thanks");

    closeButton.addClickHandler(new ClickHandler() {
        public void onClick(final ClickEvent event) {
            close();
        }
    });

    body.add(new Label("You are now following the:"));

    Label streamTitle = new Label(inStreamName + " Stream");
    streamTitle.addStyleName(StaticResourceBundle.INSTANCE.coreCss().title());

    body.add(streamTitle);

    body.add(new Label("Below are additional ways to subscribe:"));

    FlowPanel options = new FlowPanel();
    options.addStyleName(StaticResourceBundle.INSTANCE.coreCss().followDialogOptions());

    final CheckBox addToStartPage = new CheckBox("Add this Stream to my Start Page");
    final CheckBox bookmarkStream = new CheckBox("Bookmark this stream");
    final CheckBox notifyViaEmail = new CheckBox("Notify me via Email");

    saveButton.addClickHandler(new ClickHandler() {
        public void onClick(final ClickEvent event) {
            if (addToStartPage.getValue()) {
                // For the app's location, use the current URL minus a few parameters we know we don't want. (They
                // are used by other lists, but get left in the URL when switching tabs.)
                // We don't build the URL from the stream id, since that doesn't take search terms into account.
                HashMap<String, String> params = new HashMap<String, String>();
                params.put("listId", null);
                params.put("listFilter", null);
                params.put("listSort", null);
                params.put("startIndex", null);
                params.put("endIndex", null);
                String url = Session.getInstance().generateUrl(new CreateUrlRequest(params));

                String prefs = "{\"streamQuery\":"
                        + WidgetJSNIFacadeImpl
                                .makeJsonString(STREAM_URL_TRANSFORMER.getUrl(null, streamRequest))
                        + ",\"gadgetTitle\":" + WidgetJSNIFacadeImpl.makeJsonString(inStreamName)
                        + ",\"streamLocation\":" + WidgetJSNIFacadeImpl.makeJsonString(url) + "}";

                GadgetModel.getInstance()
                        .insert(new AddGadgetToStartPageRequest("{d7a58391-5375-4c76-b5fc-a431c42a7555}", null,
                                STREAM_URL_TRANSFORMER.getUrl(null, prefs)));
            }

            if (bookmarkStream.getValue()) {
                StreamBookmarksModel.getInstance().insert(inStreamId);
            }

            if (notifyViaEmail.getValue()) {
                inSubscribeModel.update(inEntityUniqueId, true,
                        EntityType.GROUP == streamType ? subscribeCoordButton.getValue() : false);
            }

            close();
        }
    });

    options.add(addToStartPage);
    options.add(bookmarkStream);

    if (EntityType.GROUP == streamType) {
        Panel panel = new FlowPanel();
        panel.add(notifyViaEmail);
        subscribeAllButton = new RadioButton("whichPosts", "All posts to this stream");
        subscribeAllButton.setValue(true);
        subscribeAllButton.setEnabled(false);
        subscribeCoordButton = new RadioButton("whichPosts", "Only posts from coordinators of this stream");
        subscribeCoordButton.setEnabled(false);
        panel.add(subscribeAllButton);
        panel.add(subscribeCoordButton);
        options.add(panel);

        notifyViaEmail.addClickHandler(new ClickHandler() {
            public void onClick(final ClickEvent inEvent) {
                boolean checked = notifyViaEmail.getValue();
                subscribeAllButton.setEnabled(checked);
                subscribeCoordButton.setEnabled(checked);
            }
        });
    } else {
        options.add(notifyViaEmail);
    }

    body.add(options);

    FlowPanel buttonPanel = new FlowPanel();
    buttonPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().followDialogButtonPanel());

    saveButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().saveChangesButton());
    buttonPanel.add(saveButton);
    buttonPanel.add(closeButton);

    body.add(buttonPanel);

    container.add(body);

    Label tipsTitle = new Label("Tips");
    tips.add(tipsTitle);

    tips.add(new Label(
            "These options allow you to have control over how to access the activity of this stream."));
    tips.add(new Label(
            "Don't worry, these selections are not permanent.  You can always change them in the future."));

    container.add(tips);

    body.addStyleName(StaticResourceBundle.INSTANCE.coreCss().followDialogBody());
    tips.addStyleName(StaticResourceBundle.INSTANCE.coreCss().followDialogTips());

}

From source file:org.freemedsoftware.gwt.client.screen.ACLScreen.java

License:Open Source License

public HashMap<String, List> populateAllPermissions() {
    HashMap<String, List> allPermiHashMap = new HashMap<String, List>();

    final Iterator<String> aclPermissionsMapItr = aclPermissionsMap.keySet().iterator();

    int permissionAddedCounter = 0;
    while (aclPermissionsMapItr.hasNext()) {
        String sectionWithValue = aclPermissionsMapItr.next();
        CheckBox checkBox = aclPermissionsMap.get(sectionWithValue);
        if (checkBox.getValue()) {
            String section = sectionWithValue.substring(0, sectionWithValue.indexOf(":"));
            List sectionValues = allPermiHashMap.get(section);
            if (sectionValues == null)
                sectionValues = new ArrayList();
            sectionValues.add(checkBox.getText());
            allPermiHashMap.put(section, sectionValues);
            permissionAddedCounter++;/*from  w w  w . j  a v a 2 s. c  o  m*/
        }
    }

    return allPermiHashMap;
}

From source file:org.freemedsoftware.gwt.client.screen.CallInScreen.java

License:Open Source License

protected void handleClickForItemCheckbox(Integer item, CheckBox c) {
    // Add or remove from itemlist
    if (c.getValue()) {
        // selectedItems.add((Integer) item);
        callInTable.selectionAdd(item.toString());
    } else {//  w  w w  . jav a2s  .  c  om
        // selectedItems.remove((Object) item);
        callInTable.selectionRemove(item.toString());
    }
}

From source file:org.freemedsoftware.gwt.client.screen.CallInScreen.java

License:Open Source License

protected void initSearchPopup() {
    if (searchDialogBox == null) {
        searchDialogBox = new CustomDialogBox();
        FlexTable flexTable = new FlexTable();

        int row = 0;

        final Label firstLastNameLabel = new Label(_("Name (Last, First)") + ":");
        flexTable.setWidget(row, 0, firstLastNameLabel);
        final TextBox lastName = new TextBox();
        flexTable.setWidget(row, 1, lastName);
        final TextBox firstName = new TextBox();
        flexTable.setWidget(row, 2, firstName);

        row++;//from  w  w  w .  ja va  2s  .co m

        final Label fullNameLabel = new Label(_("Call-In Patient") + ":");
        flexTable.setWidget(row, 0, fullNameLabel);
        final SupportModuleWidget fullName = new SupportModuleWidget("Callin");
        flexTable.setWidget(row, 1, fullName);

        final CheckBox showArchived = new CheckBox(_("Include Archived") + ":");
        flexTable.setWidget(row, 2, showArchived);
        showArchived.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
            @Override
            public void onValueChange(ValueChangeEvent<Boolean> event) {
                if (event.getValue()) {
                    HashMap<String, String> args = new HashMap<String, String>();
                    args.put("ciarchive", "1");
                    fullName.setAdditionalParameters(args);
                } else
                    fullName.setAdditionalParameters(null);
            }
        });

        row++;

        final CustomButton searchBTN = new CustomButton(_("Search"), AppConstants.ICON_SEARCH);
        flexTable.setWidget(row, 1, searchBTN);
        searchCriteria = null;
        searchBTN.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                searchCriteria = new HashMap<String, String>();
                if (lastName.getText().trim().length() > 0)
                    searchCriteria.put("cilname", lastName.getText());
                if (firstName.getText().trim().length() > 0)
                    searchCriteria.put("cifname", firstName.getText());
                if (fullName.getValue() > 0)
                    searchCriteria.put("id", fullName.getValue().toString());
                if (showArchived.getValue())
                    searchCriteria.put("ciarchive", showArchived.getValue() ? "1" : "0");
                populate(searchCriteria);

                searchDialogBox.hide();
            }

        });

        searchDialogBox.setContent(flexTable);
    }
    searchDialogBox.show();
    searchDialogBox.center();

}

From source file:org.freemedsoftware.gwt.client.screen.MessagingScreen.java

License:Open Source License

protected void handleClickForItemCheckbox(Integer item, CheckBox c) {
    // Add or remove from itemlist
    if (c.getValue()) {
        selectedItems.add((Integer) item);
        wMessages.selectionAdd(item.toString());
    } else {// w  w w .ja  va  2  s  .c  o  m
        selectedItems.remove((Object) item);
        wMessages.selectionRemove(item.toString());
    }
}

From source file:org.freemedsoftware.gwt.client.screen.ModuleFieldCheckerTypeEntryScreen.java

License:Open Source License

public ModuleFieldCheckerTypeEntryScreen() {
    super("admin");
    final VerticalPanel containerAllVerticalPanel = new VerticalPanel();
    initWidget(containerAllVerticalPanel);

    final HorizontalPanel tabViewPanel = new HorizontalPanel();
    final CheckBox tabView = new CheckBox();
    tabView.setText("Tab View");
    tabView.setValue(true);/*from  w w  w  .ja  v a2 s. c  om*/
    tabViewPanel.add(tabView);

    tabView.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
            switchView(tabView.getValue());
        }
    });

    containerAllVerticalPanel.add(tabViewPanel);

    tabPanel = new TabPanel();
    containerAllVerticalPanel.add(tabPanel);

    containerVerticalPanel = new VerticalPanel();
    containerAllVerticalPanel.add(containerVerticalPanel);

    initWorkFlowTypeForm();

    initWorkFlowList();

    if (canWrite)
        tabPanel.selectTab(1);
    else
        tabPanel.selectTab(0);
}

From source file:org.freemedsoftware.gwt.client.screen.ModuleFieldCheckerTypeEntryScreen.java

License:Open Source License

public String getFields() {
    String selectedModuleFields = "";
    for (int i = 0; i < fieldsList.size(); i++) {

        CheckBox ch = fieldsList.get(i);
        if (ch.getValue())
            selectedModuleFields += ch.getText() + ",";
    }/*from w  w w . j a v  a 2  s .  c  o m*/
    return selectedModuleFields;
}

From source file:org.freemedsoftware.gwt.client.screen.patient.ScannedDocumentsEntryScreen.java

License:Open Source License

public ScannedDocumentsEntryScreen() {
    super(SCANNED_DOCUMENT);
    final VerticalPanel containerAllVerticalPanel = new VerticalPanel();
    initWidget(containerAllVerticalPanel);

    final HorizontalPanel tabViewPanel = new HorizontalPanel();
    final CheckBox tabView = new CheckBox();
    tabView.setText(_("Tab View"));
    tabView.setValue(true);/* w  w w  .j  av a  2s.c  o  m*/
    tabViewPanel.add(tabView);

    tabView.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
            switchView(tabView.getValue());
        }
    });

    containerAllVerticalPanel.add(tabViewPanel);

    tabPanel = new TabPanel();
    containerAllVerticalPanel.add(tabPanel);

    containerVerticalPanel = new VerticalPanel();
    containerAllVerticalPanel.add(containerVerticalPanel);

    initClinicalAssesmentForm();

    initClinicalAssesmentList();

    if (canWrite)
        tabPanel.selectTab(1);
    else
        tabPanel.selectTab(0);
}