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.LineDrawComponent; 37 import org.nightlabs.editor2d.model.ShapeDrawComponentPropertySource; 38 39 40 public class LineTreeEditPart 41 extends DrawComponentTreeEditPart 42 { 43 public static Image LINE_ICON = SharedImages.getSharedImageDescriptor(EditorPlugin.getDefault(), 45 AbstractPaletteFactory.class, "Line").createImage(); 46 47 50 public LineTreeEditPart(LineDrawComponent drawComponent) { 51 super(drawComponent); 52 } 53 54 57 protected Image getImage() { 58 return LINE_ICON; 59 } 60 61 public LineDrawComponent getLineDrawComponent() { 62 return (LineDrawComponent) getModel(); 63 } 64 65 protected IPropertySource getPropertySource() 66 { 67 if (propertySource == null) 68 { 69 propertySource = 70 new ShapeDrawComponentPropertySource(getLineDrawComponent()); 71 } 72 return propertySource; 73 } 74 75 } 85 | Popular Tags |