/** * Returns the field decoration registered by the specified id . * * @param id * the String id used to access the decoration. * @return the FieldDecoration with the specified id, or <code>null</code> * if there is no decoration with the specified id. */ public FieldDecoration getFieldDecoration(String id) { Object entry = decorations.get(id); if (entry == null) { return null; } return ((Entry) entry).getDecoration(); }
/** * Registers a field decoration using the specified id. An image id and an * image registry are supplied. The image will not be created until the * decoration is requested. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * * @param imageId * the id of the image in the supplied image registry that is * used for this decorator * @param imageRegistry * the registry used to obtain the image */ public void registerFieldDecoration(String id, String description, String imageId, ImageRegistry imageRegistry) { decorations.put(id, new Entry(description, imageId, imageRegistry)); // Recompute the maximums since this could be a replacement recomputeMaximums(); }
/** * Registers a field decoration using the specified id. An image id and an * image registry are supplied. The image will not be created until the * decoration is requested. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * * @param imageId * the id of the image in the supplied image registry that is * used for this decorator * @param imageRegistry * the registry used to obtain the image */ public void registerFieldDecoration(String id, String description, String imageId, ImageRegistry imageRegistry) { decorations.put(id, new Entry(description, imageId, imageRegistry)); // Recompute the maximums since this could be a replacement recomputeMaximums(); }
/** * Registers a field decoration using the specified id. An image id of an * image located in the default JFaceResources image registry is supplied. * The image will not be created until the decoration is requested. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * * @param imageId * the id of the image in the JFaceResources image registry that * is used for this decorator */ public void registerFieldDecoration(String id, String description, String imageId) { decorations.put(id, new Entry(description, imageId, JFaceResources .getImageRegistry())); // Recompute the maximums as this could be a replacement of a previous // image. recomputeMaximums(); }
/** * Registers a field decoration using the specified id. The lifecyle of the * supplied image should be managed by the client. That is, it will never be * disposed by this registry and the decoration should be removed from the * registry if the image is ever disposed elsewhere. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * @param image * the image to be used in the decoration */ public void registerFieldDecoration(String id, String description, Image image) { decorations.put(id, new Entry(description, image)); // Recompute the maximums since this might be a replacement recomputeMaximums(); }
/** * Registers a field decoration using the specified id. An image id of an * image located in the default JFaceResources image registry is supplied. * The image will not be created until the decoration is requested. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * * @param imageId * the id of the image in the JFaceResources image registry that * is used for this decorator */ public void registerFieldDecoration(String id, String description, String imageId) { decorations.put(id, new Entry(description, imageId, JFaceResources .getImageRegistry())); // Recompute the maximums as this could be a replacement of a previous // image. recomputeMaximums(); }
/** * Registers a field decoration using the specified id. An image id of an * image located in the default JFaceResources image registry is supplied. * The image will not be created until the decoration is requested. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * * @param imageId * the id of the image in the JFaceResources image registry that * is used for this decorator */ public void registerFieldDecoration(String id, String description, String imageId) { decorations.put(id, new Entry(description, imageId, JFaceResources .getImageRegistry())); // Recompute the maximums as this could be a replacement of a previous // image. recomputeMaximums(); }
/** * Registers a field decoration using the specified id. The lifecyle of the * supplied image should be managed by the client. That is, it will never be * disposed by this registry and the decoration should be removed from the * registry if the image is ever disposed elsewhere. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * @param image * the image to be used in the decoration */ public void registerFieldDecoration(String id, String description, Image image) { decorations.put(id, new Entry(description, image)); // Recompute the maximums since this might be a replacement recomputeMaximums(); }
/** * Registers a field decoration using the specified id. The lifecyle of the * supplied image should be managed by the client. That is, it will never be * disposed by this registry and the decoration should be removed from the * registry if the image is ever disposed elsewhere. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * @param image * the image to be used in the decoration */ public void registerFieldDecoration(String id, String description, Image image) { decorations.put(id, new Entry(description, image)); // Recompute the maximums since this might be a replacement recomputeMaximums(); }
/** * Registers a field decoration using the specified id. An image id and an * image registry are supplied. The image will not be created until the * decoration is requested. * * @param id * the String id used to identify and access the decoration. * @param description * the String description to be used in the decoration, or * <code>null</code> if the decoration has no description. * * @param imageId * the id of the image in the supplied image registry that is * used for this decorator * @param imageRegistry * the registry used to obtain the image */ public void registerFieldDecoration(String id, String description, String imageId, ImageRegistry imageRegistry) { decorations.put(id, new Entry(description, imageId, imageRegistry)); // Recompute the maximums since this could be a replacement recomputeMaximums(); }
/** * Returns the field decoration registered by the specified id . * * @param id * the String id used to access the decoration. * @return the FieldDecoration with the specified id, or <code>null</code> * if there is no decoration with the specified id. */ public FieldDecoration getFieldDecoration(String id) { Object entry = decorations.get(id); if (entry == null) { return null; } return ((Entry) entry).getDecoration(); }
private void recomputeMaximums() { Iterator<Entry> entries = decorations.values().iterator(); maxDecorationHeight = 0; maxDecorationWidth = 0; while (entries.hasNext()) { Image image = entries.next().getDecoration().getImage(); if (image != null) { maxDecorationHeight = Math.max(maxDecorationHeight, image.getBounds().height); maxDecorationWidth = Math.max(maxDecorationWidth, image.getBounds().width); } } } }
private void recomputeMaximums() { Iterator<Entry> entries = decorations.values().iterator(); maxDecorationHeight = 0; maxDecorationWidth = 0; while (entries.hasNext()) { Image image = entries.next().getDecoration().getImage(); if (image != null) { maxDecorationHeight = Math.max(maxDecorationHeight, image.getBounds().height); maxDecorationWidth = Math.max(maxDecorationWidth, image.getBounds().width); } } } }
/** * Returns the field decoration registered by the specified id . * * @param id * the String id used to access the decoration. * @return the FieldDecoration with the specified id, or <code>null</code> * if there is no decoration with the specified id. */ public FieldDecoration getFieldDecoration(String id) { Object entry = decorations.get(id); if (entry == null) { return null; } return ((Entry) entry).getDecoration(); }
private void recomputeMaximums() { Iterator entries = decorations.values().iterator(); maxDecorationHeight = 0; maxDecorationWidth = 0; while (entries.hasNext()) { Image image = ((Entry)entries.next()).getDecoration().getImage(); if (image != null) { maxDecorationHeight = Math.max(maxDecorationHeight, image.getBounds().height); maxDecorationWidth = Math.max(maxDecorationWidth, image.getBounds().width); } } } }