Package org.eclipse.wb.internal.core.model.variable

Examples of org.eclipse.wb.internal.core.model.variable.VariableSupport


    // ensure convert local variable to field
    ensureConvertToField();
  }

  public void ensureConvertToField() throws Exception {
    VariableSupport variableSupport = m_javaInfo.getVariableSupport();
    if (variableSupport.canConvertLocalToField()) {
      variableSupport.convertLocalToField();
    }
  }
View Full Code Here


  public String getReference() throws Exception {
    return getReference(m_javaInfo);
  }

  public static String getReference(JavaInfo javaInfo) throws Exception {
    VariableSupport variableSupport = javaInfo.getVariableSupport();
    // handle this
    if (variableSupport instanceof ThisVariableSupport) {
      return "this";
    }
    // handle named variable
    if (variableSupport instanceof AbstractSimpleVariableSupport && variableSupport.hasName()) {
      return variableSupport.getName();
    }
    // handle exposed
    if (variableSupport instanceof ExposedPropertyVariableSupport
        || variableSupport instanceof ExposedFieldVariableSupport) {
      try {
        for (ASTNode node : javaInfo.getRelatedNodes()) {
          if (AstNodeUtils.isVariable(node)) {
            return CoreUtils.getNodeReference(node);
          }
        }
      } catch (Throwable e) {
      }
      String reference = getReference(javaInfo.getParentJava());
      if (reference != null) {
        return reference + "." + variableSupport.getTitle();
      }
    }
    return null;
  }
View Full Code Here

      assertEquals(null, creationSupport.getNode());
      assertEquals(null, ((IImplicitCreationSupport) creationSupport).getImplicitClipboard());
    }
    // VariableSupport
    {
      VariableSupport variableSupport = layoutData.getVariableSupport();
      assertInstanceOf(VirtualLayoutDataVariableSupport.class, variableSupport);
      assertTrue(variableSupport.isDefault());
      assertEquals("virtual-layout-data", variableSupport.toString());
      assertEquals("(virtual layout data)", variableSupport.getTitle());
      try {
        variableSupport.getStatementTarget();
        fail();
      } catch (IllegalStateException e) {
      }
    }
    // delete, do nothing
View Full Code Here

        CreationSupport creationSupport = layout.getCreationSupport();
        assertInstanceOf(ImplicitLayoutCreationSupport.class, creationSupport);
        assertTrue(creationSupport.canDelete());
      }
      {
        VariableSupport variableSupport = layout.getVariableSupport();
        assertInstanceOf(LocalUniqueVariableSupport.class, variableSupport);
        assertEquals("rowLayout", variableSupport.getName());
      }
      assertInstanceOf(ImplicitObjectAssociation.class, layout.getAssociation());
    }
    // check for "de-materializing" implicit layout
    {
View Full Code Here

TOP

Related Classes of org.eclipse.wb.internal.core.model.variable.VariableSupport

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.