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.EditorPlugin; 34 import org.nightlabs.editor2d.Layer; 35 import org.nightlabs.editor2d.model.LayerPropertySource; 36 import org.nightlabs.editor2d.views.LayerView; 37 38 39 public class LayerTreeEditPart 40 extends DrawComponentContainerTreeEditPart 41 { 42 public static Image LAYER_ICON = SharedImages.getSharedImageDescriptor(EditorPlugin.getDefault(), 43 LayerView.class).createImage(); 44 45 48 public LayerTreeEditPart(Layer layer) { 49 super(layer); 50 } 51 52 55 public Image getImage() { 56 return LAYER_ICON; 57 } 58 59 public Layer getLayer() { 60 return (Layer) getModel(); 61 } 62 63 protected IPropertySource getPropertySource() 64 { 65 if (propertySource == null) 66 { 67 propertySource = 68 new LayerPropertySource(getLayer()); 69 } 70 return propertySource; 71 } 72 } 73 | Popular Tags |