Package at.bestsolution.efxclipse.tooling.fxgraph.fXGraph

Examples of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.StaticValueProperty


    }
  }
 
  @Override
  public void completeStaticValueProperty_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    StaticValueProperty staticProperty = null;
    if( model instanceof Element ) {
      staticProperty = (StaticValueProperty) model.eContainer();
    } else {
      staticProperty = (StaticValueProperty) model;
    }
   
    EObject eo = staticProperty.eContainer();
    Element target = null;
   
    while( eo.eContainer() != null ) {
      if( eo.eContainer() instanceof Element ) {
        target = (Element) eo.eContainer();
        break;
      }
      eo = eo.eContainer();
    }
       
    if( target == null ) {
      return;
    }
   
    try {
      IJavaProject javaProject = projectProvider.getJavaProject(staticProperty.eResource().getResourceSet());
      IType type = javaProject.findType(target.getType().getQualifiedName());
     
      if (type != null) {
        IFXClass fxClazz = FXPlugin.getClassmodel().findClass(javaProject, type);
        if (fxClazz != null) {
          IFXProperty fxProp = fxClazz.getStaticProperty(staticProperty.getName());
          if (fxProp != null) {
            completeProperty_ValueProposals(fxProp, model, context, FXGraphPackage.Literals.STATIC_VALUE_PROPERTY__VALUE, acceptor);
          }
        }
      }
View Full Code Here


            }
          }
        }
      }
    } else if( object instanceof StaticValueProperty ) {
      StaticValueProperty sp = (StaticValueProperty) object;
     
      EObject eo = sp.eContainer();
      Element target = null;
     
      while( eo.eContainer() != null ) {
        if( eo.eContainer() instanceof Element ) {
          target = (Element) eo.eContainer();
          break;
        }
        eo = eo.eContainer();
      }
         
      if( target != null ) {
        if( target.getType() != null ) {
          IType t = getJDTType(target.getType().getType());
          if( t != null ) {
            IFXClass fxClass = FXPlugin.getClassmodel().findClass(t.getJavaProject(), t);
            if( fxClass != null ) {
              IFXProperty fxp = fxClass.getStaticProperty(sp.getName());
              if( fxp != null ) {
                return createHover(fxp.getJavaElement(), object, viewer, region);
              }
            }
          }
        }
      }
    } else if( object instanceof ValueProperty ) {
      if( object instanceof ControllerHandledValueProperty ) {
        ControllerHandledValueProperty cp = (ControllerHandledValueProperty) object;
       
        Model m = (Model) object.eResource().getContents().get(0);
       
        if( m != null ) {
          ComponentDefinition def = m.getComponentDef();
          if( def != null ) {
            if( def.getController() != null && def.getController().getType() != null) {
              IType t = getJDTType(def.getController().getType());
              if( t != null ) {
                IFXCtrlClass fxClass = FXPlugin.getClassmodel().findCtrlClass(t.getJavaProject(), t);
                if( fxClass != null ) {
                  IFXCtrlEventMethod fxp = fxClass.getAllEventMethods().get(cp.getMethodname());
                  if( fxp != null ) {
                    return createHover(fxp.getJavaElement(), object, viewer, region);
                  }
                }
              }
            }
          }
        }
      } else if( object instanceof SimpleValueProperty ) {
        SimpleValueProperty sp = (SimpleValueProperty) object;
        if( sp.eContainer() instanceof Property && sp.getStringValue() != null ) {
          Property p = (Property) sp.eContainer();
         
          if( p.eContainer() instanceof Element ) {
            Element e = (Element) p.eContainer();
            if( e.getType() != null ) {
              IType t = getJDTType(e.getType().getType());
              if( t != null ) {
                IFXClass fxClass = FXPlugin.getClassmodel().findClass(t.getJavaProject(), t);
                if( fxClass != null ) {
                  IFXProperty fxp = fxClass.getProperty(p.getName());
                  if( fxp instanceof IFXEnumProperty ) {
                    IType enumType = ((IFXEnumProperty) fxp).getEnumType();
                    try {
                      for (IField f : enumType.getFields()) {
                        if (Flags.isEnum(f.getFlags())) {
                          if( f.getElementName().equals(sp.getStringValue()) ) {
                            return createHover(f, object, viewer, region);
                          }
                        }
                      }
                    } catch (JavaModelException ex) {
View Full Code Here

    } else if (value instanceof ScriptValueReference) {
      formattedValue = "scriptvalue "
          + ((ScriptValueReference) value).getReference();

    } else if (value instanceof StaticValueProperty) {
      StaticValueProperty p = (StaticValueProperty) value;
      StringBuffer sb = new StringBuffer();
      if (p.getModifier() != null) {
        sb.append(p.getModifier() + " ");
      }
      sb.append("static " + p.getName() + " : ");
      sb.append(new ValuePropertyFormatter(p.getValue())
          .getFormattedValue());
      formattedValue = sb.toString();
    } else if (value instanceof StaticCallValueProperty) {
      StaticCallValueProperty p = (StaticCallValueProperty) value;
      StringBuffer sb = new StringBuffer();
      if (p.getModifier() != null) {
        sb.append(p.getModifier() + " ");
      }
      sb.append("call " + p.getType().getSimpleName() + " # "
          + p.getName() + " : ");
      sb.append(new ValuePropertyFormatter(p.getValue())
          .getFormattedValue());
      formattedValue = sb.toString();
    } else if (value instanceof ConstValueProperty) {
      ConstValueProperty p = (ConstValueProperty) value;
      StringBuffer sb = new StringBuffer();
      sb.append("const " + p.getType().getSimpleName() + "#"
          + p.getField());
      formattedValue = sb.toString();
    } else if (value instanceof IncludeValueProperty) {
      IncludeValueProperty inc = (IncludeValueProperty) value;
      formattedValue = "include " + "source=" + inc.getSource()
          + " name=" + inc.getName(); // TODO
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.StaticValueProperty

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.