Examples of ISourceParser


Examples of org.dyno.visual.swing.plugin.spi.ISourceParser

    ParserFactory factory = ParserFactory.getDefaultParserFactory();
    if (factory == null)
      throw new Exception("No parser factory available!");
    ICompilationUnit unit = JavaCore.createCompilationUnitFrom(file.getFile());
    hostProject = unit.getJavaProject();
    ISourceParser sourceParser = factory.newParser();
    isParsing = true;
    VisualSwingPlugin.setCurrentEditor(this);
    this.designer.setCompilationUnit(unit);
    try {
      WidgetAdapter adapter = sourceParser.parse(unit, monitor);
      if (adapter != null) {
        designer.initRootWidget(adapter);
        setUpLookAndFeel(adapter.getWidget().getClass());
        designer.initNamespaceWithUnit(unit);
        refreshTree();
View Full Code Here

Examples of org.dyno.visual.swing.plugin.spi.ISourceParser

        IFileEditorInput file = (IFileEditorInput) getEditorInput();
        setPartName(file.getName());
        setTitleToolTip(file.getToolTipText());
        ParserFactory factory = ParserFactory.getDefaultParserFactory();
        if (factory != null) {
          ISourceParser sourceParser = factory.newParser();
          Component root = designer.getRoot();
          if (root != null) {
            WidgetAdapter rootAdapter = WidgetAdapter.getWidgetAdapter(root);
            JavaUtil.hideMenu();
            String lnfCN = getLnfClassname();
            rootAdapter.setPreferredLookAndFeel(lnfCN); //$NON-NLS-1$
            ICompilationUnit unit = sourceParser.generate(rootAdapter, monitor);
            rootAdapter.setPreferredLookAndFeel(null); //$NON-NLS-1$
            if (unit != null) {
              designer.initNamespaceWithUnit(unit);
              designer.setLnfChanged(false);
            }
View Full Code Here

Examples of org.eclipse.dltk.ast.parser.ISourceParser

  protected CodeBlock[] getCodeBlocks(String code, int offset) {
    /*
     * if an ASTVisitor implementation is created for this, just override getFoldingVisitor() and
     * remove this method
     */
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = (ModuleDeclaration) pp.parse(new ModuleSource(code), null);
    List statements = md.getStatements();
    if (statements == null) {
      return new CodeBlock[0];
    }

View Full Code Here

Examples of org.eclipse.dltk.ast.parser.ISourceParser

    // fPairs = pairs;
    this.editor = editor;
  }

  private PairBlock[] computePairRanges(final int offset, String contents) {
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = null;// pp.parse(null, contents.toCharArray(),
    // null);
    IModelElement el = this.editor.getInputModelElement();
    if (el != null && el instanceof ISourceModule) {
      md = SourceParserUtil.getModuleDeclaration((ISourceModule) el, null);
    }
    if (md == null) {
      md = (ModuleDeclaration) pp.parse(new ModuleSource(contents), null);
    }
    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
View Full Code Here

Examples of org.eclipse.dltk.ast.parser.ISourceParser

  protected CodeBlock[] getCodeBlocks(String code, int offset) {
    /*
     * if an ASTVisitor implementation is created for this, just override getFoldingVisitor() and
     * remove this method
     */
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = (ModuleDeclaration) pp.parse(new ModuleSource(code), null);
    List statements = md.getStatements();
    if (statements == null) {
      return new CodeBlock[0];
    }

View Full Code Here

Examples of org.eclipse.dltk.ast.parser.ISourceParser

    // fPairs = pairs;
    this.editor = editor;
  }

  private PairBlock[] computePairRanges(final int offset, String contents) {
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = null;// pp.parse(null, contents.toCharArray(),
    // null);
    IModelElement el = this.editor.getInputModelElement();
    if (el != null && el instanceof ISourceModule) {
      md = SourceParserUtil.getModuleDeclaration((ISourceModule) el, null);
    }
    if (md == null) {
      md = (ModuleDeclaration) pp.parse(new ModuleSource(contents), null);
    }
    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
View Full Code Here

Examples of org.eclipse.dltk.ast.parser.ISourceParser

  @Override
  public IBuildParticipant createBuildParticipant(IScriptProject project)
      throws CoreException {
    if (natureId != null) {
      final ISourceParser parser = DLTKLanguageManager
          .getSourceParser(natureId);
      if (parser != null) {
        return new ParserBuildParticipant(parser);
      }
    }
View Full Code Here

Examples of org.eclipse.dltk.ast.parser.ISourceParser

  protected void parse(IProject project, IFile file, Reporter reporter)
    throws Exception
  {
    // lame cast, but we have to use the SourceModule for pdt.
    IModuleSource module = (IModuleSource)DltkUtils.getSourceModule(file);
    ISourceParser parser = SourceParserManager
      .getInstance().getSourceParser(project, getNature());
    parser.parse(module, reporter);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.