Examples of JavaInfo


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

  // IComplexPropertyEditor
  //
  ////////////////////////////////////////////////////////////////////////////
  public Property[] getProperties(Property _property) throws Exception {
    GenericProperty property = (GenericProperty) _property;
    JavaInfo javaInfo = property.getJavaInfo();
    Property[] properties = (Property[]) javaInfo.getArbitraryValue(this);
    if (properties == null) {
      Shell shell = Display.getCurrent().getActiveShell();
      GwtState state = getState(javaInfo);
      properties = new Property[2];
      properties[0] = new UrlProperty(shell, property, state);
      properties[1] = new Bundle_Property(shell, property);
      javaInfo.putArbitraryValue(this, properties);
    }
    return properties;
  }
View Full Code Here

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

          expression,
          "com.google.gwt.user.client.ui.AbstractImagePrototype",
          "createImage()")) {
        MethodInvocation createImageInvocation = (MethodInvocation) expression;
        Expression prototypeExpression = createImageInvocation.getExpression();
        JavaInfo rootJava = m_property.getJavaInfo().getRootJava();
        for (ImageBundleInfo bundle : ImageBundleContainerInfo.getBundles(rootJava)) {
          for (ImageBundlePrototypeDescription prototype : bundle.getPrototypes()) {
            if (prototype.isRepresentedBy(prototypeExpression)) {
              return prototype;
            }
View Full Code Here

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

  /**
   * Exposes <code>Face</code> with given name, so that its properties can be modified.
   */
  private void addFace(String faceName) throws Exception {
    final JavaInfo face = JavaInfoUtils.addChildExposedByMethod(this, "get" + faceName);
    m_faces.add(face);
    // create ComplexProperty for each face
    {
      ComplexProperty faceProperty = new ComplexProperty(faceName, "(Face properties)") {
        @Override
        public void setValue(Object value) throws Exception {
          if (value == Property.UNKNOWN_VALUE) {
            face.delete();
          }
        }
      };
      faceProperty.setProperties(face.getProperties());
      faceProperty.setCategory(PropertyCategory.system(100 + m_faces.size()));
      m_faceProperties.add(faceProperty);
    }
    // when any face property is about to set, reset other properties
    face.addBroadcastListener(new GenericPropertySetValue() {
      public void invoke(GenericPropertyImpl property, Object[] value, boolean[] shouldSetValue)
          throws Exception {
        if (property.getJavaInfo() == face) {
          face.delete();
        }
      }
    });
  }
View Full Code Here

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

          Expression argument,
          String[] source) throws Exception {
        if (ReflectionUtils.isSuccessorOf(
            parameter.getType(),
            "com.google.gwt.user.client.ui.ImageBundle")) {
          JavaInfo imageBundle = root.getChildRepresentedBy(argument);
          if (imageBundle instanceof ImageBundleInfo) {
            source[0] =
                IMAGE_BUNDLE
                    + imageBundle.getDescription().getComponentClass().getCanonicalName()
                    + "|";
          }
        }
      }
View Full Code Here

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

  //
  ////////////////////////////////////////////////////////////////////////////
  @Override
  public Expression getExpression(JavaInfo javaInfo) throws Exception {
    Point location = getLocation(javaInfo);
    JavaInfo formatter = getFormatter(javaInfo);
    for (MethodInvocation invocation : formatter.getMethodInvocations(m_methodSignature)) {
      List<Expression> arguments = DomGenerics.arguments(invocation);
      int row = (Integer) JavaInfoEvaluationHelper.getValue(arguments.get(0));
      int cell = (Integer) JavaInfoEvaluationHelper.getValue(arguments.get(1));
      if (row == location.y && cell == location.x) {
        return arguments.get(2);
View Full Code Here

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

          StatementTarget target = getTarget();
          Point location = getLocation(javaInfo);
          String argumentsSource =
              TemplateUtils.format("{0}, {1}, {2}", location.y, location.x, source);
          // add invocation
          JavaInfo formatter = getFormatter(javaInfo);
          MethodInvocation invocation =
              formatter.addMethodInvocation(target, m_methodSignature, argumentsSource);
          // remember values because they will be asked later because of
          // GenericPropertyImpl.rememberValueIntoExpression(Object)
          // TODO ask Mitin and may be remove "remember"
          {
            List<Expression> arguments = DomGenerics.arguments(invocation);
View Full Code Here

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

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

      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

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

        // 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

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

              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
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.