1 11 12 package org.eclipse.ui.navigator; 13 14 import java.util.HashMap ; 15 import java.util.LinkedHashSet ; 16 import java.util.Map ; 17 import java.util.Set ; 18 19 import org.eclipse.jface.viewers.AbstractTreeViewer; 20 21 54 public final class PipelinedViewerUpdate { 55 56 private static final String [] NO_PROPERTIES = new String [0]; 57 58 private final Set refreshTargets = new LinkedHashSet (); 59 60 private boolean updateLabels = false; 61 62 private Map properties; 63 64 75 public final String [] getProperties(Object aTarget) { 76 if (properties != null && properties.containsKey(aTarget)) { 77 String [] props = (String []) properties.get(aTarget); 78 return props != null ? props : NO_PROPERTIES; 79 } 80 return NO_PROPERTIES; 81 } 82 83 94 public final void setProperties(Object aTarget, String [] theProperties) { 95 if (theProperties != null && theProperties.length > 0) { 96 if (properties == null) { 97 properties = new HashMap (); 98 } 99 properties.put(aTarget, theProperties); 100 101 } else { 102 properties.remove(aTarget); 103 } 104 105 if (properties.size() == 0) { 106 properties = null; 107 } 108 109 } 110 111 115 public final Set getRefreshTargets() { 116 return refreshTargets; 117 } 118 119 123 public final boolean isUpdateLabels() { 124 return updateLabels; 125 } 126 127 133 public final void setUpdateLabels(boolean toUpdateLabels) { 134 updateLabels = toUpdateLabels; 135 } 136 137 } 138 | Popular Tags |