Package br.com.visualmidia.tools

Examples of br.com.visualmidia.tools.SortComparator


            if(searchText.getText().equals("")) {
                Map<String, Person> students = (Map<String, Person>) system.query(new GetPerson());
                List<Person> studentsList = new ArrayList<Person>();
                studentsList.addAll(students.values());
               
                SortComparator comparator = new SortComparator();
                Collections.sort(studentsList, comparator);
           
                numberOfPerson = 0;
                numberOfRegistrations = 0;
               
                for (Person student : studentsList) {
                if(student.getPersonType("student") != null) {
                    if(listThisStudent(student.getId())){
                      numberOfPerson++;
                      TableItem item = new TableItem(studentTable, SWT.NONE);
                      item.setText(0, student.getId());
                      item.setText(1, student.getName());
                    }
                  }
                }
                numberOfStudentLabel.setText("Alunos: "+numberOfPerson);
                numberOfStudentRegistredLabel.setText("Matr�culas: "+ numberOfRegistrations);
            } else {
                List<Person> list = (List<Person>) system.query(new GetStudentByToken(searchText.getText()));
                SortComparator comparator = new SortComparator();
                Collections.sort(list, comparator);
               
                numberOfPerson = 0;
                numberOfRegistrations = 0;
                for (Person student : list) {
View Full Code Here


            }

            @SuppressWarnings("unchecked")
      private void orderPersonList() {
                if(personList.size() > 1) {
                  SortComparator comparator = new SortComparator();
                  Collections.sort(personList, comparator);
                }
            }
        });
       
View Full Code Here

           
            posY += 311;
           
            Map<String, Course> courses = (Map <String, Course>) system.query(new GetCourse(null));
            List<Course> coursesList = new ArrayList<Course>(courses.values());
            SortComparator comparator = new SortComparator();
            Collections.sort(coursesList, comparator);
            int cont=0;
            for (int i=0; i<coursesList.size(); i++) {
              if(coursesList.get(i).isActive()){
                page.addElement(printRectangle(posX+Math.round((535/3)*(cont%3))+6, posY+3, 6, 6, 0));
View Full Code Here

   
    @SuppressWarnings(value={"unchecked"})
    private void gatherAccountInformation() {
        try {
            Map <String, Account> map = (Map <String, Account>) system.query(new GetAccounts());
            SortComparator comparator = new SortComparator();
            accountList = new LinkedList <Account> (map.values());
            Collections.sort(accountList, comparator);
           
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

   
    @SuppressWarnings(value={"unchecked"})
    private void gatherAccountInformation() {
        try {
            Map <String, Account> map = (Map <String, Account>) system.query(new GetAccounts());
            SortComparator comparator = new SortComparator();
            accountList = new LinkedList <Account> (map.values());
            Collections.sort(accountList, comparator);
           
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

    @SuppressWarnings("unchecked")
    private void search(String token) {
        table.removeAll();
        List<ITableCompletationItem> list = getTableCompletationItem(token);
        if (!list.isEmpty()) {
            SortComparator comparator = new SortComparator();
            Collections.sort(list, comparator);
            for (ITableCompletationItem tableCompletationItem : list) {
              TableItem tableItem = new TableItem(table, SWT.NULL);

              Image[] images = getImage(tableCompletationItem);
View Full Code Here

    @SuppressWarnings("unchecked")
    public void createItems() {
        table.removeAll();
        List<String> list = new ArrayList<String>(computers.keySet());

        SortComparator comparator = new SortComparator();
        Collections.sort(list, comparator);
       
        for (String key : list) {
            TableItem item = new TableItem(table, SWT.NONE);
            item.setText(0, key);
View Full Code Here

   
    @SuppressWarnings(value={"unchecked"})
    private void gatherAccountInformation() {
        try {
            Map <String, Account> map = (Map <String, Account>) system.query(new GetAccounts());
            SortComparator comparator = new SortComparator();
            accountList = new LinkedList <Account> (map.values());
            Collections.sort(accountList, comparator);
           
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            if(searchText.getText().equals("")) {
                Map<String, ClassRoom> classRoomMap = (Map<String, ClassRoom>) system.query(new GetClassRoom());
                List<ClassRoom> classRoomList = new ArrayList<ClassRoom>();
                classRoomList.addAll(classRoomMap.values());
               
                SortComparator comparator = new SortComparator();
                Collections.sort(classRoomList, comparator);
               
                for (ClassRoom classRoom : classRoomList) {
                    TableItem item = new TableItem(classRoomTable, SWT.NONE);
                    if(!classRoom.isActive()){
                        item.setForeground(new Color(null, 172,172,172));
                    }
                    item.setText(0, classRoom.getId());
                    item.setText(1, classRoom.getClassRoomName());
                    item.setText(2, String.valueOf(classRoom.getComputers().size()) + " computadores");
                }
            } else {
                List<ClassRoom> list = (List<ClassRoom>) system.query(new GetClassRoomByToken(searchText.getText()));
                SortComparator comparator = new SortComparator();
                Collections.sort(list, comparator);
               
                for (ClassRoom classRoom : list) {
                    TableItem item = new TableItem(classRoomTable, SWT.NONE);
                    if(!classRoom.isActive()){
View Full Code Here

        courseTable.removeAll();

        try {
            Map<String, Course> map = (Map<String, Course>) system.query(new GetCourse());
            List<Course> list = new ArrayList<Course>(map.values());
            SortComparator comparator = new SortComparator();
            Collections.sort(list, comparator);

            for (Course course : list) {
                TreeItem item = new TreeItem(courseTable, SWT.NONE | SWT.MULTI | SWT.WRAP);
                if(course.getCoursesInThisPackage().size() > 0) {
View Full Code Here

TOP

Related Classes of br.com.visualmidia.tools.SortComparator

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.