--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.modeling.ui.modelBrowser.model;\r
+\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.simantics.browsing.ui.common.node.IDeletable;\r
+import org.simantics.browsing.ui.common.node.IModifiable;\r
+import org.simantics.browsing.ui.content.Labeler.Modifier;\r
+import org.simantics.browsing.ui.graph.impl.LabelModifier;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.modeling.ui.Activator;\r
+\r
+@Deprecated\r
+public class State extends Node implements IModifiable, IDeletable {\r
+\r
+ public State(Resource resource) {\r
+ super(resource);\r
+ }\r
+\r
+ @Override\r
+ public Collection<?> getChildren(ReadGraph g) {\r
+ return Collections.emptyList();\r
+ }\r
+\r
+ @Override\r
+ public ImageDescriptor getImage(ReadGraph g) {\r
+ return Activator.STATE_ICON;\r
+ }\r
+\r
+ @Override\r
+ public Modifier getModifier(final Session session, String columnId) {\r
+ return new LabelModifier(session, resource);\r
+ }\r
+\r
+ @Override\r
+ public void handleDelete(WriteGraph graph) throws DatabaseException {\r
+ // Must remove:\r
+ // 1. the state itself\r
+ // 2. all references to it state as an initial state from experiments\r
+\r
+ // Handles both 1. and 2.\r
+ super.handleDelete(graph);\r
+ }\r
+\r
+}\r