Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ViewerComparator


       
       
        _treeViewer = new TreeViewer(tree);
        _treeViewer.setContentProvider(new WGASchemaDefinitionContentProvider());              
        _treeViewer.setLabelProvider(new WGASchemaDefinitionLabelProvider());       
        _treeViewer.setComparator(new ViewerComparator() {

            @Override
            public int compare(Viewer viewer, Object e1, Object e2) {
                if (e1 != null && e2 != null) {
                    if (e1 instanceof WGMetaFieldDefinition && e2 instanceof WGMetaFieldDefinition) {
View Full Code Here


    ((GridData) fFolderViewerContainer.getLayoutData()).heightHint = fViewerHeight;
    ((GridData) fFolderViewerContainer.getLayoutData()).exclude = true;

    /* Sort by Name if set so */
    if (Owl.getPreferenceService().getGlobalScope().getBoolean(DefaultPreferences.BE_SORT_BY_NAME))
      fFolderViewer.setComparator(new ViewerComparator() {
        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
          IFolder f1 = (IFolder) e1;
          IFolder f2 = (IFolder) e2;

View Full Code Here

    ((GridData) fFolderViewerContainer.getLayoutData()).heightHint = fViewerHeight;
    ((GridData) fFolderViewerContainer.getLayoutData()).exclude = true;

    /* Sort by Name if set so */
    if (Owl.getPreferenceService().getGlobalScope().getBoolean(DefaultPreferences.BE_SORT_BY_NAME)) {
      fFolderViewer.setComparator(new ViewerComparator() {
        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
          IFolder f1 = (IFolder) e1;
          IFolder f2 = (IFolder) e2;

View Full Code Here

        return OwlUI.getImage(fResources, OwlUI.BOOKMARK_SET);
      }
    });

    /* Sort by ID to show latest Set at bottom */
    fViewer.setComparator(new ViewerComparator() {
      @Override
      public int compare(Viewer viewer, Object e1, Object e2) {
        IFolder folder1 = (IFolder) e1;
        IFolder folder2 = (IFolder) e2;

View Full Code Here

        return OwlUI.getImage(fResources, OwlUI.BOOKMARK_SET);
      }
    });

    /* Sort by ID to show latest Set at bottom */
    fViewer.setComparator(new ViewerComparator() {
      @Override
      public int compare(Viewer viewer, Object e1, Object e2) {
        IFolder folder1 = (IFolder) e1;
        IFolder folder2 = (IFolder) e2;

View Full Code Here

    ((GridData) fFolderViewerContainer.getLayoutData()).heightHint = fViewerHeight;
    ((GridData) fFolderViewerContainer.getLayoutData()).exclude = fExpandable;

    /* Sort by Name if set so */
    if (Owl.getPreferenceService().getGlobalScope().getBoolean(DefaultPreferences.BE_SORT_BY_NAME)) {
      fFolderViewer.setComparator(new ViewerComparator() {
        @Override
        public int compare(Viewer viewer, Object e1, Object e2) {
          IFolder f1 = (IFolder) e1;
          IFolder f2 = (IFolder) e2;

View Full Code Here

          cell.setForeground(filter.isEnabled() ? display.getSystemColor(SWT.COLOR_BLACK) : display.getSystemColor(SWT.COLOR_DARK_GRAY));
      }
    });

    /* Sort */
    fViewer.setComparator(new ViewerComparator() {
      @Override
      public int compare(Viewer viewer, Object e1, Object e2) {
        ISearchFilter filter1 = (ISearchFilter) e1;
        ISearchFilter filter2 = (ISearchFilter) e2;

View Full Code Here

    fTableViewer= new TableViewer(table);
    fTableViewer.setLabelProvider(new TemplateLabelProvider());
    fTableViewer.setContentProvider(new TemplateContentProvider());

    fTableViewer.setComparator(new ViewerComparator() {
      public int compare(Viewer viewer, Object object1, Object object2) {
        if ((object1 instanceof TemplatePersistenceData) && (object2 instanceof TemplatePersistenceData)) {
          Template left= ((TemplatePersistenceData) object1).getTemplate();
          Template right= ((TemplatePersistenceData) object2).getTemplate();
          int result= Collator.getInstance().compare(left.getName(), right.getName());
View Full Code Here

                    }
                });
                return cp.toArray();
            }
        });
        viewer.setComparator(new ViewerComparator()
        {
            @Override
            public int category(Object element)
            {
                return index((IClasspathEntry) element);
View Full Code Here

        }

        viewer.addFilter(filter);
        viewer.setContentProvider(content);
        viewer.setLabelProvider(getLabelProvider());
        viewer.setComparator(new ViewerComparator());
        viewer.setInput(scope);

        viewer.addSelectionChangedListener(new ISelectionChangedListener()
        {
            public void selectionChanged(SelectionChangedEvent event)
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.ViewerComparator

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.