Package org.eclipse.wb.core.model

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


    }
    return pastedObjects;
  }

  public void commandMove(Object object, Object nextObject) throws Exception {
    JavaInfo item = (JavaInfo) object;
    JavaInfo nextItem = (JavaInfo) nextObject;
    // move item
    if (item instanceof MenuItemInfo) {
      JavaInfoUtils.move(item, getNewItemAssociation(), m_menu, nextItem);
    } else if (item instanceof MenuItemSeparatorInfo) {
      JavaInfoUtils.move(item, getNewSeparatorAssociation(), m_menu, nextItem);
View Full Code Here


      Class<?> superClass = getSuperClass(editor, typeBinding_super);
      // prepare creation
      MethodDeclaration constructor = getConstructor(editor, typeDeclaration);
      ThisCreationSupport creationSupport = new ThisCreationSupport(constructor);
      // create JavaInfo
      JavaInfo javaInfo = JavaInfoUtils.createJavaInfo(editor, superClass, creationSupport);
      if (javaInfo != null) {
        javaInfo.setVariableSupport(new ThisVariableSupport(javaInfo, constructor));
        // prepare root context
        List<MethodDeclaration> rootMethods = Lists.newArrayList();
        rootMethods.add(constructor);
        return new ParseRootContext(javaInfo, new ExecutionFlowDescription(rootMethods));
      }
View Full Code Here

    if (creation.getAnonymousClassDeclaration() != null) {
      typeBinding = typeBinding.getSuperclass();
    }
    // check "super"
    {
      JavaInfo javaInfo =
          super.create(editor, creation, methodBinding, typeBinding, arguments, argumentInfos);
      if (javaInfo != null) {
        return javaInfo;
      }
    }
View Full Code Here

    if (!hasGWT(editor)) {
      return null;
    }
    // check "super"
    {
      JavaInfo javaInfo =
          super.create(
              editor,
              invocation,
              methodBinding,
              arguments,
              expressionInfo,
              argumentInfos,
              javaInfoResolver);
      if (javaInfo != null) {
        return javaInfo;
      }
    }
    // RootPanel.get()
    if (AstNodeUtils.isMethodInvocation(
        invocation,
        "com.google.gwt.user.client.ui.RootPanel",
        new String[]{"get()", "get(java.lang.String)"})) {
      JavaInfo rootPanel = javaInfoResolver.getJavaInfo(invocation);
      if (rootPanel == null) {
        rootPanel =
            JavaInfoUtils.createJavaInfo(
                editor,
                getClass(editor, methodBinding.getReturnType()),
                new RootPanelCreationSupport(invocation));
      }
      return rootPanel;
    }
    // RootLayoutPanel.get()
    if (AstNodeUtils.isMethodInvocation(
        invocation,
        "com.google.gwt.user.client.ui.RootLayoutPanel",
        "get()")) {
      JavaInfo rootPanel = javaInfoResolver.getJavaInfo(invocation);
      if (rootPanel == null) {
        rootPanel =
            JavaInfoUtils.createJavaInfo(
                editor,
                getClass(editor, methodBinding.getReturnType()),
View Full Code Here

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

          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

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

          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

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

          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

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.