Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ISourceModule


  }
 
 
  private void generate(final List<GetterSetterEntry> entries, final int modifier, final boolean generateComments, final boolean fluent) throws Exception {

    ISourceModule source = type.getSourceModule();     
    String name = type.getElementName().replace("$", "");     
    StringBuffer buffer = new StringBuffer(name);     
    buffer.replace(0, 1, Character.toString(Character.toUpperCase(name.charAt(0))));     
    name = buffer.toString();     
         
View Full Code Here


//        "Element is not a type");
//    }
//  }
 
  protected QuerySpecification createQuery(DefUnit defunit) throws ModelException {
    ISourceModule sourceModule = EditorUtility.getEditorInputModelElement(deeEditor, false);
    IType type = (IType) DeeModelEngine.findCorrespondingModelElement(defunit, sourceModule);
    if (type == null) {
      return super.createQuery(defunit);
    }
    DLTKSearchScopeFactory factory = DLTKSearchScopeFactory.getInstance();
View Full Code Here

    String moduleFQName = defunit.getModuleFullyQualifiedName();
    if(moduleFQName == null) {
      isInsideInterpreterEnvironment = false;
    } else {
      ModuleFullName nameDescriptor = new ModuleFullName(moduleFQName);
      ISourceModule element = SourceModuleFinder.findModuleUnit(scriptProject,
        nameDescriptor.getPackages(), nameDescriptor.getModuleSimpleName());
      // review this
      isInsideInterpreterEnvironment = element == null? false : factory.isInsideInterpreter(element);
    }
    return isInsideInterpreterEnvironment;
View Full Code Here

  public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
    ITextEditor editor = tryCast(getEditor(), ITextEditor.class);
    if(editor == null) {
      return null;
    }
    ISourceModule sourceModule = EditorUtility.getEditorInputModelElement(editor, false);
    if(sourceModule == null) {
      return null;
    }
   
    int offset = hoverRegion.getOffset();
View Full Code Here

  public static ISourceModule getSourceModule(String filepath) {
    return DLTKCore.createSourceModuleFrom(getFile(filepath));
  }
 
  public static ISourceModule getSourceModule(String srcFolder, String filepath) {
    ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(getFile(srcFolder + "/" + filepath));
    assertTrue(sourceModule.exists());
    return sourceModule;
  }
View Full Code Here

  public static class ElementsAndDefUnitVisitor {
   
    public void visitElementsAndNodes(IModelElement element, int depth) throws CoreException,
    InvalidPathExceptionX {
      if(element instanceof ISourceModule) {
        final ISourceModule sourceModule = (ISourceModule) element;
        Path filePath = DLTKUtils.getFilePath(sourceModule);
        ParsedModule parseModule = DToolClient.getDefaultModuleCache().getParsedModuleOrNull(filePath);
        if(parseModule == null)
          return;
       
View Full Code Here

    assertTrue(file.exists());
    return file;
  }
 
  public ISourceModule getSourceModule(String pathString) {
    ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(getFile(pathString));
    assertTrue(sourceModule != null);
    return sourceModule;
  }
View Full Code Here

public class DeeModelElement_Test extends CommonDeeWorkspaceTest implements ITestResourcesConstants,
  DefElementFlagConstants {
 
  public static ISourceModule getSourceModule(String srcFolder, String cuPath) {
    ISourceModule sourceModule = SampleMainProject.getSourceModule(srcFolder, cuPath);
    assertTrue(sourceModule.exists());
    return sourceModule;
  }
View Full Code Here

  }
 
  @Test
  public void testBasic() throws Exception { testBasic$(); }
  public void testBasic$() throws Exception {
    ISourceModule srcModule = getSourceModule(TR_SAMPLE_SRC1, "sampledefs.d");
    final IType topLevelElement = srcModule.getType("sampledefs");
   
    new SampleModelElementsVisitor(srcModule) {
      @Override
      public void visitAllModelElements(
        IType _Module,
View Full Code Here

  }
 
  @Test
  public void testImplicitModuleName() throws Exception { testImplicitModuleName$(); }
  public void testImplicitModuleName$() throws Exception {
    ISourceModule srcModule = getSourceModule(TR_SAMPLE_SRC1, "moduleDeclImplicitName.d");
    assertEquals(srcModule.getElementName(), "moduleDeclImplicitName.d");
   
    assertTrue(ModelElementTestUtils.getChildren(srcModule, "moduleDeclImplicitName").size() > 0);
   
    IType topLevelElement = srcModule.getType("moduleDeclImplicitName");
   
    assertTrue(topLevelElement.getNameRange().getOffset() == 0);
   
    checkElementExists(srcModule, topLevelElement.getType("Foo"),
      EArcheType.Class, "class Foo");
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.ISourceModule

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.