/** * Removes all elements from the map. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> */ protected void unmapAllElements() { if (elementMap != null) { elementMap = newHashtable(CustomHashtable.DEFAULT_CAPACITY); } }
/** * Removes all elements from the map. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> */ protected void unmapAllElements() { if (elementMap != null) { elementMap = newHashtable(CustomHashtable.DEFAULT_CAPACITY); } }
/** * Removes all elements from the map. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> */ protected void unmapAllElements() { if (elementMap != null) { elementMap = newHashtable(CustomHashtable.DEFAULT_CAPACITY); } }
/** * Asserts that the given array of elements is itself non- <code>null</code> * and contains no <code>null</code> elements. * * @param elements * the array to check */ protected void assertElementsNotNull(Object[] elements) { Assert.isNotNull(elements); for (Object element : elements) { Assert.isNotNull(element); } if (InternalPolicy.DEBUG_LOG_EQUAL_VIEWER_ELEMENTS && elements.length > 1) { CustomHashtable elementSet = newHashtable(elements.length * 2); for (Object element : elements) { Object old = elementSet.put(element, element); if (old != null) { String message = "Sibling elements in viewer must not be equal:\n " //$NON-NLS-1$ + old + ",\n " + element; //$NON-NLS-1$ Policy.getLog().log( new Status(IStatus.WARNING, Policy.JFACE, message, new RuntimeException())); return; } } } }
/** * Configures whether this structured viewer uses an internal hash table to * speeds up the mapping between elements and SWT items. This must be called * before the viewer is given an input (via <code>setInput</code>). * * @param enable * <code>true</code> to enable hash lookup, and * <code>false</code> to disable it */ public void setUseHashlookup(boolean enable) { Assert.isTrue(getInput() == null, "Can only enable the hash look up before input has been set");//$NON-NLS-1$ if (enable) { elementMap = newHashtable(CustomHashtable.DEFAULT_CAPACITY); } else { elementMap = null; } }
/** * Configures whether this structured viewer uses an internal hash table to * speeds up the mapping between elements and SWT items. This must be called * before the viewer is given an input (via <code>setInput</code>). * * @param enable * <code>true</code> to enable hash lookup, and * <code>false</code> to disable it */ public void setUseHashlookup(boolean enable) { Assert.isTrue(getInput() == null, "Can only enable the hash look up before input has been set");//$NON-NLS-1$ if (enable) { elementMap = newHashtable(CustomHashtable.DEFAULT_CAPACITY); } else { elementMap = null; } }
/** * Asserts that the given array of elements is itself non- <code>null</code> * and contains no <code>null</code> elements. * * @param elements * the array to check */ protected void assertElementsNotNull(Object[] elements) { Assert.isNotNull(elements); for (int i = 0, n = elements.length; i < n; ++i) { Assert.isNotNull(elements[i]); } if (InternalPolicy.DEBUG_LOG_EQUAL_VIEWER_ELEMENTS && elements.length > 1) { CustomHashtable elementSet = newHashtable(elements.length * 2); for (int i = 0; i < elements.length; i++) { Object element = elements[i]; Object old = elementSet.put(element, element); if (old != null) { String message = "Sibling elements in viewer must not be equal:\n " //$NON-NLS-1$ + old + ",\n " + element; //$NON-NLS-1$ Policy.getLog().log( new Status(IStatus.WARNING, Policy.JFACE, message, new RuntimeException())); return; } } } }
/** * Configures whether this structured viewer uses an internal hash table to * speeds up the mapping between elements and SWT items. This must be called * before the viewer is given an input (via <code>setInput</code>). * * @param enable * <code>true</code> to enable hash lookup, and * <code>false</code> to disable it */ public void setUseHashlookup(boolean enable) { Assert.isTrue(getInput() == null, "Can only enable the hash look up before input has been set");//$NON-NLS-1$ if (enable) { elementMap = newHashtable(CustomHashtable.DEFAULT_CAPACITY); } else { elementMap = null; } }
protected void handleDispose(DisposeEvent event) { super.handleDispose(event); sorter = null; comparer = null; if (filters != null) filters.clear(); elementMap = newHashtable(1); openListeners.clear(); doubleClickListeners.clear(); colorAndFontCollector.clear(); postSelectionChangedListeners.clear(); }
@Override protected void handleDispose(DisposeEvent event) { super.handleDispose(event); sorter = null; comparer = null; if (filters != null) filters.clear(); elementMap = newHashtable(1); openListeners.clear(); doubleClickListeners.clear(); colorAndFontCollector.clear(); postSelectionChangedListeners.clear(); }
@Override protected void handleDispose(DisposeEvent event) { super.handleDispose(event); sorter = null; comparer = null; if (filters != null) filters.clear(); elementMap = newHashtable(1); openListeners.clear(); doubleClickListeners.clear(); colorAndFontCollector.clear(); postSelectionChangedListeners.clear(); }