Package org.waveprotocol.wave.client.editor.content

Examples of org.waveprotocol.wave.client.editor.content.AgentAdapter$Resources


     * Converts the <code>Application</code> XMLBean into a <code>UnitActionPackage</code> object.
     * @param application  the <code>Application</code> XMLBean to convert.
     * @return the converted <code>UnitActionPackage</code> object.
     */
    public static UnitActionPackage convertWADLtoUnitActionPackage(final Application application) {
        Resources resources = application.getResources();
        String baseURL = resources.getBase();
        if (!baseURL.endsWith("/")) {
            baseURL += "/";
        }
        List<Resource> resourceList = resources.getResourceList();

        List<UnitAction> unitActionList = new ArrayList<UnitAction>();
        for (Resource resource : resourceList) {
            unitActionList.addAll(convertResourceToUnitAction(resource));
        }
View Full Code Here


    public static String generateWADLForMashupRESTService(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
        addResource(resource, "json""format=json",  mashup, "application/json");
        addResource(resource, "xml",   "format=xml",   mashup, "application/xml");
        addResource(resource, "jsonp", "format=jsonp", mashup, "application/javascript");
View Full Code Here

    public static String generateWADLForMashupRESTServiceJSON(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
        addMethod(resource.addNewMethod(), "json", mashup, "application/json");
       
        return applicationDocument.xmlText(new XmlOptions().setSavePrettyPrint());
View Full Code Here

  private ContentElement root;
  private ContentRawDocument rawDoc;

  public void testDeferredHandlerMustHaveFlow() {
    deferredHandler(Flow.INLINE);
    AgentAdapter e1 = elem("ab");

    deferredHandler(Flow.USE_WIDGET);
    try {
      e1 = elem("ab");
      fail("USE_WIDGET should not be permitted with a null initial domImpl");
View Full Code Here

  @SuppressWarnings("static")
  public void testRegistersContainerNodelet() {
    complexHandler(Flow.INLINE);

    AgentAdapter e1 = elem("ab");
    Widget a = handler.getGwtWidget(e1);
    com.google.gwt.user.client.Element b = a.getElement();
    Node c = b.getFirstChild();
    Element d = e1.getContainerNodelet();
    assertSame(c,
        d);

  }
View Full Code Here

  @SuppressWarnings("static")
  public void testReceivesNewWidgetSafely() {
    simpleHandler(Flow.INLINE);

    AgentAdapter e1 = elem("ab");
    assertEquals("ab", ((Label) handler.getGwtWidget(e1)).getText());
    assertNull(e1.getContainerNodelet());
    assertEquals(1, panel.getWidgetCount());
    assertSame(e1.getImplNodelet(), handler.getGwtWidget(e1).getElement().getParentElement());


    Label label2 = new Label("hi");
    handler.receiveNewGwtWidget(e1, label2);
    assertSame(label2, handler.getGwtWidget(e1));
    assertSame(e1.getImplNodelet(), label2.getElement().getParentElement());

    Label label3 = new Label("there");
    handler.receiveNewGwtWidget(e1, label3);
    assertSame(label3, handler.getGwtWidget(e1));
    assertSame(e1.getImplNodelet(), label3.getElement().getParentElement());
    assertEquals(1, panel.getWidgetCount());
    assertSame(panel, handler.getGwtWidget(e1).getParent());

    // logical detach automatically
    rawDoc.removeChild(root, e1);
View Full Code Here

  @SuppressWarnings("static")
  public void testReceivesNewWidgetWithContainerNodeletSafely() {
    complexHandler(Flow.INLINE);

    assertEquals(0, panel.getWidgetCount());
    AgentAdapter e1 = elem("ab");
    assertEquals(1, panel.getWidgetCount());
    assertSame(e1.getImplNodelet(), handler.getGwtWidget(e1).getElement().getParentElement());
    assertSame(handler.getGwtWidget(e1).getElement().getFirstChild(),
        e1.getContainerNodelet());

    assertSame(panel, handler.getGwtWidget(e1).getParent());

    Widget w3 = createComplexWidget();
    handler.receiveNewGwtWidget(e1, w3);
    assertSame(w3, handler.getGwtWidget(e1));
    assertSame(e1.getImplNodelet(), w3.getElement().getParentElement());
    assertSame(w3.getElement().getFirstChild(), e1.getContainerNodelet());
    assertEquals(1, panel.getWidgetCount());
    assertSame(panel, handler.getGwtWidget(e1).getParent());

    // logical detach automatically
    rawDoc.removeChild(root, e1);
View Full Code Here

    return semanticHandler.renderSequence(view, firstItem, stopAt, dstParent, selectionMatcher);
  }

  private static NiceHtmlRenderer getSemanticHandler(ContentNode node) {
    if (node instanceof AgentAdapter) {
      AgentAdapter element = (AgentAdapter) node;
      NiceHtmlRenderer handler = element.getRegistry().getNiceHtmlRenderer(element);
      return handler != null ? handler : PasteFormatRenderers.DEEP_CLONE_RENDERER;
    } else {
      return PasteFormatRenderers.DEEP_CLONE_RENDERER;
    }
  }
View Full Code Here

    return semanticHandler.renderSequence(view, firstItem, stopAt, dstParent, selectionMatcher);
  }

  private static NiceHtmlRenderer getSemanticHandler(ContentNode node) {
    if (node instanceof AgentAdapter) {
      AgentAdapter element = (AgentAdapter) node;
      NiceHtmlRenderer handler = element.getRegistry().getNiceHtmlRenderer(element);
      return handler != null ? handler : PasteFormatRenderers.DEEP_CLONE_RENDERER;
    } else {
      return PasteFormatRenderers.DEEP_CLONE_RENDERER;
    }
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.editor.content.AgentAdapter$Resources

Copyright © 2018 www.massapicom. 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.