Package org.eclipse.wb.core.model

Examples of org.eclipse.wb.core.model.JavaInfo


    return ExecutionUtils.runObjectLog(new RunnableObjectEx<Boolean>() {
      public Boolean runObject() throws Exception {
        if (mementoObject instanceof List) {
          List<JavaInfoMemento> mementos = (List<JavaInfoMemento>) mementoObject;
          for (JavaInfoMemento memento : mementos) {
            JavaInfo component = memento.create(m_menu);
            if (!isValidObjectType(component)) {
              return false;
            }
          }
          return true;
View Full Code Here


        }
      }

      private void removeRootPanel(List<JavaInfo> components) throws Exception {
        for (Iterator<JavaInfo> I = components.iterator(); I.hasNext();) {
          JavaInfo javaInfo = I.next();
          if (javaInfo instanceof RootPanelInfo) {
            I.remove();
            // break parent/child association
            javaInfo.removeChild(m_this);
            m_this.setParent(null);
          }
        }
      }
    });
View Full Code Here

    return ExecutionUtils.runObjectLog(new RunnableObjectEx<Boolean>() {
      public Boolean runObject() throws Exception {
        if (mementoObject instanceof List) {
          List<JavaInfoMemento> mementos = (List<JavaInfoMemento>) mementoObject;
          for (JavaInfoMemento memento : mementos) {
            JavaInfo component = memento.create(m_menu);
            if (!isValidObjectType(component)) {
              return false;
            }
          }
          return true;
View Full Code Here

        }
      }

      private void addContentPanel() throws Exception {
        AstEditor editor = getEditor();
        JavaInfo content =
            JavaInfoUtils.createJavaInfo(
                editor,
                "com.gwtext.client.widgets.Panel",
                new ConstructorCreationSupport());
        // set CreationSupport
        Expression expression;
        {
          ClassInstanceCreation creation =
              ((ConstructorCreationSupport) getCreationSupport()).getCreation();
          expression = DomGenerics.arguments(creation).get(0);
          String contentSource = content.getCreationSupport().add_getSource(null);
          expression = editor.replaceExpression(expression, contentSource);
          content.getCreationSupport().add_setSourceExpression(expression);
          content.addRelatedNode(expression);
        }
        // set Association
        content.setAssociation(new ConstructorChildAssociation());
        // set VariableSupport
        VariableSupport variableSupport = new EmptyVariableSupport(content, expression);
        content.setVariableSupport(variableSupport);
        // add content Panel as child
        addChild(content);
      }
    });
  }
View Full Code Here

      }

      @Override
      public void addAfter(JavaInfo parent, JavaInfo child) throws Exception {
        if (child == m_this) {
          JavaInfo newHTML =
              JavaInfoUtils.createJavaInfo(
                  getEditor(),
                  "com.google.gwt.user.client.ui.HTML",
                  new ConstructorCreationSupport());
          LocalUniqueVariableSupport variableSupport = new LocalUniqueVariableSupport(newHTML);
          JavaInfoUtils.add(
              newHTML,
              variableSupport,
              PureFlatStatementGenerator.INSTANCE,
              AssociationObjects.invocationChild("%parent%.setEl(%child%.getElement())", true),
              m_this,
              null);
          variableSupport.inline();
          newHTML.getPropertyByTitle("html").setValue("New BoxComponent");
        }
      }
    });
  }
View Full Code Here

   * change them, at this moment we "materialize" {@link LayoutDataInfo} in source code.
   */
  private void createVirtualLayoutData(WidgetInfo widget) throws Exception {
    Object dataObject = getDefaultVirtualDataObject(widget);
    // create model
    JavaInfo layoutData;
    {
      CreationSupport creationSupport = new VirtualLayoutDataCreationSupport(widget, dataObject);
      layoutData =
          JavaInfoUtils.createJavaInfo(getEditor(), getLayoutDataClass(widget), creationSupport);
    }
    // configure
    layoutData.setVariableSupport(new VirtualLayoutDataVariableSupport(layoutData));
    layoutData.setAssociation(new EmptyAssociation());
    // add to widget
    widget.addChild(layoutData);
  }
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  public EditPart createEditPart(EditPart context, Object model) {
    // use generic EditPart for placeholders
    if (model instanceof JavaInfo) {
      JavaInfo javaInfo = (JavaInfo) model;
      if (javaInfo.isPlaceholder()) {
        return null;
      }
    }
    // ask factories
    for (IEditPartFactory factory : FACTORIES) {
View Full Code Here

        "com.google.gwt.user.cellview.client.CellList")) {
      return;
    }
    // create info
    ConstructorCreationSupport creationSupport = new ConstructorCreationSupport();
    JavaInfo cellList =
        JavaInfoUtils.createJavaInfo(
            getEditor(),
            "com.google.gwt.user.cellview.client.CellList",
            creationSupport);
    // configure info
    cellList.setVariableSupport(new EmptyVariableSupport(cellList, cellListExpression));
    creationSupport.add_setSourceExpression(cellListExpression);
    // add info as child
    cellList.setAssociation(new ConstructorChildAssociation());
    addChild(cellList);
  }
View Full Code Here

    /**
     * @return the <code>setWidth</code> {@link MethodInvocation}, may be <code>null</code>.
     */
    private MethodInvocation getInvocation() {
      JavaInfo parent = getParentJava();
      // check setWidth(Column,*) invocations
      List<MethodInvocation> invocations = parent.getMethodInvocations();
      for (MethodInvocation invocation : invocations) {
        if (invocation.getName().getIdentifier().equals("setColumnWidth")) {
          List<Expression> arguments = DomGenerics.arguments(invocation);
          if (arguments.size() >= 2) {
            Expression columnExpression = arguments.get(0);
View Full Code Here

    return ExecutionUtils.runObjectLog(new RunnableObjectEx<Boolean>() {
      public Boolean runObject() throws Exception {
        if (mementoObject instanceof List) {
          List<JavaInfoMemento> mementos = (List<JavaInfoMemento>) mementoObject;
          for (JavaInfoMemento memento : mementos) {
            JavaInfo component = memento.create(m_menu);
            if (!isValidObjectType(component)) {
              return false;
            }
          }
          return true;
View Full Code Here

TOP

Related Classes of org.eclipse.wb.core.model.JavaInfo

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.