package org.simantics.modeling.requests; import java.util.Collection; import org.simantics.db.Resource; import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.diagram.stubs.DiagramResource; /** * @author Tuukka Lehtonen */ public class SetFlagExternal { Collection flags; boolean external; public SetFlagExternal(Collection flags, boolean external) { this.flags = flags; this.external = external; } public void perform(WriteGraph graph) throws DatabaseException { DiagramResource DIA = DiagramResource.getInstance(graph); for (Resource flag : flags) { if (external) graph.claim(flag, DIA.ExternalFlag, DIA.ExternalFlag, flag); else graph.deny(flag, DIA.ExternalFlag); } } }