コード例 #1
0
 @Override
 public void initialize(IPath containerPath, IScriptProject scriptProject) throws CoreException {
   if (containerPath.segmentCount() > 0 && containerPath.segment(0).equals(CONTAINER_PATH)) {
     try {
       if (isPHPProject(scriptProject)) {
         DLTKCore.setBuildpathContainer(
             containerPath,
             new IScriptProject[] {scriptProject},
             new IBuildpathContainer[] {new LanguageModelContainer(containerPath, scriptProject)},
             null);
       }
     } catch (final Exception e) {
       GeneratorBeautifierPlugin.log(e);
     }
   }
 }
コード例 #2
0
  public PHPSourceElementRequestor(ISourceElementRequestor requestor, IModuleSource sourceModule) {
    super(requestor);

    // Load PHP source element requester extensions
    final IConfigurationElement[] elements =
        Platform.getExtensionRegistry()
            .getConfigurationElementsFor(PHPCorePlugin.ID, "phpSourceElementRequestors");
    final List<PHPSourceElementRequestorExtension> requestors =
        new ArrayList<PHPSourceElementRequestorExtension>(elements.length);
    for (final IConfigurationElement element : elements) {
      try {
        final PHPSourceElementRequestorExtension extension =
            (PHPSourceElementRequestorExtension) element.createExecutableExtension("class");
        extension.setRequestor(fRequestor);
        extension.setSourceModule(sourceModule);
        requestors.add(extension);
      } catch (final CoreException e) {
        GeneratorBeautifierPlugin.log(e);
        // Logger.logException(e);
      }
    }
    extensions = requestors.toArray(new PHPSourceElementRequestorExtension[requestors.size()]);
  }