Package org.eclipse.pde.core.plugin

Examples of org.eclipse.pde.core.plugin.IPluginBase


     * @return the string plugin identifier with an optional version set at the
     *         newest version if there is more than one plugin that responds to
     *         the given id
     */
    private String getBundleId(final IPluginModelBase model) {
        final IPluginBase base = model.getPluginBase();
        final String id = base.getId();
        final StringBuffer buffer = new StringBuffer(id);

        final ModelEntry entry = PluginRegistry.findEntry(id);
        if (entry.getActiveModels().length > 1) {
            buffer.append(VERSION_SEPARATOR);
View Full Code Here


    public static final char VERSION_SEPARATOR = '*';

    public static IPluginModelBase findClosestPluginMatch(String version, IPluginModelBase[] models) {
        for (int i = 0; i < models.length; i++) {
            final IPluginBase base = models[i].getPluginBase();

            // match only if...
            // a) if we have the same version
            // b) no version
            // c) all else fails, if there's just one bundle available, use it
            if (base.getVersion().equals(version) || version.length() == 0 || models.length == 1) {
                return models[i];
            }
        }

        return null;
View Full Code Here

    if (getBooleanOption(KEY_PRODUCT_BRANDING))
      createProductExtension();
  }

  private void createViewExtension() throws CoreException {
    IPluginBase plugin = model.getPluginBase();
    IPluginExtension extension = createExtension("org.eclipse.ui.views", true); //$NON-NLS-1$
    IPluginModelFactory factory = model.getPluginFactory();
   
    String fullClassName = getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_VIEW_PART_CLASS); //$NON-NLS-1$ //$NON-NLS-2$
    IPluginElement viewElement = factory.createElement(extension);
    viewElement.setName("view"); //$NON-NLS-1$
    viewElement.setAttribute("id", fullClassName); //$NON-NLS-1$
    viewElement.setAttribute("name", getStringOption(KEY_VIEW_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
    viewElement.setAttribute("icon", "icons/sample.gif"); //$NON-NLS-1$ //$NON-NLS-2$
    viewElement.setAttribute("class", fullClassName); //$NON-NLS-1$
    extension.add(viewElement);
   
    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
 
  private void createApplicationExtension() throws CoreException {
    IPluginBase plugin = model.getPluginBase();

    IPluginExtension extension = createExtension("org.eclipse.core.runtime.applications", true); //$NON-NLS-1$
    extension.setId(VALUE_APPLICATION_ID);

    IPluginElement element = model.getPluginFactory().createElement(extension);
    element.setName("application"); //$NON-NLS-1$
    extension.add(element);

    IPluginElement run = model.getPluginFactory().createElement(element);
    run.setName("run"); //$NON-NLS-1$
    run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_APPLICATION_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$
    element.add(run);

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

    if (!extension.isInTheModel())
      plugin.add(extension);
  }

  private void createPerspectiveExtension() throws CoreException {
    IPluginBase plugin = model.getPluginBase();

    IPluginExtension extension = createExtension("org.eclipse.ui.perspectives", true); //$NON-NLS-1$
    IPluginElement element = model.getPluginFactory().createElement(extension);
    element.setName("perspective"); //$NON-NLS-1$
    element.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + ".Perspective"); //$NON-NLS-1$ //$NON-NLS-2$
    element.setAttribute("name", VALUE_PERSPECTIVE_NAME); //$NON-NLS-1$
    element.setAttribute("id", plugin.getId() + ".perspective"); //$NON-NLS-1$ //$NON-NLS-2$
    extension.add(element);

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

    if (!extension.isInTheModel())
      plugin.add(extension);
  }

  private void createProductExtension() throws CoreException {
    IPluginBase plugin = model.getPluginBase();
    IPluginExtension extension = createExtension("org.eclipse.core.runtime.products", true); //$NON-NLS-1$
    extension.setId(VALUE_PRODUCT_ID);

    IPluginElement element = model.getFactory().createElement(extension);
    element.setName("product"); //$NON-NLS-1$
    element.setAttribute("name", getStringOption(KEY_WINDOW_TITLE)); //$NON-NLS-1$ 
    element.setAttribute("application", plugin.getId() + "." + VALUE_APPLICATION_ID); //$NON-NLS-1$ //$NON-NLS-2$

    IPluginElement property = model.getFactory().createElement(element);

    property = model.getFactory().createElement(element);
    property.setName("property"); //$NON-NLS-1$
    property.setAttribute("name", "windowImages"); //$NON-NLS-1$ //$NON-NLS-2$
    property.setAttribute("value", "icons/alt_window_16.gif,icons/alt_window_32.gif"); //$NON-NLS-1$ //$NON-NLS-2$
    element.add(property);

    extension.add(element);

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

  @Override
  protected void updateModel(IProgressMonitor monitor) throws CoreException {
    Activator.getDefault().acquireService(IBundleProjectService.class);
   
    IPluginBase plugin = model.getPluginBase();
    IPluginExtension extension = createExtension("org.eclipse.ui.views", true); //$NON-NLS-1$
    IPluginModelFactory factory = model.getPluginFactory();
   
    String fullClassName = getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_VIEW_PART_CLASS); //$NON-NLS-1$ //$NON-NLS-2$
    IPluginElement viewElement = factory.createElement(extension);
    viewElement.setName("view"); //$NON-NLS-1$
    viewElement.setAttribute("id", fullClassName); //$NON-NLS-1$
    viewElement.setAttribute("name", getStringOption(KEY_VIEW_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
    viewElement.setAttribute("icon", "icons/sample.gif"); //$NON-NLS-1$ //$NON-NLS-2$
    viewElement.setAttribute("class", fullClassName); //$NON-NLS-1$
    extension.add(viewElement);
   
    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

   
    updateBuildModel();
  }

  private void createApplicationExtension() throws CoreException {
    IPluginBase plugin = model.getPluginBase();

    IPluginExtension extension = createExtension("org.eclipse.core.runtime.applications", true); //$NON-NLS-1$
    extension.setId(VALUE_APPLICATION_ID);

    IPluginElement element = model.getPluginFactory().createElement(extension);
    element.setName("application"); //$NON-NLS-1$
    extension.add(element);

    IPluginElement run = model.getPluginFactory().createElement(element);
    run.setName("run"); //$NON-NLS-1$
    run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_APPLICATION_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$
    element.add(run);

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
 
  private void createProductExtension() throws CoreException {
    IPluginBase plugin = model.getPluginBase();
    IPluginExtension extension = createExtension("org.eclipse.core.runtime.products", true); //$NON-NLS-1$
    extension.setId(VALUE_PRODUCT_ID);

    IPluginElement element = model.getFactory().createElement(extension);
    element.setName("product"); //$NON-NLS-1$
    element.setAttribute("name", getStringOption(KEY_WINDOW_TITLE)); //$NON-NLS-1$ 
    element.setAttribute("application", plugin.getId() + "." + VALUE_APPLICATION_ID); //$NON-NLS-1$ //$NON-NLS-2$

    IPluginElement property = model.getFactory().createElement(element);

    property = model.getFactory().createElement(element);
    property.setName("property"); //$NON-NLS-1$
    property.setAttribute("name", "windowImages"); //$NON-NLS-1$ //$NON-NLS-2$
    property.setAttribute("value", "icons/alt_window_16.gif,icons/alt_window_32.gif"); //$NON-NLS-1$ //$NON-NLS-2$
    element.add(property);

    extension.add(element);

    if (!extension.isInTheModel())
      plugin.add(extension);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.pde.core.plugin.IPluginBase

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.