1 2 package de.uka.ipd.coverage.plugin.ui;3 4 5 /*******************************************************************************6 * Copyright (c) 2000, 2004 IBM Corporation and others.7 * All rights reserved. This program and the accompanying materials 8 * are made available under the terms of the Common Public License v1.09 * which accompanies this distribution, and is available at10 * http://www.eclipse.org/legal/cpl-v10.html11 * 12 * Contributors:13 * IBM Corporation - initial API and implementation14 *******************************************************************************/15 16 17 /**18 * Represents a list of ConcreteMarkers.19 */20 public class MarkerList {21 //private static final String SEARCHING_FOR_MARKERS = Messages.getString("MarkerList.0"); //$NON-NLS-1$22 //private Collection markers;23 // 24 // /**25 // * Lazily created marker table - maps IMarkers onto ConcreteMarkers.26 // * Null if not created27 // */28 // private Map markerTable;29 //30 // private IMarker[] markers;31 // 32 // /**33 // * Creates a list containing the given set of markers34 // * 35 // * @param markers36 // */37 // public MarkerList(IMarker[] markers) {38 // this.markers = markers;39 // }40 // 41 // 42 // /**43 // * Returns the marker table or lazily creates it if it doesn't exist yet44 // * 45 // * @return a map of IMarker onto ConcreteMarker, containing all the ConcreteMarkers in the list46 // */47 // private Map getMarkerMap() {48 // if (markerTable == null) {49 // markerTable = new HashMap();50 // 51 // for (int idx = 0; idx < markers.length; idx++) {52 // IMarker marker = markers[idx];53 // markerTable.put(marker, marker);54 // }55 // }56 // 57 // return markerTable;58 // }59 // 60 // /**61 // * Returns an existing marker from the list that is associated with62 // * the given IMarker63 // * 64 // * @param toFind the IMarker to lookup in the list65 // * @return the ConcreteMarker that corresponds to the given IMarker66 // */67 // public IMarker getMarker(IMarker toFind) {68 // return (IMarker) getMarkerMap().get(toFind);69 // }70 // 71 // public List asList() {72 // return Arrays.asList(markers);73 // }74 // 75 // public MarkerList findMarkers(Collection ofIMarker) {76 // List result = new ArrayList(ofIMarker.size());77 // 78 // Iterator iter = ofIMarker.iterator();79 // while (iter.hasNext()) {80 // IMarker next = (IMarker)iter.next();81 // 82 // IMarker marker = getMarker(next);83 // if (marker != null) {84 // result.add(marker);85 // }86 // }87 // 88 // return new MarkerList((IMarker[]) result.toArray(new IMarker[result.size()])); 89 // }90 // 91 // 92 //// /**93 //// * Computes the set of markers that match the given filter94 //// * @param filter the filter to apply95 //// * @param mon the monitor to update96 //// * @param ignoreExceptions whether or not exception will be shown97 //// * @return MarkerList98 //// * @throws CoreException99 //// */100 //// public static MarkerList compute(MarkerFilter filter, IProgressMonitor mon, 101 //// boolean ignoreExceptions) throws CoreException {102 //// return new MarkerList(filter.findMarkers(mon, ignoreExceptions));103 //// }104 //// 105 // /**106 // * Returns a new MarkerList containing all markers in the workspace of the specified types107 // * @param types108 // * @return IMarker[]109 // * @throws CoreException110 // */111 // public static IMarker[] compute(String[] types) throws CoreException {112 // 113 // ArrayList result = new ArrayList();114 // IResource input = ResourcesPlugin.getWorkspace().getRoot();115 //116 // for (int i = 0; i < types.length; i++) {117 // IMarker[] newMarkers = input.findMarkers(types[i], true, IResource.DEPTH_INFINITE);118 // result.addAll(Arrays.asList(newMarkers));119 // }120 //121 // return (IMarker[])result.toArray(new IMarker[result.size()]);122 // }123 // 124 // /**125 // * Returns the markers in the list. Read-only.126 // * 127 // * @return an array of markers in the list128 // */129 // public IMarker[] toArray() {130 // return markers;131 // }132 // 133 // 134 // /**135 // * Returns the number of items in the list136 // * 137 // * @return the number of items 138 // */139 // public int getItemCount() {140 // return markers.length;141 // }142 // 143 144 145 }146