Examples of PlaceholderNode


Examples of com.bazaarvoice.jless.ast.node.PlaceholderNode

@Test
public class NodeTest {

    public void testChildIterators() {
        InternalNode p = new PlaceholderNode();
        p.addChild(new SimpleNode("c1"));
        p.addChild(new SimpleNode("c2"));
        p.addChild(new SimpleNode("c3"));
        p.addChild(new SimpleNode("c4"));

        RandomAccessListIterator i1 = p.pushChildIterator();
        i1.next();
        RandomAccessListIterator i2 = p.pushChildIterator();
        i2.next();
        i2.next();
        RandomAccessListIterator i3 = p.pushChildIterator();
        i3.next();
        i3.next();
        i3.next();

        Assert.assertEquals(i1.nextIndex(), 1);
        Assert.assertEquals(i2.nextIndex(), 2);
        Assert.assertEquals(i3.nextIndex(), 3);
       
        p.addChild(2, new SimpleNode("c2a"));

        Assert.assertEquals(i1.nextIndex(), 1);
        Assert.assertEquals(i2.nextIndex(), 3);
        Assert.assertEquals(i3.nextIndex(), 4);
    }
View Full Code Here

Examples of com.bazaarvoice.jless.ast.node.PlaceholderNode

                        Sp0(), FirstOf(';', Sequence(Ws0(), Test('}' ))),
                        peek(1).addChild(pop())
                ),
                // Empty rules are ignored
                Sequence(
                        Ident(), push(new PlaceholderNode()), Ws0(),
                        ':', Ws0(),
                        ';'
                )
        );
    }
View Full Code Here

Examples of com.bazaarvoice.jless.ast.node.PlaceholderNode

     * scope is cloned and placed onto the stack in place of the mixin reference. Additionally,
     * any arguments are applied to the mixin's scope.
     */
    boolean resolveMixinReference(String name, ArgumentsNode arguments) {
        if (!isParserTranslationEnabled()) {
            return push(new PlaceholderNode(new SimpleNode(name)));
        }

        // Walk down the stack, looking for a scope node that knows about a given rule set
        for (Node node : getContext().getValueStack()) {
            if (!(node instanceof ScopeNode)) {
View Full Code Here

Examples of com.google.gxp.compiler.base.PlaceholderNode

          } else {
            String example = phStart.getExample();
            if (example == null) {
              example = createExample(alertSink, phStart, content);
            }
            values.add(new PlaceholderNode(phStart, phStart.getName(), example, content));
          }
          phStart = null;
          destination = values;
          phChildren.clear();
        }
View Full Code Here

Examples of org.openbp.core.model.item.process.PlaceholderNode

   *
   * @return The new {@link PlaceholderNode}
   */
  public Node toNode(ProcessItem process, int syncFlags)
  {
    PlaceholderNode result = new PlaceholderNodeImpl();

    result.setProcess(process);
    result.copyFromItem(this, syncFlags);

    return result;
  }
View Full Code Here

Examples of org.openbp.core.model.item.process.PlaceholderNode

   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    PlaceholderNode node = (PlaceholderNode) entrySocket.getNode();

    NodeSocket nextSocket = node.getDefaultExitSocket();
    if (nextSocket == null)
    {
      String msg = LogUtil.error(getClass(), "No default exit socket present for placeholder node $0. [{1}]", node.getQualifier(), context);
      throw new EngineException("NoDefaultExitSocket", msg);
    }
    context.setCurrentSocket(nextSocket);
  }
View Full Code Here

Examples of org.openbp.core.model.item.process.PlaceholderNode

  public boolean handleEvent(VisualElementEvent event)
  {
    if (event.type == VisualElementEvent.DOUBLE_CLICK)
    {
      PlaceholderNode placeholderNode = (PlaceholderNode) node;

      if (placeholderNode.getReferencePath() == null)
      {
        // Double-clicking a placeholder w/o reference path means creating a reference to a process or process element.
        // We may either create a new one or choose an existing one.
        // Ask the user what he wants:

        ResourceCollection res = getDrawing().getEditor().getPluginResourceCollection();
        String title = res.getRequiredString("placeholder.referencedialog.title");
        String text = res.getRequiredString("placeholder.referencedialog.text");

        JMsgBox msgBox = new JMsgBox(null, title, text, JMsgBox.TYPE_YESNOCANCEL);
        msgBox.setResource(res);
        msgBox.setResourcePrefix("placeholder.referencedialog.");

        msgBox.initDialog();
        SwingUtil.show(msgBox);

        int choice = msgBox.getUserChoice();

        Model model = node.getOwningModel();

        if (choice == JMsgBox.TYPE_YES)
        {
          // Yes means create a new process
          final Item item = ItemCreationUtil.createItem(model, placeholderNode.getName(), placeholderNode.getDisplayName(), ItemTypes.PROCESS, null);
          if (item != null)
          {
            assignPlaceholderReference(item);

            // Open the new process
View Full Code Here

Examples of org.openbp.core.model.item.process.PlaceholderNode

    ProcessDrawing drawing = getDrawing();

    drawing.getEditor().startUndo("Create placeholder reference");

    // Assign the object reference to the placeholder
    PlaceholderNode placeholderNode = (PlaceholderNode) node;
    placeholderNode.setReferencePath(referencePath);

    // Make the skin reflect the change
    updateFigure();

    // Redisplay the placeholder properties
View Full Code Here

Examples of org.openbp.core.model.item.process.PlaceholderNode

    // Try to connect the control and data links from/to the placeholder to the new node

    // If the orientation of the new node figure and the drawing don't match,
    // rotate the figure
    PlaceholderNode plNode = (PlaceholderNode) getNode();

    // Try to connect

    // Iterate all sockets of the placeholder
    for (Iterator itSockets = plNode.getSockets(); itSockets.hasNext();)
    {
      // TODO Feature 6 NodeSocket plSocket = (NodeSocket) itSockets.next();
    }

    // Reinitialize the drawing
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.