1 27 28 package org.nightlabs.editor2d.edit.tree; 29 30 import org.eclipse.jface.resource.ImageDescriptor; 31 import org.eclipse.swt.graphics.Image; 32 import org.eclipse.ui.views.properties.IPropertySource; 33 34 import org.nightlabs.base.resource.SharedImages; 35 import org.nightlabs.editor2d.AbstractPaletteFactory; 36 import org.nightlabs.editor2d.EditorPlugin; 37 import org.nightlabs.editor2d.RectangleDrawComponent; 38 import org.nightlabs.editor2d.model.EllipsePropertySource; 39 import org.nightlabs.editor2d.model.ShapeDrawComponentPropertySource; 40 41 42 public class RectangleTreeEditPart 43 extends DrawComponentTreeEditPart 44 { 45 public static Image RECTANGLE_ICON = SharedImages.getSharedImageDescriptor(EditorPlugin.getDefault(), 48 AbstractPaletteFactory.class, "Rectangle").createImage(); 49 50 53 public RectangleTreeEditPart(RectangleDrawComponent model) { 54 super(model); 55 } 56 57 protected IPropertySource getPropertySource() 58 { 59 if (propertySource == null) 60 { 61 propertySource = 62 new ShapeDrawComponentPropertySource(getRectangleDrawComponent()); 63 } 64 return propertySource; 65 } 66 67 protected RectangleDrawComponent getRectangleDrawComponent() { 68 return (RectangleDrawComponent) getModel(); 69 } 70 71 74 public Image getImage() { 75 return RECTANGLE_ICON; 76 } 77 78 } 79 | Popular Tags |