Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ISourceModule


  /*
   * Method declared in IAction.
   */
  @Override
  public final void run() {
    ISourceModule inputElement = EditorUtility.getEditorInputModelElement(
        fEditor, false);
    if (!(inputElement instanceof ISourceModule && inputElement.exists()))
      return;

    // ITypeRoot typeRoot= (ITypeRoot) inputElement;
    ISourceRange sourceRange;
    try {
      sourceRange = inputElement.getSourceRange();
      if (sourceRange == null || sourceRange.getLength() == 0) {
        MessageDialog
            .openInformation(
                fEditor.getEditorSite().getShell(),
                Messages.StructureSelectionAction_0,
View Full Code Here


   */
  private boolean isEnabled(ITextSelection selection) {
    if (fEditor == null || selection == null)
      return false;
    if (fEditor.getModelElement() instanceof ISourceModule) {
      ISourceModule sourceModule = (ISourceModule) fEditor
          .getModelElement();
      IModelElement element = getSelectionModelElement(
          selection.getOffset(), selection.getLength(), sourceModule);
      if (element == null) {
        return false;
View Full Code Here

  /*
   * (non-Javadoc) Method declared on SelectionDispatchAction.
   */
  public void run(ITextSelection selection) {
    ISourceModule input = SelectionConverter.getInput(fEditor);
    if (!ActionUtil.isProcessable(getShell(), input))
      return;

    try {
      IModelElement[] elements = SelectionConverter
View Full Code Here

      // if (classFile != null) {
      // enclosingElement= classFile.getElementAt(selection.getOffset());
      // }
      // break;
      case IModelElement.SOURCE_MODULE:
        ISourceModule cu = (ISourceModule) input
            .getAncestor(IModelElement.SOURCE_MODULE);
        if (cu != null) {
          enclosingElement = cu.getElementAt(selection.getOffset());
        }
        break;
      }
      if (enclosingElement != null
          && enclosingElement.getElementType() == IModelElement.METHOD) {
View Full Code Here

  public AbstraceConciliatorTest(String name) {
    super(name);
  }

  protected Program createProgram(IFile file) {
    ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(file);
    Program program = null;
    try {
      program = createProgramFromSource(sourceModule);
 
    } catch (Exception e) {
View Full Code Here

    }
    return program;
  }

  public Program createProgramFromSource(IFile file) throws Exception {
    ISourceModule source = DLTKCore.createSourceModuleFrom(file);
    return createProgramFromSource(source);
  }
View Full Code Here

  }

  public static boolean isProcessable(Shell shell, PHPStructuredEditor editor) {
    if (editor == null)
      return true;
    ISourceModule input = SelectionConverter.getInput(editor);
    // if a PHP editor doesn't have an input of type PHP element
    // then it is for sure not on the build path
    if (input == null) {
      return false;
    }
View Full Code Here

  /*
   * (non-JavaDoc) Method declared in SelectionDispatchAction.
   */
  public final void run(ITextSelection ts) {
    ISourceModule input = getEditorInput(fEditor);
    if (!ActionUtil.isProcessable(getShell(), input))
      return;
    FindOccurrencesEngine engine = FindOccurrencesEngine
        .create(new MethodExitsFinder());
    try {
View Full Code Here

    try {
      project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
      PHPCoreTests.waitForIndexer();
      PHPCoreTests.waitForAutoBuild();

      ISourceModule sourceModule = DLTKCore.createSourceModuleFrom(file);
      ModuleDeclaration moduleDecl = SourceParserUtil
          .getModuleDeclaration(sourceModule);

      ASTNodeSearcher searcher = new ASTNodeSearcher(sourceModule,
          criteriaFunction);
View Full Code Here

   * org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse
   * .jface.text.IDocument)
   */
  public void apply(IDocument document) {
    try {
      ISourceModule unit = getCompilationUnit();
      IEditorPart part = null;
      if (unit.getResource().exists()) {
        boolean canEdit = performValidateEdit(unit);
        if (!canEdit) {
          return;
        }
        part = EditorUtility.isOpenInEditor(unit);
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.