X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Feditor%2FP3DContentOutlinePage.java;h=ed9c4a5baf8eed40b62c3e23c1e98c403b96c7dd;hb=3f17b6e42935927f12683fc26ecd5808bf66cde6;hp=a4e8bafd14b3d777ebaaa0e69b790d1408c85d0f;hpb=4a656971025eea4b563933179d6120d0e87e7549;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DContentOutlinePage.java b/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DContentOutlinePage.java index a4e8bafd..ed9c4a5b 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DContentOutlinePage.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DContentOutlinePage.java @@ -6,8 +6,11 @@ import java.util.List; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.resource.LocalResourceManager; +import org.eclipse.jface.viewers.DecorationOverlayIcon; +import org.eclipse.jface.viewers.IDecoration; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.events.MenuDetectEvent; import org.eclipse.swt.events.MenuDetectListener; @@ -19,6 +22,7 @@ import org.simantics.g3d.scenegraph.base.ParentNode; import org.simantics.g3d.vtk.common.NodeSelectionProvider2; import org.simantics.g3d.vtk.common.VTKContentOutlinePage; import org.simantics.plant3d.Activator; +import org.simantics.plant3d.ontology.Plant3D; import org.simantics.plant3d.scenegraph.EndComponent; import org.simantics.plant3d.scenegraph.Equipment; import org.simantics.plant3d.scenegraph.Nozzle; @@ -30,7 +34,7 @@ import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint; public class P3DContentOutlinePage extends VTKContentOutlinePage{ - private static final boolean DEBUG = true; + private static final boolean DEBUG = false; protected Menu contextMenu; private LocalResourceManager manager = new LocalResourceManager(JFaceResources.getResources()); @@ -41,14 +45,33 @@ public class P3DContentOutlinePage extends VTKContentOutlinePage rootNode, NodeSelectionProvider2 provider) { super(rootNode,provider); - nozzleImage = manager.createImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Nozzle.png")); - pipeImage = manager.createImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Straight.png")); - tankImage = manager.createImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/tank.png")); - elbowImage = manager.createImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Elbow.png")); - componentImage = manager.createImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Component.png")); + ImageDescriptor nozzleDesc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Nozzle.png"); + ImageDescriptor straightDesc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Straight.png"); + ImageDescriptor tankDesc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/tank.png"); + ImageDescriptor elbowDesc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Elbow.png"); + ImageDescriptor componentDesc = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Component.png"); + nozzleImage = manager.createImage(nozzleDesc); + pipeImage = manager.createImage(straightDesc); + tankImage = manager.createImage(tankDesc); + elbowImage = manager.createImage(elbowDesc); + componentImage = manager.createImage(componentDesc); + + ImageDescriptor error = Activator.imageDescriptorFromPlugin("org.simantics.issues.ui", "icons/warning_decoration.png"); + nozzleErrorImage = manager.createImage(new DecorationOverlayIcon(nozzleDesc, error, IDecoration.BOTTOM_RIGHT)); + pipeErrorImage = manager.createImage(new DecorationOverlayIcon(straightDesc, error, IDecoration.BOTTOM_RIGHT)); + tankErrorImage = manager.createImage(new DecorationOverlayIcon(tankDesc, error, IDecoration.BOTTOM_RIGHT)); + elbowErrorImage = manager.createImage(new DecorationOverlayIcon(elbowDesc, error, IDecoration.BOTTOM_RIGHT)); + componentErrorImage = manager.createImage(new DecorationOverlayIcon(componentDesc, error, IDecoration.BOTTOM_RIGHT)); } @Override @@ -117,6 +140,18 @@ public class P3DContentOutlinePage extends VTKContentOutlinePage