Package org.eclipse.wb.core.model

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


   */
  public void command_MOVE(ColumnConfigInfo column, ColumnConfigInfo nextColumn) throws Exception {
    ArrayCreation columnsArray = getColumnsArray(true);
    Assert.isNotNull(columnsArray);
    ArrayInitializer arrayInitializer = columnsArray.getInitializer();
    JavaInfo oldParent = column.getParent() instanceof JavaInfo ? column.getParentJava() : null;
    int oldIndex = column.getParent().getChildren(ColumnConfigInfo.class).indexOf(column);
    int newIndex = getChildren(ColumnConfigInfo.class).indexOf(nextColumn);
    newIndex = newIndex == -1 ? arrayInitializer.expressions().size() : newIndex;
    // fire before event
    getBroadcastObject().childMoveBefore(getParent(), column, nextColumn);
View Full Code Here


      ClassInstanceCreation fieldCreation =
          ((ConstructorCreationSupport) child.getCreationSupport()).getCreation();
      menuExpression = DomGenerics.arguments(fieldCreation).get(1);
    }
    // create new Menu
    JavaInfo menu =
        JavaInfoUtils.createJavaInfo(
            getEditor(),
            "com.extjs.gxt.ui.client.widget.menu.Menu",
            new ConstructorCreationSupport());
    // prepare "new Menu()" source
    String menuSource;
    {
      StatementTarget statementTarget =
          new StatementTarget(AstNodeUtils.getEnclosingStatement(menuExpression), true);
      NodeTarget nodeTarget = new NodeTarget(statementTarget);
      menuSource = menu.getCreationSupport().add_getSource(nodeTarget);
    }
    // replace "null" with "new Menu()"
    menuExpression = getEditor().replaceExpression(menuExpression, menuSource);
    menu.setVariableSupport(new EmptyVariableSupport(menu, menuExpression));
    menu.getCreationSupport().add_setSourceExpression(menuExpression);
    // add Menu as child
    menu.setAssociation(new ConstructorChildAssociation());
    addChild(menu);
  }
View Full Code Here

        // prepare bean class
        Type type = CoreUtils.getType(fragment, true);
        Class<?> beanClass =
            CoreUtils.load(classLoader, AstNodeUtils.getFullyQualifiedName(type, true));
        // prepare association widget
        JavaInfo widget = getJavaInfoRepresentedBy(root, fragment.getName().getIdentifier());
        //
        IReferenceProvider referenceProvider = new FragmentReferenceProvider(fragment);
        //
        IObservePresentation presentation =
            new BeanObservePresentation(beanClass, referenceProvider, widget, beanImage);
View Full Code Here

              Class<?> beanClass =
                  CoreUtils.load(
                      CoreUtils.classLoader(root),
                      AstNodeUtils.getFullyQualifiedName(type, true));
              // prepare association widget
              JavaInfo widget = getJavaInfoRepresentedBy(root, fragment.getName().getIdentifier());
              //
              IReferenceProvider referenceProvider = new FragmentReferenceProvider(fragment);
              //
              IObservePresentation presentation =
                  new BeanObservePresentation(beanClass,
View Full Code Here

          }
        });
  }

  private static JavaInfo getJavaInfoRepresentedBy(JavaInfo rootJavaInfo, final String variable) {
    final JavaInfo result[] = new JavaInfo[1];
    rootJavaInfo.accept(new ObjectInfoVisitor() {
      @Override
      public boolean visit(ObjectInfo objectInfo) throws Exception {
        if (result[0] == null && objectInfo instanceof JavaInfo) {
          JavaInfo javaInfo = (JavaInfo) objectInfo;
          if (variable.equals(JavaInfoReferenceProvider.getReference(javaInfo))) {
            result[0] = javaInfo;
          }
        }
        return result[0] == null;
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();
    // create model
    JavaInfo layoutData;
    {
      AstEditor editor = getContainer().getEditor();
      CreationSupport creationSupport = new VirtualLayoutDataCreationSupport(widget, dataObject);
      layoutData = JavaInfoUtils.createJavaInfo(editor, getLayoutDataClass(), creationSupport);
    }
    // configure
    layoutData.setVariableSupport(new VirtualLayoutDataVariableSupport(layoutData));
    layoutData.setAssociation(new EmptyAssociation());
    // add to widget
    widget.addChild(layoutData);
  }
View Full Code Here

    if (m_addPostInitializeContext) {
      methodLines.add("//");
      methodLines.add("postInitializeBindings();");
    }
    //
    JavaInfo javaInfoRoot = provider.getJavaInfoRoot();
    AstEditor editor = javaInfoRoot.getEditor();
    TypeDeclaration typeDeclaration = JavaInfoUtils.getTypeDeclaration(javaInfoRoot);
    BodyDeclarationTarget target = new BodyDeclarationTarget(typeDeclaration, null, false);
    MethodDeclaration lastInfoMethod = getLastInfoDeclaration(javaInfoRoot);
    //
    if (m_initDataBindings != null) {
View Full Code Here

    final JavaInfo[] result = {rootJavaInfo};
    rootJavaInfo.accept0(new ObjectInfoVisitor() {
      @Override
      public void endVisit(ObjectInfo objectInfo) throws Exception {
        if (objectInfo instanceof UIObjectInfo) {
          JavaInfo info = (JavaInfo) objectInfo;
          if (JavaInfoUtils.getMethodDeclaration(info) != m_initDataBindings) {
            result[0] = info;
          }
        }
      }
View Full Code Here

      if (result != null) {
        return result;
      }
    }
    if (m_javaInfo.isRoot()) {
      JavaInfo javaInfo = m_javaInfo.getChildRepresentedBy(node);
      if (javaInfo != null) {
        return resolve(javaInfo);
      }
    }
    return null;
View Full Code Here

  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  protected boolean isCreateProperty(ObjectInfo objectInfo) throws Exception {
    if (objectInfo instanceof JavaInfo) {
      JavaInfo javaInfo = (JavaInfo) objectInfo;
      if (JavaInfoUtils.hasTrueParameter(javaInfo, "databinding.disable")) {
        return false;
      }
    }
    return objectInfo instanceof FieldInfo
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.