Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IConfigurationElement


  public static String getWizardBannerPath(String serverTypeId) {
    if (!read) {
      readBrandingDefinitions();
    }
    IConfigurationElement config = brandingDefinitions.get(serverTypeId);
    if (config != null) {
      return config.getAttribute(ATTR_WIZ_BAN);
    }
    return null;
  }
View Full Code Here


    }
    return image;
  }

  public static ImageDescriptor getWizardBanner(String serverTypeId) {
    IConfigurationElement config = CloudFoundryBrandingExtensionPoint.getConfigurationElement(serverTypeId);
    String wizBanner = CloudFoundryBrandingExtensionPoint.getWizardBannerPath(serverTypeId);
    if (config != null && wizBanner != null && wizBanner.trim().length() > 0) {
      String bundle = config.getContributor().getName();
      return AbstractUIPlugin.imageDescriptorFromPlugin(bundle, wizBanner);
    }
    return null;
  }
View Full Code Here

   *
   * @return Bundle
   */
  protected URL getPageExtensionPath(String extensionPoint, String extensionName) {
    List extensions = serverManager.getExtensions(extensionPoint, extensionName);
    IConfigurationElement winner = null;
    int highest = -100000;
    for (int i = 0; i < extensions.size(); i++) {
      IConfigurationElement extension = (IConfigurationElement) extensions.get(i);
      int priority = Integer.parseInt(extension.getAttribute(IDavinciServerConstants.EP_ATTR_PAGE_PRIORITY));
      if ( priority > highest ) {
        winner = extension;
        highest = priority;
      }
    }
View Full Code Here

public class WizardHelper
{
    public static RepositoryWizard loadWizard(IRepositoryType type) throws CoreException
    {
        IConfigurationElement e = findWizardConfig(type.getId());

        if (e == null)
        {
            throw SigilCore.newCoreException("No wizard registered for repository "
                + type, null);
        }

        return (RepositoryWizard) e.createExecutableExtension("class");
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.davinci.server.IServerManager#getUserManager()
   */
  public IUserManager getUserManager() {
    if (userManager == null) {
      IConfigurationElement libraryElement = ServerManager.getServerManager().getExtension(IDavinciServerConstants.EXTENSION_POINT_USER_MANAGER, IDavinciServerConstants.EP_TAG_USER_MANAGER);
      if (libraryElement != null) {
        try {
          this.userManager = (IUserManager) libraryElement.createExecutableExtension(IDavinciServerConstants.EP_ATTR_CLASS);
        } catch (CoreException e) {
          theLogger.logp(Level.SEVERE, ServerManager.class.getName(), "getUserManager", "unexpected failure", e);
          throw new Error(e);
        }
      }
View Full Code Here


  public IConfigurationElement getExtension(String extensionPoint, String elementTag) {
    IExtension[] extensions = this.getExtensions(extensionPoint);

    IConfigurationElement winner = null;
    int highest = -100000;
    for(int i=0;i<extensions.length;i++){
      IConfigurationElement[] elements = extensions[i].getConfigurationElements();
      for (int j = 0; j < elements.length; j++) {
        if (elements[j].getName().equals(elementTag)) {
View Full Code Here

  }

  public IPersonManager getPersonManager() {

    if(this.personManager==null){
      IConfigurationElement libraryElement = ServerManager.getServerManager().getExtension(IDavinciServerConstants.EXTENSION_POINT_PERSON_MANAGER,
          IDavinciServerConstants.EP_TAG_PERSON_MANAGER);
      if (libraryElement != null) {
        try {
          this.personManager = (IPersonManager) libraryElement.createExecutableExtension(IDavinciServerConstants.EP_ATTR_CLASS);
        } catch (CoreException e) {
          theLogger.logp(Level.SEVERE, ServerManager.class.getName(), "getPersonManager", "unexpected failure", e);
          throw new Error(e);
        }
      }
View Full Code Here

   
    if(initFiles){
      List extensions = ServerManager.getServerManager().getExtensions(IDavinciServerConstants.EXTENSION_POINT_INITIAL_USER_FILES,
                  IDavinciServerConstants.EP_TAG_INITIAL_USER_FILE);
          for (Iterator iterator = extensions.iterator(); iterator.hasNext();) {
              IConfigurationElement libraryElement = (IConfigurationElement) iterator.next();
              String path = libraryElement.getAttribute(IDavinciServerConstants.EP_ATTR_INITIAL_USER_FILE_PATH);
              String name = libraryElement.getDeclaringExtension().getContributor().getName();
              Bundle bundle = Activator.getActivator().getOtherBundle(name);
              IStorage file = null;
        try {
         
          file = new StorageFileSystem(project.getURI().getPath()+ "/" + basePath);
View Full Code Here

        IDavinciServerConstants.EP_TAG_AJAXLIBRARY);
    this.installedLibraries = new Library[extensions.size()];
    int count = -1;
    for (Iterator iterator = extensions.iterator(); iterator.hasNext();) {
      count++;
      IConfigurationElement libraryElement = (IConfigurationElement) iterator
          .next();
      String id = libraryElement
          .getAttribute(IDavinciServerConstants.EP_ATTR_METADATA_ID);
      String version = libraryElement
          .getAttribute(IDavinciServerConstants.EP_ATTR_METADATA_VERSION);

      if (id == null || version == null || id.equals("")
          || version.equals("")) {
        System.err
            .println("Problem reading library data, no ID or Version defined :"
                + libraryElement.getName());

      }
      Library libInfo = findLibrary(id, version);

      if (libInfo == null) {
        libInfo = new BundleLibraryInfo(id, version);
        this.installedLibraries[count] = libInfo;
      }
      String required = libraryElement
          .getAttribute(IDavinciServerConstants.EP_ATTR_REQUIRED);
      ((BundleLibraryInfo) libInfo).setRequired(required);
     
      IConfigurationElement[] libraryPathElements = libraryElement
          .getChildren(IDavinciServerConstants.EP_TAG_LIBRARYPATH);

      for (int i = 0; i < libraryPathElements.length; i++) {
        String virtualPath = libraryPathElements[i]
            .getAttribute(IDavinciServerConstants.EP_ATTR_LIBRARYPATH_NAME);
        String bundlePath = libraryPathElements[i]
            .getAttribute(IDavinciServerConstants.EP_ATTR_LIBRARYPATH_LOCATION);
        String source = libraryPathElements[i]
                .getAttribute(IDavinciServerConstants.EP_ATTR_LIBRARYPATH_SOURCE);
        ((BundleLibraryInfo) libInfo).setBasePath(bundlePath, virtualPath, source);
      }

      if (libInfo instanceof BundleLibraryInfo) {
        ((BundleLibraryInfo) libInfo).bundleBase = getLibraryBundle(libraryElement);
      }

      IConfigurationElement[] meta = libraryElement.getChildren("metadata");
      for (int i = 0; i < meta.length; i++) {
        libInfo.setMetadataPath(meta[i].getAttribute("location"));
      }
     
     
View Full Code Here

  private static IFormatterProcessorFactory getFormatterFactory() {
    if (formatterFactory == null) {
      IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(extensionName);
      for (int i = 0; i < elements.length; i++) {
        final IConfigurationElement element = elements[i];
        if (element.getName().equals("processor")) { //$NON-NLS-1$
          SafeRunner.run(new ISafeRunnable() {
            public void run() throws Exception {
              final Object object = element.createExecutableExtension("class"); //$NON-NLS-1$
              if (object instanceof IFormatterProcessorFactory) {
                formatterFactory = (IFormatterProcessorFactory) object;
              }
            }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IConfigurationElement

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.