Package org.eclipse.nebula.widgets.nattable.examples.data.person

Examples of org.eclipse.nebula.widgets.nattable.examples.data.person.Person


        // add labels to provider conditional styling
        bodyDataLayer.setConfigLabelAccumulator(new IConfigLabelAccumulator() {
            @Override
            public void accumulateConfigLabels(LabelStack configLabels,
                    int columnPosition, int rowPosition) {
                Person p = bodyDataProvider.getRowObject(rowPosition);
                if (p != null) {
                    configLabels
                            .addLabel(p.getGender().equals(Gender.FEMALE) ? FEMALE_LABEL
                                    : MALE_LABEL);
                }
            }
        });
View Full Code Here


                        IStructuredSelection selection = (IStructuredSelection) event
                                .getSelection();
                        @SuppressWarnings("rawtypes")
                        Iterator it = selection.iterator();
                        while (it.hasNext()) {
                            Person selected = (Person) it.next();
                            log("  " + selected.getFirstName() + " "
                                    + selected.getLastName());
                        }
                    }

                });
View Full Code Here

    }

    private List<Person> getSimpsonsList() {
        List<Person> result = new ArrayList<Person>();

        result.add(new Person(1, "Homer", "Simpson", Gender.MALE, true,
                new Date()));
        result.add(new Person(2, "Marge", "Simpson", Gender.FEMALE, true,
                new Date()));
        result.add(new Person(3, "Bart", "Simpson", Gender.MALE, false,
                new Date()));
        result.add(new Person(4, "Lisa", "Simpson", Gender.FEMALE, false,
                new Date()));
        result.add(new Person(5, "Maggie", "Simpson", Gender.FEMALE, false,
                new Date()));

        return result;
    }
View Full Code Here

    }

    private List<Person> getFlandersList() {
        List<Person> result = new ArrayList<Person>();

        result.add(new Person(6, "Ned", "Flanders", Gender.MALE, true,
                new Date()));
        result.add(new Person(7, "Maude", "Flanders", Gender.FEMALE, true,
                new Date()));
        result.add(new Person(8, "Rod", "Flanders", Gender.MALE, false,
                new Date()));
        result.add(new Person(9, "Todd", "Flanders", Gender.MALE, false,
                new Date()));

        return result;
    }
View Full Code Here

        // create two data lists with consecutive id's
        List<Person> data = PersonService.getPersons(20);
        List<Person> subData1 = new ArrayList<Person>();
        for (int i = 0; i < 10; i++) {
            Person p = data.get(i);
            subData1.add(p);
        }
        List<Person> subData2 = new ArrayList<Person>();
        for (int i = 10; i < 20; i++) {
            Person p = data.get(i);
            subData2.add(p);
        }

        firstNatTable = createTable(container, subData1);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(firstNatTable);
View Full Code Here

    private List<Person> getStaticPersonList() {
        List<Person> result = new ArrayList<Person>();

        // create some persons
        result.add(new Person(1, "Homer", "Simpson", Gender.MALE, true,
                new Date()));
        result.add(new Person(2, "Marge", "Simpson", Gender.FEMALE, true,
                new Date()));
        result.add(new Person(3, "Bart", "Simpson", Gender.MALE, false,
                new Date()));
        result.add(new Person(4, "Lisa", "Simpson", Gender.FEMALE, false,
                new Date()));
        result.add(new Person(5, "Maggie", "Simpson", Gender.FEMALE, false,
                new Date()));

        result.add(new Person(6, "Ned", "Flanders", Gender.MALE, true,
                new Date()));
        result.add(new Person(7, "Maude", "Flanders", Gender.FEMALE, true,
                new Date()));
        result.add(new Person(8, "Rod", "Flanders", Gender.MALE, false,
                new Date()));
        result.add(new Person(9, "Todd", "Flanders", Gender.MALE, false,
                new Date()));

        result.add(new Person(10, "Timothy", "Lovejoy", Gender.MALE, true,
                new Date()));
        result.add(new Person(11, "Helen", "Lovejoy", Gender.FEMALE, true,
                new Date()));
        result.add(new Person(12, "Jessica", "Lovejoy", Gender.FEMALE, false,
                new Date()));

        return result;
    }
View Full Code Here

                // ensure any active cell editor is closed prior actions outside
                // the NatTable context
                if (natTable.getActiveCellEditor() != null) {
                    natTable.commitAndCloseActiveCellEditor();
                }
                Person item = (Person) ((IStructuredSelection) selectionProvider
                        .getSelection()).getFirstElement();
                eventList.remove(item);
            }
        });
View Full Code Here

                address.setStreet("Some Street");
                address.setHousenumber(42);
                address.setPostalCode(12345);
                address.setCity("In the clouds");

                Person person = new Person(42, "Ralph", "Wiggum", Gender.MALE,
                        false, new Date());
                ExtendedPersonWithAddress entry = new ExtendedPersonWithAddress(
                        person, address, "0000", "The little Ralphy", 0,
                        new ArrayList<String>(), new ArrayList<String>());
                bodyLayerStack.getEventList().add(entry);

                person = new Person(42, "Clancy", "Wiggum", Gender.MALE, true,
                        new Date());
                entry = new ExtendedPersonWithAddress(person, address, "XXXL",
                        "It is Chief Wiggum", 0, new ArrayList<String>(),
                        new ArrayList<String>());
                bodyLayerStack.getEventList().add(entry);

                person = new Person(42, "Sarah", "Wiggum", Gender.FEMALE, true,
                        new Date());
                entry = new ExtendedPersonWithAddress(person, address, "mommy",
                        "Little Ralphy's mother", 0, new ArrayList<String>(),
                        new ArrayList<String>());
                bodyLayerStack.getEventList().add(entry);
View Full Code Here

        public void drop(DropTargetEvent event) {
            String[] data = (event.data != null ? event.data.toString().split(
                    "\\" + DATA_SEPARATOR) : new String[] {});

            if (data.length > 0) {
                Person p = new Person(Integer.valueOf(data[0]));
                p.setFirstName(data[1]);
                p.setLastName(data[2]);
                p.setGender(Gender.valueOf(data[3]));
                p.setMarried(Boolean.valueOf(data[4]));
                try {
                    p.setBirthday(sdf.parse(data[5]));
                } catch (ParseException e) {}

                this.data.add(p);
                this.natTable.refresh();
            }
View Full Code Here

                            "Selected Persons: ").append(
                            selectionLayer.getSelectedRowPositions()).append(
                            "[");
                    for (Range r : selections) {
                        for (int i = r.start; i < r.end; i++) {
                            Person p = bodyDataProvider.getRowObject(i);
                            if (p != null) {
                                if (!builder.toString().endsWith("[")) {
                                    builder.append(", ");
                                }
                                builder.append(p.getFirstName()).append(" ")
                                        .append(p.getLastName());
                            }
                        }
                    }
                    builder.append("]");
                    log(builder.toString());
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.examples.data.person.Person

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.