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

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

Introduction

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

Prototype

public CheckBox() 

Source Link

Document

Creates a check box with no label.

Usage

From source file:com.dimdim.conference.ui.dialogues.client.common.UserControlDialog.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    VerticalPanel scrolledTable = new VerticalPanel();
    scroller.add(scrolledTable);//  w w  w.  ja  v a  2s  .c om
    //      table.setStyleName("list-control-table");

    //UIResources  uiResources = UIResources.getUIResources();
    //String   subject = uiResources.getConferenceInfo("subject");
    int size = this.listModel.getListSize();
    int i = 0;
    if (size > 0) {
        HorizontalPanel header = new HorizontalPanel();
        header.add(createLabel(ConferenceGlobals.getDisplayString("console.moodlabel", "Mood"),
                "user-image-header"));
        header.add(createLabel(UIStrings.getNameLabel(), "user-name-header"));
        //header.add(createLabel(UIStrings.getEmailLabel(),"user-email-header"));

        if (this.allowUserControl) {
            Label chat = createLabel(UIStrings.getChatLabel(), "user-chat-button-header");
            chat.addStyleName("common-anchor-default-color");
            header.add(chat);
            String label = UIStrings.getAudioLabel();
            if (ConferenceGlobals.isPresenterAVVideoOnly()) {
                label = UIStrings.getVideoLabel();
            }
            Label audio = createLabel(label, "user-chat-button-header");
            audio.addStyleName("common-anchor-default-color");
            header.add(audio);

        }
        header.addStyleName("common-dialog-row");
        table.add(header);
        table.add(scroller);
        table.setCellWidth(scroller, "100%");

        for (i = 0; i < size; i++) {
            UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i);
            final UIRosterEntry user = ule.getUser();
            //            UIListEntryPanelMouseAndClickListener mcl = new UIListEntryPanelMouseAndClickListener(
            //                  ule,this.userListAndEntryProperties,this.userListEntryManager);
            //            mcl.setSecondLevelPopup(true);

            HorizontalPanel row = new HorizontalPanel();

            HorizontalPanel hp1 = new HorizontalPanel();
            Image image = UserGlobals.getUserGlobals().getMoodImageUrl(user.getMood());
            hp1.add(image);
            hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
            hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
            hp1.setStyleName("user-image");
            row.add(hp1);
            row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
            row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

            //         table.setWidget((i+1), 0, image);
            Label nameLabel = createTextLabel(user.getDisplayName(), "user-name");
            if (!me.getUserId().equals(user.getUserId())) {
                if (ConferenceGlobals.privateChatEnabled) {
                    nameLabel.addStyleName("common-anchor-default-color");
                    nameLabel.addClickListener(new ClickListener() {
                        public void onClick(Widget sender) {
                            NewChatController.getController().showChatPopupIfPossible(user);
                            hide();
                        }
                    });
                }
            }
            //            nameLabel.addClickListener(mcl);
            //            nameLabel.addMouseListener(mcl);
            row.add(nameLabel);

            if (this.allowUserControl) {
                HorizontalPanel hp2 = new HorizontalPanel();
                CheckBox cb1 = new CheckBox();
                hp2.add(cb1);
                hp2.setStyleName("user-chat-button");
                hp2.setCellHorizontalAlignment(cb1, HorizontalPanel.ALIGN_LEFT);
                hp2.setCellVerticalAlignment(cb1, VerticalPanel.ALIGN_MIDDLE);
                row.add(hp2);
                row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT);
                row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE);

                HorizontalPanel hp3 = new HorizontalPanel();
                CheckBox cb2 = new CheckBox();
                hp3.add(cb2);
                hp3.setStyleName("user-chat-button");
                hp3.setCellHorizontalAlignment(cb2, HorizontalPanel.ALIGN_LEFT);
                hp3.setCellVerticalAlignment(cb2, VerticalPanel.ALIGN_MIDDLE);
                row.add(hp3);
                row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
                row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);

                //               HorizontalPanel hp4 = new HorizontalPanel();
                //               CheckBox cb3 = new CheckBox();
                //               hp4.add(cb3);
                //               hp4.setStyleName("user-chat-button");
                //               hp4.setCellHorizontalAlignment(cb3,HorizontalPanel.ALIGN_LEFT);
                //               hp4.setCellVerticalAlignment(cb3,VerticalPanel.ALIGN_MIDDLE);
                //               row.add(hp4);
                //               row.setCellHorizontalAlignment(hp4,HorizontalPanel.ALIGN_LEFT);
                //               row.setCellVerticalAlignment(hp4,VerticalPanel.ALIGN_MIDDLE);
            }
            row.addStyleName("common-dialog-row");
            scrolledTable.add(row);
        }
    } else {
        HorizontalPanel header2 = new HorizontalPanel();
        header2.add(createLabel(UIStrings.getNoParticipantsMessage(), "conference-permissions-header"));

        table.add(header2);
    }

    return table;
}

From source file:com.dimdim.conference.ui.resources.client.ResourceControlDialog.java

License:Open Source License

protected Widget getContent() {
    table = new VerticalPanel();
    Widget content = table;/*from  w  w  w .j a  va  2  s .  c  o  m*/
    //      table.setStyleName("list-control-table");
    UIResourceObject currentActiveResource = ConferenceGlobals.getCurrentSharedResource();

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "resource-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "resource-name-header"));
    header.add(createLabel(UIStrings.getTypeLabel(), "resource-type-header"));
    if (this.allowResourceControl) {
        deleteHeader = createLabel(UIStrings.getDeleteLabel(), "resource-delete-button-header");
        deleteHeader.addStyleName("common-anchor-default-color");
        deleteHeader.addClickListener(this);
        header.add(deleteHeader);
    }
    header.addStyleName("common-dialog-row");
    table.add(header);

    int size = this.listModel.getListSize();
    if (size > 5) {
        VerticalPanel vp = new VerticalPanel();
        ScrollPanel scroller = new ScrollPanel();
        scroller.setStyleName("resource-control-dialog-height");
        scroller.add(table);
        vp.add(scroller);
        content = vp;
    }
    int i = 0;

    Vector sortedList = getSortedList(listModel);
    for (i = 0; i < size; i++) {
        ResourceListEntry rle = (ResourceListEntry) sortedList.get(i);
        UIResourceObject res = rle.getResource();
        if (this.typeName != null && !res.getResourceType().equals(this.typeName)) {
            continue;
        }
        //         UIListEntryPanelMouseAndClickListener mcl = new UIListEntryPanelMouseAndClickListener(
        //               rle,this.resourceListAndEntryProperties,this.listEntryManager);
        //         mcl.setSecondLevelPopup(true);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = getImage(res);
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.addStyleName("resource-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(res.getResourceName(), "resource-name", 23);
        //         nameLabel.addStyleName("common-anchor");
        //         nameLabel.addClickListener(mcl);
        //         nameLabel.addMouseListener(mcl);
        row.add(nameLabel);

        row.add(createTextHTML(ResourceGlobals.getResourceGlobals().getResourceTypeNiceName(res),
                "resource-type"));

        if (this.allowResourceControl) {
            HorizontalPanel hp2 = new HorizontalPanel();
            CheckBox cb = new CheckBox();
            hp2.add(cb);
            hp2.setStyleName("resource-delete-button");
            hp2.setCellHorizontalAlignment(cb, HorizontalPanel.ALIGN_LEFT);
            hp2.setCellVerticalAlignment(cb, VerticalPanel.ALIGN_MIDDLE);
            row.add(hp2);
            row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT);
            row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE);
            cb.addClickListener(this);
            this.checkBoxes.put(res.getResourceId(), cb);
            this.checkBoxes2.put(cb, cb);
            if (!ResourceGlobals.allowDelete(res) || (currentActiveResource != null
                    && currentActiveResource.getResourceId().equals(res.getResourceId()))) {
                cb.setEnabled(false);
            }
        }
        row.addStyleName("common-dialog-row");
        table.add(row);
        this.rows.put(res.getResourceId(), row);
    }
    return content;
}

From source file:com.dimdim.conference.ui.user.client.email.EmailControlPanel.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    scroller.add(scrolledTable);/*from ww w.j av  a  2  s .c  o m*/

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "lobby-name"));
    header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email"));

    Label accept = createLabel(UIStrings.getResolveLabel(), "user-chat-button-header");
    accept.addStyleName("common-anchor");
    header.add(accept);
    Label deny = createLabel("", "user-chat-button-header");
    header.add(deny);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.add(scroller);
    table.setCellWidth(scroller, "100%");

    int size = this.listModel.getListSize();
    int i = 0;
    for (i = 0; i < size; i++) {
        EmailTaskListEntry etle = (EmailTaskListEntry) this.listModel.getListEntryAt(i);
        this.results.addElement(etle);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = etle.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(etle.getName(), "lobby-name");
        nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);
        Label emailLabel = createTextHTML(etle.getEmailResult().getTarget(), "lobby-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        HorizontalPanel hp3 = new HorizontalPanel();
        CheckBox cb2 = new CheckBox();
        hp3.add(cb2);
        hp3.setStyleName("user-chat-button");
        hp3.setCellHorizontalAlignment(cb2, HorizontalPanel.ALIGN_LEFT);
        hp3.setCellVerticalAlignment(cb2, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp3);
        row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
        this.checkBoxes.addElement(cb2);

        HorizontalPanel hp4 = new HorizontalPanel();
        Label cb3 = new Label("");
        hp4.add(cb3);
        hp4.setStyleName("user-chat-button");
        hp4.setCellHorizontalAlignment(cb3, HorizontalPanel.ALIGN_LEFT);
        hp4.setCellVerticalAlignment(cb3, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp4);
        row.setCellHorizontalAlignment(hp4, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp4, VerticalPanel.ALIGN_MIDDLE);

        row.addStyleName("common-dialog-row");
        scrolledTable.add(row);
        this.rows.addElement(row);
    }

    return table;
}

From source file:com.dimdim.conference.ui.user.client.questiontask.QuestionsControlPanel.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    scroller.add(scrolledTable);//from www .ja v a 2  s.c  o  m

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "lobby-name"));
    header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email"));

    Label accept = createLabel(UIStrings.getResolveLabel(), "user-chat-button-header");
    accept.addStyleName("common-anchor");
    header.add(accept);
    Label deny = createLabel("", "user-chat-button-header");
    header.add(deny);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.add(scroller);
    table.setCellWidth(scroller, "100%");

    int size = this.listModel.getListSize();
    int i = 0;
    for (i = 0; i < size; i++) {
        UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i);
        UIRosterEntry user = ule.getUser();
        this.users.addElement(user);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = ule.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(user.getDisplayName(), "lobby-name");
        nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);
        Label emailLabel = createTextHTML(user.getUserId(), "lobby-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        HorizontalPanel hp3 = new HorizontalPanel();
        CheckBox cb2 = new CheckBox();
        hp3.add(cb2);
        hp3.setStyleName("user-chat-button");
        hp3.setCellHorizontalAlignment(cb2, HorizontalPanel.ALIGN_LEFT);
        hp3.setCellVerticalAlignment(cb2, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp3);
        row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
        this.checkBoxes.addElement(cb2);

        HorizontalPanel hp4 = new HorizontalPanel();
        Label cb3 = new Label("");
        hp4.add(cb3);
        hp4.setStyleName("user-chat-button");
        hp4.setCellHorizontalAlignment(cb3, HorizontalPanel.ALIGN_LEFT);
        hp4.setCellVerticalAlignment(cb3, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp4);
        row.setCellHorizontalAlignment(hp4, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp4, VerticalPanel.ALIGN_MIDDLE);

        row.addStyleName("common-dialog-row");
        scrolledTable.add(row);
        this.rows.addElement(row);
    }

    return table;
}

From source file:com.dimdim.conference.ui.user.client.SingleAttendeePermissionsControlDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel table = new VerticalPanel();

    UIResources uiResources = UIResources.getUIResources();
    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "user-name-header"));
    header.add(createLabel(UIStrings.getEmailLabel(), "user-email-header"));

    if (ConferenceGlobals.privateChatEnabled) {
        Label chat = createLabel(UIStrings.getChatLabel(), "user-chat-button-header");
        //         chat.addStyleName("common-anchor");
        header.add(chat);/*  ww w .jav  a  2  s  .  com*/
    }
    if (!ConferenceGlobals.isPresenterAVAudioDisabled()) {
        String label = UIStrings.getAudioLabel();
        if (ConferenceGlobals.isPresenterAVVideoOnly()) {
            label = UIStrings.getVideoLabel();
        }
        Label audio = createLabel(label, "user-chat-button-header");
        header.add(audio);
    }
    //         Label video = createLabel("Video","user-chat-button-header");
    //         header.add(video);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.setCellWidth(header, "100%");
    {
        UserListEntry ule = (UserListEntry) listEntry;
        UIRosterEntry user = ule.getUser();

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = ule.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        Label nameLabel = createTextHTML(user.getDisplayName(), "user-name");
        //            nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);

        String subject = uiResources.getConferenceInfoAndDecode64("subject");
        String mailToTag = "<a href=\"mailto:" + user.getUserId() + "?subject=" + subject + "\">"
                + user.getUserId() + "</a>";

        HTML emailLabel = new HTML("<span>" + mailToTag + "</span>");
        emailLabel.setStyleName("common-table-text");
        emailLabel.addStyleName("user-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        if (ConferenceGlobals.privateChatEnabled) {
            HorizontalPanel hp2 = new HorizontalPanel();
            this.chatControl = new CheckBox();
            hp2.add(chatControl);
            hp2.setStyleName("user-chat-button");
            hp2.setCellHorizontalAlignment(chatControl, HorizontalPanel.ALIGN_LEFT);
            hp2.setCellVerticalAlignment(chatControl, VerticalPanel.ALIGN_MIDDLE);
            row.add(hp2);
            row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT);
            row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE);
            chatControl.setChecked(user.isChatOn());
        }

        if (!ConferenceGlobals.isPresenterAVAudioDisabled()) {
            HorizontalPanel hp3 = new HorizontalPanel();
            this.audioControl = new CheckBox();
            hp3.add(audioControl);
            hp3.setStyleName("user-chat-button");
            hp3.setCellHorizontalAlignment(audioControl, HorizontalPanel.ALIGN_LEFT);
            hp3.setCellVerticalAlignment(audioControl, VerticalPanel.ALIGN_MIDDLE);
            row.add(hp3);
            row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
            row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
            audioControl.setChecked(user.isAudioOn());
            if (!user.isAudioOn()) {
                audioControl.setEnabled(userManager.canEnableAudioFor(user.getUserId()));
            }
        }
        row.addStyleName("common-dialog-row");
        table.add(row);
    }

    return table;
}

From source file:com.edgenius.wiki.gwt.client.page.HistoryPanel.java

License:Open Source License

public void onSuccess(PageItemListModel model) {
    showBusy(false);//from  w  w w .  j  a  v a 2 s .  c  o  m
    moreBtn.busy(false);
    if (!GwtClientUtils.preSuccessCheck(model, message)) {
        return;
    }
    int start;
    if (model.itemList.size() > 0 && model.itemList.get(0).isCurrent) {
        //must call before next sentence: historyList will clean here.
        this.clear();
        //build header
        start = buildTableHeader();
        historyList = model.itemList;
    } else {
        //this is pagination - after 1 page, then don't clear old data.
        start = table.getRowCount();
        //double check if current return is current page's contiguous history list
        if (historyList.size() == 0 || model.itemList.size() == 0) {
            //if return empty, then assume no more history.
            //historyList never be zero here actually, because history table assume always has current version record as first.
            moreBtn.setVisible(false);
            return;
        }
        if (!StringUtil.equals(model.itemList.get(0).uuid, main.getPageUuid())) {
            //this response is not for current page, discard response
            Log.info("Unaccpted history as pageUuid different:" + model.itemList.get(0).uuid);
            return;
        }
        if (model.itemList.get(0).version != historyList.get(historyList.size() - 1).version - 1) {
            //this response doesn't return contiguous history list, discard.
            Log.info("Unaccpted history as version different with exist:"
                    + historyList.get(historyList.size() - 1).version);
            return;
        }

        historyList.addAll(model.itemList);
    }

    int size = model.itemList.size();
    for (int idx = 0; idx < size; idx++) {
        final PageItemModel history = (PageItemModel) model.itemList.get(idx);
        CheckBox check = new CheckBox();
        check.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                history.checked = ((CheckBox) event.getSource()).getValue();
            }
        });
        HTML rev;
        Hyperlink title;
        if (history.isCurrent) {
            rev = new HTML("<b>" + Msg.consts.current() + "</b>");
            title = new Hyperlink(history.title, GwtUtils.getSpacePageToken(history.spaceUname, history.title));
        } else {
            rev = new HTML("<b>" + Integer.valueOf(history.version).toString() + "</b>");
            title = new Hyperlink(history.title, GwtUtils.buildToken(PageMain.TOKEN_HISTORY, history.spaceUname,
                    String.valueOf(history.uid)));
        }
        rev.setStyleName(Css.NOWRAP);

        UserProfileLink modifier = new UserProfileLink(history.modifier, main.getSpaceUname(),
                history.modifierUsername, history.modifierPortrait);
        Label modifiedDate = new Label(GwtClientUtils.toDisplayDate(history.modifiedDate));
        int row = start + idx;
        int col = 0;
        table.setWidget(row, col++, check);
        table.setWidget(row, col++, rev);
        table.setWidget(row, col++, title);
        table.setWidget(row, col, modifier);
        table.getFlexCellFormatter().setStyleName(row, col++, Css.NOWRAP);
        table.setWidget(row, col, modifiedDate);
        table.getFlexCellFormatter().setStyleName(row, col++, Css.NOWRAP);

        if (idx == (size - 1)) {
            if (history.version > 1) {
                moreBtn.setVisible(true);
                //always hide "less" button, page number is useless.
                moreBtn.setPaginationInfo(false, true, 0);
            } else {
                moreBtn.setVisible(false);
            }
        }
    }
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.batch.BatchClassView.java

License:Open Source License

/**
 * To set Document Type List./*from  ww  w . j av a  2s.co m*/
 * 
 * @param documentTypeDTOs Collection<DocumentTypeDTO>
 * @return List<Record>
 */
public List<Record> setDocumentTypeList(Collection<DocumentTypeDTO> documentTypeDTOs) {

    List<Record> recordList = new LinkedList<Record>();
    for (final DocumentTypeDTO documentTypeDTO : documentTypeDTOs) {
        if (!documentTypeDTO.getName().equalsIgnoreCase(AdminConstants.DOCUMENT_TYPE_UNKNOWN)) {
            CheckBox isHidden = new CheckBox();
            isHidden.setValue(documentTypeDTO.isHidden());
            isHidden.setEnabled(false);
            Record record = new Record(documentTypeDTO.getIdentifier());
            record.addWidget(docTypeListView.name, new Label(documentTypeDTO.getName()));
            record.addWidget(docTypeListView.description, new Label(documentTypeDTO.getDescription()));
            record.addWidget(docTypeListView.isHidden, isHidden);
            recordList.add(record);
        }
    }
    return recordList;
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.batch.ImportBatchClassView.java

License:Open Source License

/**
 * This method creates tree view of batch class configuration for selected batch class.
 * //from w  w w  .  j av a2  s .  com
 * @param uiConfigList List<Node>
 */
public void getbatchFolderListView(List<Node> uiConfigList) {
    batchClassFolderView.removeItems();
    if (uncFolderList.getItemCount() > 0) {
        importBatchClassUserOptionDTO.setUncFolder(uncFolderList.getValue(0));
    }
    if (uiConfigList != null && !uiConfigList.isEmpty()) {
        importBatchClassUserOptionDTO.getUiConfigRoot().getChildren().clear();

        for (Node rootNode : uiConfigList) {
            Node node = new Node();
            node.getLabel().setDisplayName(rootNode.getLabel().getDisplayName());
            node.getLabel().setKey(rootNode.getLabel().getKey());
            node.setParent(rootNode.getParent());
            CheckBox checkBox = new CheckBox();
            checkBox.setText(rootNode.getLabel().getDisplayName().trim());
            TreeItem treeItem = new TreeItem(checkBox);
            createUI(rootNode.getLabel().isMandatory(), checkBox, node, treeItem);
            node.setParent(importBatchClassUserOptionDTO.getUiConfigRoot());
            importBatchClassUserOptionDTO.getUiConfigRoot().getChildren().add(node);
            if (rootNode.getChildren() != null && !rootNode.getChildren().isEmpty()) {
                setImportFolderUI(treeItem, rootNode, node);
            }
            batchClassFolderView.addItem(treeItem);
            treeItem.setState(Boolean.TRUE);
        }

    }
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.batch.ImportBatchClassView.java

License:Open Source License

private void setImportFolderUI(final TreeItem treeItem, final Node rootNode, final Node newRootNode) {
    for (Node childNode : rootNode.getChildren()) {
        if (rootNode != null && rootNode.getLabel() != null && rootNode.getLabel().getDisplayName() != null
                && !rootNode.getLabel().getDisplayName().trim().isEmpty()) {
            Node node = new Node();
            node.getLabel().setDisplayName(childNode.getLabel().getDisplayName());
            node.getLabel().setKey(childNode.getLabel().getKey());
            node.setParent(childNode.getParent());
            CheckBox checkBox = new CheckBox();
            checkBox.setText(childNode.getLabel().getDisplayName().trim());
            TreeItem childTree = new TreeItem(checkBox);
            treeItem.addItem(childTree);
            createUI(childNode.getLabel().isMandatory(), checkBox, node, childTree);
            node.setParent(newRootNode);
            newRootNode.getChildren().add(node);
            if (childNode.getChildren() != null && !childNode.getChildren().isEmpty()) {
                setImportFolderUI(childTree, childNode, node);
            }/*from www .j  a v  a  2  s. c  om*/
        }
    }
}

From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.documenttype.DocumentTypeView.java

License:Open Source License

/**
 * To set Fields List.//w w  w  . j a  v  a  2 s .  com
 * 
 * @param fields Collection<FieldTypeDTO>
 * @return List<Record>
 */
public List<Record> setFieldsList(Collection<FieldTypeDTO> fields) {

    List<Record> recordList = new LinkedList<Record>();
    for (final FieldTypeDTO fieldTypeDTO : fields) {
        CheckBox isHidden = new CheckBox();
        CheckBox isMultiLine = new CheckBox();
        CheckBox isReadOnly = new CheckBox();
        isHidden.setValue(fieldTypeDTO.isHidden());
        isHidden.setEnabled(false);
        isMultiLine.setValue(fieldTypeDTO.isMultiLine());
        isMultiLine.setEnabled(false);
        isReadOnly.setValue(fieldTypeDTO.getIsReadOnly());
        isReadOnly.setEnabled(false);
        Record record = new Record(fieldTypeDTO.getIdentifier());
        record.addWidget(fieldTypeListView.name, new Label(fieldTypeDTO.getName()));
        record.addWidget(fieldTypeListView.description, new Label(fieldTypeDTO.getDescription()));
        record.addWidget(fieldTypeListView.type, new Label(fieldTypeDTO.getDataType().name()));
        record.addWidget(fieldTypeListView.fdOrder, new Label(fieldTypeDTO.getFieldOrderNumber()));
        record.addWidget(fieldTypeListView.sampleValue, new Label(fieldTypeDTO.getSampleValue()));
        record.addWidget(fieldTypeListView.barcode, new Label(fieldTypeDTO.getBarcodeType()));
        record.addWidget(fieldTypeListView.isHidden, isHidden);
        record.addWidget(fieldTypeListView.isMultiLine, isMultiLine);
        record.addWidget(fieldTypeListView.isReadOnly, isReadOnly);
        recordList.add(record);
    }

    return recordList;
}