Package com.onpositive.commons.ui.viewers

Examples of com.onpositive.commons.ui.viewers.TableSortController


      public Image getImage(Object element) {
        return stackImage;
      }

    });
    new TableSortController(tv, tableColumn, new Comparator<RequestInfo>() {

      public int compare(RequestInfo o1, RequestInfo o2) {
        return getReqestMessage(o1).compareTo(getReqestMessage(o2));
      }
    }, true, true);
    new TableSortController(tv, countColumn, new Comparator<RequestInfo>() {

      public int compare(RequestInfo o1, RequestInfo o2) {
        return o1.getCount() - o2.getCount();
      }
    }, true, true);
    TableSortController tableSortController = new TableSortController(tv,
        costColumn, new Comparator<RequestInfo>() {

          public int compare(RequestInfo o1, RequestInfo o2) {
            if (o1 instanceof MemCacheStorageAttachment.GetFromMemcacheRequestInfo){
              if (o2 instanceof MemCacheStorageAttachment.GetFromMemcacheRequestInfo){
                MemCacheStorageAttachment.GetFromMemcacheRequestInfo m1=(GetFromMemcacheRequestInfo) o1;
                MemCacheStorageAttachment.GetFromMemcacheRequestInfo m2=(GetFromMemcacheRequestInfo) o2;
                return (int) ((m1.successes/(double)m1.totalCount)*1000-(m2.successes/(double)m2.totalCount)*1000);
              }
            }
            if (o1 instanceof MemCacheStorageAttachment.GetFromMemcacheRequestInfo){
              return -1;
            }
            if (o2 instanceof MemCacheStorageAttachment.GetFromMemcacheRequestInfo){
              return 1;
            }
            return (int) (o2.getCost() - o1.getCost());
          }
        }, true, true);

    tableSortController.stateChanged();
    // tableSortController.stateChanged();
    tableViewer.addOpenListener(new IOpenListener() {

      public void open(OpenEvent event) {
        IStructuredSelection s = (IStructuredSelection) event
View Full Code Here


      public Image getImage(Object element) {
        return stackImage;
      }

    });
    new TableSortController(tv, tableColumn, new Comparator<RequestInfo>() {

      public int compare(RequestInfo o1, RequestInfo o2) {
        return getReqestMessage(o1).compareTo(getReqestMessage(o2));
      }
    }, true, true);
    new TableSortController(tv, countColumn, new Comparator<RequestInfo>() {

      public int compare(RequestInfo o1, RequestInfo o2) {
        return o1.getCount() - o2.getCount();
      }
    }, true, true);
    TableSortController tableSortController = new TableSortController(tv,
        costColumn, new Comparator<RequestInfo>() {

          public int compare(RequestInfo o1, RequestInfo o2) {
           
            return (int) (o2.getCost() - o1.getCost());
          }
        }, true, true);

    tableSortController.stateChanged();
    // tableSortController.stateChanged();
    tableViewer.addOpenListener(new IOpenListener() {

      public void open(OpenEvent event) {
        IStructuredSelection s = (IStructuredSelection) event
View Full Code Here

TOP

Related Classes of com.onpositive.commons.ui.viewers.TableSortController

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.