EMMA Coverage Report (generated Mon Sep 29 15:05:28 EDT 2008)
[all classes][org.eclipse.ui.internal.dialogs]

COVERAGE SUMMARY FOR SOURCE FILE [DataTransferWizardCollectionComparator.java]

nameclass, %method, %block, %line, %
DataTransferWizardCollectionComparator.java100% (1/1)75%  (3/4)78%  (29/37)85%  (11/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DataTransferWizardCollectionComparator100% (1/1)75%  (3/4)78%  (29/37)85%  (11/13)
isSorterProperty (Object, String): boolean 0%   (0/1)0%   (0/4)0%   (0/1)
category (Object): int 100% (1/1)84%  (21/25)88%  (7/8)
<static initializer> 100% (1/1)100% (5/5)100% (2/2)
DataTransferWizardCollectionComparator (): void 100% (1/1)100% (3/3)100% (2/2)

1/*******************************************************************************
2 * Copyright (c) 2000, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 *     IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 
12package org.eclipse.ui.internal.dialogs;
13 
14import org.eclipse.jface.viewers.IBasicPropertyConstants;
15import org.eclipse.jface.viewers.ViewerComparator;
16import org.eclipse.ui.internal.registry.WizardsRegistryReader;
17 
18/**
19 *        A Viewer element sorter that sorts Elements by their name attribute.
20 *        Note that capitalization differences are not considered by this
21 *        sorter, so a < B < c.
22 *
23 *        NOTE exceptions to the above: an element with the system's reserved
24 *        category for Other Wizards will always be sorted such that it will
25 *        ultimately be placed at the end of the sorted result, and an elemen 
26 *  with the reserved category name for General wizards will always be 
27 *  placed at the beginning of the sorted result.
28 *  
29 *  @since 3.2
30 */
31class DataTransferWizardCollectionComparator extends ViewerComparator {
32        /**
33         * Static instance of this class.
34         */        
35    public final static DataTransferWizardCollectionComparator INSTANCE = new DataTransferWizardCollectionComparator();
36 
37    /**
38     * Creates an instance of <code>DataTransferWizardCollectionSorter</code>.  Since this
39     * is a stateless sorter, it is only accessible as a singleton; the private
40     * visibility of this constructor ensures this.
41     */
42    private DataTransferWizardCollectionComparator() {
43        super();
44    }
45 
46    public int category(Object element) {
47                if (element instanceof WizardCollectionElement){
48                        String id = ((WizardCollectionElement)element).getId();
49                    if (WizardsRegistryReader.GENERAL_WIZARD_CATEGORY.equals(id)) {
50                                return 1;
51                        }
52                    if (WizardsRegistryReader.UNCATEGORIZED_WIZARD_CATEGORY.equals(id)) {
53                                return 3;
54                        }
55                    return 2;
56                }
57                return super.category(element);
58        }
59 
60        /**
61     *        Return true if this sorter is affected by a property 
62     *        change of propertyName on the specified element.
63     */
64    public boolean isSorterProperty(Object object, String propertyId) {
65        return propertyId.equals(IBasicPropertyConstants.P_TEXT);
66    }
67}

[all classes][org.eclipse.ui.internal.dialogs]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov