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

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

Introduction

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

Prototype

@Override
public void setValue(Boolean value) 

Source Link

Document

Checks or unchecks the check box.

Usage

From source file:org.ednovo.gooru.client.mvp.gsearch.SearchAbstractView.java

License:Open Source License

/**
  * Remove the selected search filter and search results when user click on 'X'.
  * @param filterNamePanel {@link HTMLPanel}
  * @param filterName {@link String} grade/subject search filter name
  *///from   w  w w.  j a va  2  s.co m
private void removeSelectedFilter(PPanel filterNamePanel, String filterName) {
    for (int i = 0; i < filterNamePanel.getWidgetCount(); i++) {
        Widget filterWidget = filterNamePanel.getWidget(i);
        if (filterWidget instanceof CheckBox) {
            CheckBox filterCheckBox = (CheckBox) filterWidget;
            if ((filterCheckBox.getName().equals(filterName))) {
                filterCheckBox.setValue(false);
            }
        }
    }
    callSearch();
}

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

License:Open Source License

/**
 * Set filter value for search with separator
 * @param filterFlowPanel instance of {@link DisclosurePanelUc} which has filter values
 * @param checkedValues selected filter value
 * @param separator concatenation of the filter value by separator 
 *//*from w  w w  .  j  a va2s .  c  o m*/
private void setSelectedFilter(DisclosurePanelUc filterFlowPanel, String checkedValues, String separator) {
    List<String> items = null;
    if (checkedValues != null) {
        items = Arrays.asList(checkedValues.split("\\s*" + separator + "\\s*"));
    }

    if (items != null) {
        //if(resourceSearch){
        for (Widget filterWidget : filterFlowPanel.getContent()) {
            if (filterWidget instanceof CheckBox) {
                CheckBox filterCheckBox = (CheckBox) filterWidget;
                filterCheckBox.setValue(false);
                for (String item : items) {
                    if ((filterCheckBox.getName().equals(item))) {
                        filterCheckBox.setValue(true);
                    }
                }
            }
        }
        //}
        /*         else{
                    boolean isRadioButtonSelected=false;
                    for (Widget filterWidget : filterFlowPanel.getContent()) {
                       if (filterWidget instanceof QuestionTypeFilter) {
          QuestionTypeFilter questionTypeFilter = (QuestionTypeFilter) filterWidget;
          //filterCheckBox.setValue(false);
          questionTypeFilter.radioButton.setStyleName(SearchMoreInfoVcCBundle.INSTANCE.css().questionRadioButton());
          questionTypeFilter.hiddenRadioButton.setValue(false);
          for (String item : items) {
             if ((questionTypeFilter.hiddenRadioButton.getText().equals(item))) {
                questionTypeFilter.hiddenRadioButton.setValue(true);
                isRadioButtonSelected=true;
                questionTypeFilter.radioButton.setStyleName(SearchMoreInfoVcCBundle.INSTANCE.css().questionRadioButtonSelected());
             }
          }
                       }
                    }
        //            if(!isRadioButtonSelected){
        //               QuestionTypeFilter questionTypeFilter = (QuestionTypeFilter)filterFlowPanel.getContent().getWidget(2);
        //               questionTypeFilter.hiddenRadioButton.setValue(true);
        //               questionTypeFilter.radioButton.setStyleName(SearchMoreInfoVcCBundle.INSTANCE.css().questionRadioButtonSelected());
        //            }
                            
                 }*/

    }

}

From source file:org.eobjects.datacleaner.monitor.shared.widgets.StringParameterizedMetricTextBox.java

License:Open Source License

public StringParameterizedMetricTextBox(String text, final CheckBox checkBoxToActivate,
        SuggestOracle suggestOracle) {/*  w  ww .j  a va2 s  .  c om*/
    super(suggestOracle);
    addStyleName("StringParameterizedMetricTextBox");
    setText(text);

    getValueBox().addFocusHandler(new FocusHandler() {
        @Override
        public void onFocus(FocusEvent event) {
            showSuggestionList();
        }
    });

    if (checkBoxToActivate != null) {
        getValueBox().addKeyUpHandler(new KeyUpHandler() {
            @Override
            public void onKeyUp(KeyUpEvent event) {
                final String text = getText();
                if (text != null && !"".equals(text)) {
                    // activate checkbox whenever something is written.
                    checkBoxToActivate.setValue(true);
                }
            }
        });
    }
}

From source file:org.eurekastreams.web.client.ui.common.notification.NotificationSettingsWidget.java

License:Apache License

/**
 * Builds the personal/group grid for notification preferences.
 *
 * @param notifiers/*ww w. j av a 2 s .  co  m*/
 *            List of notifiers.
 * @param categories
 *            Names and enum values of the notification preference categories to include in this grid.
 * @param filters
 *            User's current notification preferences.
 * @return Grid.
 */
private Grid buildNotificationFilterGrid(final Map<String, String> notifiers,
        final Map<String, String> categories, final Collection<NotificationFilterPreferenceDTO> filters) {
    Grid grid = settingsGrid;
    grid.resize(1 + categories.size(), 1 + notifiers.size());

    // display each category name (one per row)
    int row = 0;
    for (String categoryName : categories.values()) {
        row++;
        grid.setText(row, 0, categoryName);
    }

    // display each notifier column
    int col = 0;
    for (Map.Entry<String, String> entry : notifiers.entrySet()) {
        col++;
        final String notifierType = entry.getKey();

        // display the names of the notifiers
        grid.setText(0, col, entry.getValue());
        grid.getColumnFormatter().addStyleName(col, style.gridColumn());

        // create the checkboxes for that notifier per category
        row = 0;
        for (String category : categories.keySet()) {
            row++;

            CheckBox checkBox = new CheckBox();
            checkBox.setValue(true);
            grid.setWidget(row, col, checkBox);
            checkboxIndex.put(new NotificationFilterPreferenceDTO(notifierType, category), checkBox);
        }
    }

    // uncheck checkboxes for suppressed entries
    for (NotificationFilterPreferenceDTO pref : filters) {
        pref.setPersonId(0);
        HasValue<Boolean> checkBox = checkboxIndex.get(pref);
        if (checkBox != null) {
            checkBox.setValue(false);
        }
    }

    return grid;
}

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

License:Open Source License

public CallInScreen() {
    super(ModuleName);
    final boolean canBook = CurrentState.isActionAllowed(SchedulerWidget.moduleName, AppConstants.WRITE);

    final HorizontalPanel horizontalPanel = new HorizontalPanel();
    initWidget(horizontalPanel);/*w ww .j av  a  2 s  . c  om*/
    horizontalPanel.setSize("100%", "100%");

    final VerticalPanel verticalPanel = new VerticalPanel();
    horizontalPanel.add(verticalPanel);
    verticalPanel.setSize("100%", "100%");

    tabPanel = new TabPanel();
    tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
            // TODO Auto-generated method stub
            if (event.getSelectedItem() == 1 && formSelection.getWidgetValue().equals("Basic"))
                ((TextBox) basicFormFields.get("cifname")).setFocus(true);
        }
    });
    verticalPanel.add(tabPanel);

    /*
     * final Label callInLabel = new Label("Call-in Patient Management.");
     * verticalPanelMenu.add(callInLabel);
     * callInLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
     */

    final HorizontalPanel headerHPanel = new HorizontalPanel();
    headerHPanel.setWidth("100%");
    verticalPanelMenu.add(headerHPanel);

    final HorizontalPanel menuButtonsPanel = new HorizontalPanel();
    menuButtonsPanel.setSpacing(1);
    headerHPanel.add(menuButtonsPanel);
    if (canDelete || canWrite || canBook) {
        final CustomButton selectAllButton = new CustomButton(_("Select All"), AppConstants.ICON_SELECT_ALL);
        menuButtonsPanel.add(selectAllButton);
        selectAllButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent wvt) {
                Iterator<CheckBox> iter = checkboxStack.keySet().iterator();
                while (iter.hasNext()) {
                    CheckBox t = iter.next();
                    t.setValue(true);
                    callInTable.selectionAdd(checkboxStack.get(t).toString());
                    // }
                }
            }
        });
    }
    if (canDelete || canWrite || canBook) {
        final CustomButton selectNoneButton = new CustomButton(_("Select None"), AppConstants.ICON_SELECT_NONE);
        menuButtonsPanel.add(selectNoneButton);
        selectNoneButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                clearSelection();
            }
        });
    }

    if (canDelete) {
        final CustomButton deleteButton = new CustomButton(_("Delete"), AppConstants.ICON_DELETE);
        menuButtonsPanel.add(deleteButton);
        deleteButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                if (callInTable.getSelectedCount() < 1)
                    Window.alert(_("Please select at least one entry!"));
                else if (Window.confirm(_("Are you sure you want to delete these item(s)?"))) {
                    List<String> slectedItems = callInTable.getSelected();
                    Iterator<String> itr = slectedItems.iterator();// Get all
                    // selected
                    // items
                    // from
                    // custom
                    // table
                    int totalItems = slectedItems.size();
                    int curItem = 1;
                    while (itr.hasNext())
                        deleteEntry(Integer.parseInt(itr.next()), curItem++, totalItems);// delete
                    // messages
                    // one by
                    // one
                }
            }
        });
    }
    if (canWrite) {
        final CustomButton enterButton = new CustomButton(_("Create Patient"), AppConstants.ICON_ADD_PERSON);
        menuButtonsPanel.add(enterButton);
        enterButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                if (callInTable.getSelectedCount() < 1)
                    Window.alert(_("Please select at least one entry!"));
                else if (callInTable.getSelectedCount() > 1)
                    Window.alert(_("You can create only a single patient at a time!"));
                else {
                    List<String> slectedItems = callInTable.getSelected();
                    Integer id = Integer.parseInt(slectedItems.get(0));
                    final HashMap<String, String> data = callInTable.getDataById(id);
                    if (data.get("archive") == null || data.get("archive").compareTo("0") == 0) {
                        //                     openPatientForm(id,getCallInScreen());
                        callinConvertFromPatient(id, new CustomCommand() {
                            @Override
                            public void execute(Object id) {
                                populate(null);
                                Util.spawnPatientScreen((Integer) id, data.get("name"));
                            }

                        });
                    } else {
                        Window.alert(_("You can't create patient of archived enteries!"));
                    }
                }
            }
        });
    }

    if (canBook) {
        final CustomButton bookButton = new CustomButton(_("Book"), AppConstants.ICON_BOOK_APP);
        menuButtonsPanel.add(bookButton);
        bookButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                if (callInTable.getSelectedCount() < 1)
                    Window.alert(_("Please select at least one entry!"));
                else if (callInTable.getSelectedCount() > 1)
                    Window.alert(_("You can book only a single appointment at a time!"));
                else {
                    List<String> slectedItems = callInTable.getSelected();
                    Integer id = Integer.parseInt(slectedItems.get(0));
                    HashMap<String, String> data = callInTable.getDataById(id);
                    if (data.get("archive") == null || data.get("archive").compareTo("0") == 0) {
                        SchedulerScreen schedulerScreen = SchedulerScreen.getInstance();
                        EventData eventData = schedulerScreen.getSchedulerWidget().getNewExternalDataEvent();
                        eventData.setPatientId(id);
                        if (data.get("provider") != null)
                            eventData.setProviderId(Integer.parseInt(data.get("provider")));
                        eventData.setResourceType(AppConstants.APPOINTMENT_TYPE_CALLIN_PATIENT);
                        schedulerScreen.getSchedulerWidget().setExternalDataEvent(eventData);
                        Util.spawnTab(AppConstants.SCHEDULER, schedulerScreen);
                    } else {
                        Window.alert(_("You can't book archived enteries!"));
                    }

                }
            }
        });

        if (canModify) {
            final CustomButton modifyButton = new CustomButton(_("Modify"), AppConstants.ICON_MODIFY);
            menuButtonsPanel.add(modifyButton);
            modifyButton.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent evt) {
                    if (callInTable.getSelectedCount() < 1)
                        Window.alert(_("Please select an entry!"));
                    else if (callInTable.getSelectedCount() > 1)
                        Window.alert(_("You can modify only a single entry at a time!"));
                    else {
                        List<String> slectedItems = callInTable.getSelected();
                        Integer id = Integer.parseInt(slectedItems.get(0));
                        selectedEntryId = id;
                        HashMap<String, String> data = callInTable.getDataById(id);
                        if (data.get("archive") == null || data.get("archive").compareTo("0") == 0) {
                            tabPanel.selectTab(1);
                            selectedEntryId = id;
                            modifyEntry(selectedEntryId);
                        } else {
                            Util.confirm(_(
                                    "You can not modify an archived record. Do you want to un-archive this record?"),
                                    new Command() {

                                        @Override
                                        public void execute() {
                                            // TODO Auto-generated method stub
                                            unarchiveEntry(selectedEntryId);
                                        }
                                    }, null);
                        }
                    }
                }
            });
        }

    }

    if (canWrite) {
        final CustomButton addEventButton = new CustomButton(_("Add Event"), AppConstants.ICON_ADD);
        menuButtonsPanel.add(addEventButton);
        addEventButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                if (callInTable.getSelectedCount() < 1)
                    Window.alert(_("Please select an entry!"));
                else if (callInTable.getSelectedCount() > 1)
                    Window.alert(_("You can modify only a single entry at a time!"));
                else {
                    List<String> slectedItems = callInTable.getSelected();
                    Integer id = Integer.parseInt(slectedItems.get(0));
                    HashMap<String, String> data = callInTable.getDataById(id);
                    String name = null;
                    if (data != null && data.get("name") != null) {
                        name = data.get("name");
                    }
                    openAddEventForm(id, name);
                }
            }
        });
    }

    if (canRead) {
        final CustomButton searchButton = new CustomButton(_("Search"), AppConstants.ICON_SEARCH);
        menuButtonsPanel.add(searchButton);
        searchButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                initSearchPopup();
            }
        });
    }

    callInTable = new CustomTable();
    verticalPanelMenu.add(callInTable);
    callInTable.setAllowSelection(false);
    callInTable.setSize("100%", "100%");
    // //what for is this used???To work on this
    callInTable.setIndexName("id");
    // ///
    if (canDelete || canWrite || canBook)
        callInTable.addColumn("", "selected");
    callInTable.addColumn(_("Date"), "call_date_mdy");
    callInTable.addColumn(_("Name"), "name");
    callInTable.addColumn(_("Contact Phone"), "contact_phone");
    callInTable.addColumn(_("Coverage"), "coverage");
    callInTable.addColumn(_("Complaint"), "complaint");

    callInTable.setTableRowClickHandler(new TableRowClickHandler() {
        @Override
        public void handleRowClick(HashMap<String, String> data, int col) {
            try {
                if (col != 0 || !(canBook || canWrite || canDelete)) {
                    final Integer callinId = Integer.parseInt(data.get("id"));
                    showCallinInfo(callinId);

                }
            } catch (Exception e) {
                GWT.log("Caught exception: ", e);
            }
        }
    });

    callInTable.setTableWidgetColumnSetInterface(new TableWidgetColumnSetInterface() {
        public Widget setColumn(String columnName, HashMap<String, String> data) {
            Integer id = Integer.parseInt(data.get("id"));
            if (columnName.compareTo("selected") == 0) {
                CheckBox c = new CheckBox();
                c.addClickHandler(getCallInScreen());
                checkboxStack.put(c, id);
                return c;
            } else if (data.get("archive") != null && data.get("archive").compareTo("1") == 0) {
                Label label = new Label(data.get(columnName));
                label.setStyleName(AppConstants.STYLE_LABEL_ALERT);
                return label;
            }
            return (Widget) null;
        }
    });

    tabPanel.add(verticalPanelMenu, _("Menu"));
    if (canWrite) {
        //         tabPanel.add(createEntryTabBar(), "Entry");
        entryVPanel = new VerticalPanel();
        tabPanel.add(entryVPanel, _("Entry"));
        final HorizontalPanel selectionHPanel = new HorizontalPanel();
        selectionHPanel.setStyleName(AppConstants.STYLE_LABEL_HEADER_SMALL);
        entryVPanel.add(selectionHPanel);
        selectionHPanel.setSpacing(5);
        final Label selectionLabel = new Label(_("Select Form Type") + ":");
        selectionHPanel.add(selectionLabel);
        formSelection = new CustomListBox();
        selectionHPanel.add(formSelection);
        formSelection.addItem("", "");
        formSelection.addItem(_("Basic Entry Form"), "Basic");
        formSelection.addChangeHandler(new ChangeHandler() {
            public void onChange(ChangeEvent arg0) {
                handleFormSelection();
            }
        });
    }
    // tabPanel.add(new VerticalPanel(),"Entry");
    tabPanel.selectTab(0);
    // createEntryTabBar();

    // callInTable.formatTable(5);
    // callInTable.getFlexTable().setWidth("100%");

    // //////
    populate(null);
}

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

License:Open Source License

protected void clearSelection() {
    Iterator<CheckBox> iter = checkboxStack.keySet().iterator();
    while (iter.hasNext()) {
        CheckBox t = iter.next();
        t.setValue(false);
        callInTable.selectionRemove(checkboxStack.get(t).toString());
    }/*from www  . j  a  v a 2 s.  c  o  m*/
}

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

License:Open Source License

private MessagingScreen() {
    super(moduleName);
    final VerticalPanel verticalPanel = new VerticalPanel();
    initWidget(verticalPanel);/*from  w ww .  j  a  v a  2s.  c om*/
    final HorizontalPanel horizontalPanel = new HorizontalPanel();
    verticalPanel.add(horizontalPanel);

    if (canRead) {
        horizontalPanel.add(messageTagSelect);
        messageTagSelect.addChangeHandler(new ChangeHandler() {
            @Override
            public void onChange(ChangeEvent event) {
                try {
                    String effective = messageTagSelect.getWidgetValue();
                    wMessages.clearAllSelections();
                    populate(effective);
                } catch (Exception ex) {
                    Window.alert(ex.toString());
                }
            }
        });
    }

    if (canWrite) {
        final CustomButton composeButton = new CustomButton(_("Compose"), AppConstants.ICON_COMPOSE_MAIL);
        horizontalPanel.add(composeButton);
        composeButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                final MessagingComposeScreen p = new MessagingComposeScreen();
                p.setParentScreen(getMessagingScreen());
                CurrentState.getTabPanel().add(p, new ClosableTab(_("Compose Message"), p));
                CurrentState.getTabPanel().selectTab(CurrentState.getTabPanel().getWidgetCount() - 1);
            }
        });
    }

    if (canModify) {
        final CustomButton selectButton = new CustomButton(_("Change"), AppConstants.ICON_CHANGE);
        horizontalPanel.add(selectButton);
        selectButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                populate(((CustomListBox) evt.getSource()).getWidgetValue());
            }
        });
    }
    if (canModify) {
        final CustomButton moveButton = new CustomButton(_("Move"), AppConstants.ICON_MOVE_MAIL);
        horizontalPanel.add(moveButton);
        moveButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                Window.alert("STUB: move message(s)");
            }
        });
    }

    if (canRead) {
        final CustomButton selectAllButton = new CustomButton(_("Select All"), AppConstants.ICON_SELECT_ALL);
        horizontalPanel.add(selectAllButton);
        selectAllButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent wvt) {
                Iterator<CheckBox> iter = checkboxStack.keySet().iterator();
                while (iter.hasNext()) {
                    CheckBox t = iter.next();
                    t.setValue(true);
                    if (!selectedItems.contains(checkboxStack.get(t))) {
                        selectedItems.add(checkboxStack.get(t));
                    }
                }
            }
        });
    }
    if (canRead) {
        final CustomButton selectNoneButton = new CustomButton(_("Select None"), AppConstants.ICON_SELECT_NONE);
        horizontalPanel.add(selectNoneButton);
        selectNoneButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                Iterator<CheckBox> iter = checkboxStack.keySet().iterator();
                while (iter.hasNext()) {
                    CheckBox t = iter.next();
                    t.setValue(false);
                    if (selectedItems.contains(checkboxStack.get(t))) {
                        selectedItems.remove(checkboxStack.get(t));
                    }
                }
            }
        });
    }
    if (canDelete) {
        final CustomButton deleteButton = new CustomButton(_("Delete"), AppConstants.ICON_DELETE);
        horizontalPanel.add(deleteButton);
        deleteButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent evt) {
                if (Window.confirm(_("Are you sure you want to delete these item(s)?"))) {
                    List<String> slectedItems = wMessages.getSelected();
                    // Get all selected items from custom table
                    Iterator<String> itr = slectedItems.iterator();
                    while (itr.hasNext()) {
                        deleteMessage(Integer.parseInt(itr.next()));
                    }
                    populate(messageTagSelect.getWidgetValue());
                }
            }
        });
    }
    final VerticalPanel verticalSplitPanel = new VerticalPanel();
    verticalPanel.add(verticalSplitPanel);
    verticalSplitPanel.setSize("100%", "100%");
    // verticalSplitPanel.setSplitPosition("50%");

    if (canRead) {

        wMessages = new CustomTable();
        // wMessages.setAllowSelection(true);
        // wMessages.setMultipleSelection(true);
        verticalSplitPanel.add(wMessages);
        wMessages.setSize("100%", "100%");
        wMessages.addColumn(_("Selected"), "selected");
        wMessages.addColumn(_("Received"), "stamp"); // col 1
        wMessages.addColumn(_("From"), "from_user"); // col 2
        wMessages.addColumn(_("Subject"), "subject"); // col 3
        // wMessages.addColumn(_("Delete"), "delete"); // col 4
        wMessages.setIndexName("id");
        wMessages.setTableRowClickHandler(new TableRowClickHandler() {
            @Override
            public void handleRowClick(HashMap<String, String> data, int col) {
                try {
                    final Integer messageId = Integer.parseInt(data.get("id"));
                    if (col == 4) {
                        deleteMessage(messageId);
                    } else if (col != 0) {
                        showMessage(messageId);
                        msgView = new MessageView();
                        msgView.setMessageId(messageId);
                        msgView.setMsgFrom(data.get("from_user"));
                        msgView.setMsgDate(data.get("stamp"));
                        msgView.setText(msgView.createMessageHtml(data.get("from_user"), data.get("stamp"),
                                data.get("subject"), data.get("content")));
                        // showMessage(messageId);
                        msgView.setMessagingScreen(getMessagingScreen());
                        popupMessageView = new Popup();
                        popupMessageView.setNewWidget(msgView);
                        msgView.setOnClose(new Command() {
                            public void execute() {
                                popupMessageView.hide();
                            }
                        });
                        popupMessageView.initialize();

                    }
                } catch (Exception e) {
                    GWT.log("Caught exception: ", e);
                }
            }
        });
        wMessages.setTableWidgetColumnSetInterface(new TableWidgetColumnSetInterface() {
            public Widget setColumn(String columnName, HashMap<String, String> data) {
                Integer id = Integer.parseInt(data.get("id"));
                if (columnName.compareTo("selected") == 0) {
                    CheckBox c = new CheckBox();
                    c.addClickHandler(getMessagingScreen());
                    checkboxStack.put(c, id);
                    return c;
                } else {
                    return (Widget) null;
                }
            }
        });
    }
    // verticalSplitPanel.setSize("100%", "100%");

    // Start population routine
    populate("");
    populateTagWidget();

    // Register on the event bus
    CurrentState.getEventBus().addHandler(SystemEvent.TYPE, this);
}

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);
    tabViewPanel.add(tabView);/*from w w  w  .j  a v  a  2 s  . c  om*/

    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 void populateFields(String statusModule, final String checkFields) {

    moduleFieldsTable.setVisible(false);
    moduleFieldsTable.clear();/*w  w  w.ja v  a2s .  co  m*/

    // moduleProperties.clear();
    List params = new ArrayList();
    params.add(statusModule);
    Util.callApiMethod("ModuleSearch", "getFields", params, new CustomRequestCallback() {

        @Override
        public void onError() {
            // TODO Auto-generated method stub

        }

        @Override
        public void jsonifiedData(Object data) {
            if (data != null) {
                HashMap<String, Boolean> selectedFieldsMap = null;
                String[] rs = (String[]) data;
                if (checkFields != null) {
                    selectedFieldsMap = new HashMap<String, Boolean>();
                    String[] selectedFields = checkFields.split(",");
                    for (int i = 0; i < selectedFields.length; i++) {
                        selectedFieldsMap.put(selectedFields[i], true);
                    }
                }

                int row = 0;
                int col = 0;
                fieldsList.clear();
                for (int i = 0; i < rs.length; i++) {
                    CheckBox checkbox = new CheckBox(rs[i]);
                    moduleFieldsTable.setWidget(row, col, checkbox);
                    fieldsList.add(checkbox);

                    if (selectedFieldsMap != null && selectedFieldsMap.containsKey(rs[i]))
                        checkbox.setValue(true);
                    col++;
                    if (col % 6 == 0) {
                        row++;
                        col = 0;
                    }

                }
                if (rs.length > 0) {
                    moduleFieldsTable.setVisible(true);
                }

            }
        }

    }, "String[]");
}

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);
    tabViewPanel.add(tabView);//from   w ww.ja  v  a  2 s .  com

    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);
}