1 27 28 package org.nightlabs.editor2d.edit.tree; 29 30 import org.eclipse.swt.graphics.Image; 31 import org.eclipse.ui.views.properties.IPropertySource; 32 import org.nightlabs.base.resource.SharedImages; 33 import org.nightlabs.editor2d.AbstractPaletteFactory; 34 import org.nightlabs.editor2d.DrawComponent; 35 import org.nightlabs.editor2d.EditorPlugin; 36 import org.nightlabs.editor2d.ImageDrawComponent; 37 import org.nightlabs.editor2d.model.ImagePropertySource; 38 39 public class ImageTreeEditPart 40 extends DrawComponentTreeEditPart 41 { 42 public static Image IMAGE_ICON = SharedImages.getSharedImageDescriptor(EditorPlugin.getDefault(), 43 AbstractPaletteFactory.class, "Image").createImage(); 44 45 public ImageTreeEditPart(ImageDrawComponent drawComponent) { 46 super(drawComponent); 47 } 48 49 protected Image getImage() { 50 return IMAGE_ICON; 51 } 52 53 public ImageDrawComponent getImageDrawComponent() { 54 return (ImageDrawComponent) getModel(); 55 } 56 57 protected IPropertySource getPropertySource() 58 { 59 if (propertySource == null) 60 { 61 propertySource = 62 new ImagePropertySource(getImageDrawComponent()); 63 } 64 return propertySource; 65 } 66 } 67 | Popular Tags |