Package com.smartgwt.client.widgets

Examples of com.smartgwt.client.widgets.TransferImgButton


        VStack moveButtonStack = new EnhancedVStack(6);
        moveButtonStack.setWidth(42);
        moveButtonStack.setHeight(250);
        moveButtonStack.setAlign(VerticalAlignment.CENTER);

        this.addButton = new TransferImgButton(TransferImgButton.RIGHT);
        this.addButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                addSelectedRows();
            }
        });
        moveButtonStack.addMember(this.addButton);

        this.removeButton = new TransferImgButton(TransferImgButton.LEFT);
        this.removeButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                removeSelectedRows();

            }
        });
        moveButtonStack.addMember(this.removeButton);

        this.addAllButton = new TransferImgButton(TransferImgButton.RIGHT_ALL);
        this.addAllButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                availableGrid.selectAllRecords();
                addSelectedRows();
            }
        });
        moveButtonStack.addMember(this.addAllButton);

        this.removeAllButton = new TransferImgButton(TransferImgButton.LEFT_ALL);
        this.removeAllButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                assignedGrid.selectAllRecords();
                removeSelectedRows();
            }
View Full Code Here


        VStack vStack = new VStack(10);
        vStack.setWidth(32);
        vStack.setHeight(74);
        vStack.setLayoutAlign(Alignment.CENTER);

        TransferImgButton rightImg = new TransferImgButton(TransferImgButton.RIGHT);
        rightImg.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                myList2.transferSelectedData(myList1);
            }
        });
        vStack.addMember(rightImg);

        TransferImgButton leftImg = new TransferImgButton(TransferImgButton.LEFT);
        leftImg.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                myList1.transferSelectedData(myList2);
            }
        });
        vStack.addMember(leftImg);
View Full Code Here

        final PartsListGrid myList2 = new PartsListGrid();
        myList2.setEmptyMessage("No Records");
        myList2.setCanAcceptDroppedRecords(true);
        myList2.setCanReorderRecords(true);

        TransferImgButton right = new TransferImgButton(TransferImgButton.RIGHT);
        right.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                myList2.transferSelectedData(myList1);
            }
        });

        TransferImgButton rightAll = new TransferImgButton(TransferImgButton.RIGHT_ALL);
        rightAll.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                Record[] records = myList1.getRecords();
                myList1.setData(new Record[]{});
                for (Record record : records) {
                    myList2.addData(record);
                }
            }
        });

        TransferImgButton left = new TransferImgButton(TransferImgButton.LEFT);
        left.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                myList1.transferSelectedData(myList2);
            }
        });

        TransferImgButton leftAll = new TransferImgButton(TransferImgButton.LEFT_ALL);
        leftAll.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                Record[] records = myList2.getRecords();
                myList2.setData(new Record[]{});
                for (Record record : records) {
                    myList1.addData(record);
                }
            }
        });
        transferStack.addMember(right);
        transferStack.addMember(left);
        transferStack.addMember(rightAll);
        transferStack.addMember(leftAll);

        hStack.addMember(transferStack);
        hStack.addMember(myList2);

        VStack modifyStack = new VStack(3);
        modifyStack.setWidth(20);
        modifyStack.setAlign(VerticalAlignment.CENTER);

        TransferImgButton up = new TransferImgButton(TransferImgButton.UP);
        up.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                ListGridRecord selectedRecord = myList2.getSelectedRecord();
                if(selectedRecord != null) {
                    int idx = myList2.getRecordIndex(selectedRecord);
                    if(idx > 0) {
                        RecordList rs = myList2.getRecordList();
                        rs.removeAt(idx);
                        rs.addAt(selectedRecord, idx - 1);
                    }
                }
            }
        });

        TransferImgButton upFirst = new TransferImgButton(TransferImgButton.UP_FIRST);
        upFirst.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                ListGridRecord selectedRecord = myList2.getSelectedRecord();
                if(selectedRecord != null) {
                    int idx = myList2.getRecordIndex(selectedRecord);
                    if(idx > 0) {
                        RecordList rs = myList2.getRecordList();
                        rs.removeAt(idx);
                        rs.addAt(selectedRecord, 0);
                    }
                }
            }
        });

        TransferImgButton down = new TransferImgButton(TransferImgButton.DOWN);
        down.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                ListGridRecord selectedRecord = myList2.getSelectedRecord();
                if(selectedRecord != null) {
                    RecordList rs = myList2.getRecordList();
                    int numRecords = rs.getLength();
                    int idx = myList2.getRecordIndex(selectedRecord);
                    if(idx < numRecords - 1) {
                        rs.removeAt(idx);
                        rs.addAt(selectedRecord, idx + 1);
                    }
                }
            }
        });

        TransferImgButton downLast = new TransferImgButton(TransferImgButton.DOWN_LAST);
        downLast.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                ListGridRecord selectedRecord = myList2.getSelectedRecord();
                if(selectedRecord != null) {
                    RecordList rs = myList2.getRecordList();
                    int numRecords = rs.getLength();
                    int idx = myList2.getRecordIndex(selectedRecord);
                    if(idx < numRecords - 1) {
                        rs.removeAt(idx);
                        rs.addAt(selectedRecord, rs.getLength() -1);
                    }
                }
            }
        });

        TransferImgButton delete = new TransferImgButton(TransferImgButton.DELETE);
        delete.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                ListGridRecord selectedRecord = myList2.getSelectedRecord();
                if(selectedRecord != null) {
                    myList2.removeData(selectedRecord);
                }
View Full Code Here

        VStack moveControls = new VStack(10);
        moveControls.setWidth(32);
        moveControls.setHeight(74);
        moveControls.setLayoutAlign(Alignment.CENTER);

        TransferImgButton rightArrow = new TransferImgButton(TransferImgButton.RIGHT, new ClickHandler() {
            public void onClick(ClickEvent event) {
                grid2.transferSelectedData(grid1);
            }
        });
        moveControls.addMember(rightArrow);

        TransferImgButton leftArrow = new TransferImgButton(TransferImgButton.LEFT, new ClickHandler() {
            public void onClick(ClickEvent event) {
                grid1.transferSelectedData(grid2);
            }
        });
        moveControls.addMember(leftArrow);
View Full Code Here

        vStack.addMember(spacer);
        vStack.addMember(employeesGrid);

        hStack.addMember(vStack);

        TransferImgButton arrowImg = new TransferImgButton(TransferImgButton.RIGHT);
        arrowImg.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                projectGrid.transferSelectedData(employeesGrid);
            }
        });
        hStack.addMember(arrowImg);
View Full Code Here

    VStack moveControls = new VStack(10);
    moveControls.setWidth(handleHorizontal(32));
    moveControls.setHeight(handleVertical(74));
    moveControls.setLayoutAlign(Alignment.CENTER);

    TransferImgButton rightArrow = new TransferImgButton(
        TransferImgButton.RIGHT, new ClickHandler() {
          public void onClick(ClickEvent event) {
            unmarshelService.unmarshel(
                textAreaItem.getValue() + "", TreeToStruct
                    .getStruct(treeGrid, rootNode, null),
                new AsyncCallback<String>() {

                  @Override
                  public void onFailure(Throwable caught) {
                    if (caught instanceof UnmarshalException) {
                      String val = (String) textAreaItem
                          .getValue();
                      String after = val
                          .replace("\n", "\r\n")
                          .substring(
                              0,
                              ((UnmarshalException) caught).lastPossition);
                      int count = after.length()
                          - after.replace("\r\n",
                              "\n").length();
                      textAreaItem
                          .setSelectionRange(
                              0,
                              ((UnmarshalException) caught).lastPossition
                                  - count);
                      xmlAreaItem.setValue("");

                      com.google.gwt.user.client.Window
                          .alert("Parsing failed. Managed to parse only the selected text. Last position:"
                              + ((UnmarshalException) caught).lastPossition);
                    } else {
                      com.google.gwt.user.client.Window
                          .alert("Operation failed.");
                    }
                    GWT.log("", caught);

                  }

                  @Override
                  public void onSuccess(String result) {
                    xmlAreaItem.setValue(result);

                  }
                });
          }

        });
    moveControls.addMember(rightArrow);

    TransferImgButton leftArrow = new TransferImgButton(
        TransferImgButton.LEFT, new ClickHandler() {
          public void onClick(ClickEvent event) {
            unmarshelService.marshel(xmlAreaItem.getValue() + "",
                TreeToStruct
                    .getStruct(treeGrid, rootNode, null),
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.TransferImgButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.