Runtime

## org.eclipse.gmf.runtime.diagram.ui.services.palette
Class PaletteService

    java.lang.Object
      org.eclipse.gmf.runtime.common.core.service.AbstractProvider
          org.eclipse.gmf.runtime.common.core.service.Service
              org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteService

All Implemented Interfaces:
  java.util.EventListener, IPaletteProvider, IProvider, IProviderChangeListener

public class PaletteService
extends Service
implements IPaletteProvider

Nested Class Summary
`protected static class` `PaletteService.ProviderDescriptor`

Field Summary
`static java.lang.String` `GROUP_STANDARD` the standard group id
`static java.lang.String` `SEPARATOR_STANDARD` the standard separator id
`static java.lang.String` `TOOL_SELECTION` the standard separator id

Fields inherited from class org.eclipse.gmf.runtime.common.core.service.Service
`INVALID_ELEMENT_MESSAGE_PATTERN`

Constructor Summary
`protected` `PaletteService()` Creates a new instance of the Palette Service

Method Summary
`void` `contributeToPalette(IEditorPart editor, java.lang.Object content, PaletteRoot root, java.util.Map predefinedEntries)` Contributes to the palette of the given editor with the given content
`PaletteRoot` `createPalette(IEditorPart editor, java.lang.Object content)` Creates default palette root.
`static PaletteService` `getInstance()` gets the singleton instance
`protected Service.ProviderDescriptor` `newProviderDescriptor(IConfigurationElement element)` Creates a new provider descriptor for the specified configuration `element`.
`void` `setContributions(IConfigurationElement configElement)` Sets contribution Empty because contributions are stored in the providers
`void` `updatePalette(PaletteRoot existingRoot, IEditorPart editor, java.lang.Object content)` Updates the palette root given.

Methods inherited from class org.eclipse.gmf.runtime.common.core.service.Service
`addProvider, clearCache, configureProviders, configureProviders, createPriorityCache, execute, executeUnique, getAllProviders, getCachingKey, getPriority, getProviders, isOptimistic, isOptimized, providerChanged, provides, provides, removeProvider`

Methods inherited from class org.eclipse.gmf.runtime.common.core.service.AbstractProvider
`addProviderChangeListener, fireProviderChange, removeProviderChangeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.eclipse.gmf.runtime.common.core.service.IProvider
`addProviderChangeListener, provides, removeProviderChangeListener`

Field Detail

### GROUP_STANDARD

    public static final java.lang.String GROUP_STANDARD

  the standard group id

  See Also:
    Constant Field Values

### SEPARATOR_STANDARD

    public static final java.lang.String SEPARATOR_STANDARD

  the standard separator id

  See Also:
    Constant Field Values

### TOOL_SELECTION

    public static final java.lang.String TOOL_SELECTION

  the standard separator id

  See Also:
    Constant Field Values

Constructor Detail

### PaletteService

    protected PaletteService()

  Creates a new instance of the Palette Service

Method Detail

### setContributions

    public void setContributions(IConfigurationElement configElement)

  Sets contribution Empty because contributions are stored in the providers

  Specified by:
    `setContributions` in interface `IPaletteProvider`
  Parameters:
    `configElement` -

### getInstance

    public static PaletteService getInstance()

  gets the singleton instance

  Returns:
    `PaletteService`

### newProviderDescriptor

    protected Service.ProviderDescriptor newProviderDescriptor(IConfigurationElement element)

  Description copied from class: `Service`
  Creates a new provider descriptor for the specified configuration `element`.

  Overrides:
    `newProviderDescriptor` in class `Service`
  Parameters:
    `element` - The configuration element from which to create the descriptor.
  Returns:
    A new provider descriptor.
  See Also:
    `Service.newProviderDescriptor(org.eclipse.core.runtime.IConfigurationElement)`

### contributeToPalette

    public void contributeToPalette(IEditorPart editor,
                                    java.lang.Object content,
                                    PaletteRoot root,
                                    java.util.Map predefinedEntries)

  Description copied from interface: `IPaletteProvider`
  Contributes to the palette of the given editor with the given content

  Specified by:
    `contributeToPalette` in interface `IPaletteProvider`
  Parameters:
    `editor` - The editor hosting the palette
    `content` - The editor's contents
    `root` - The editor's palette root
    `predefinedEntries` - map of predefined palette entries where the key is the palette entry id and the value is the palette entry
  See Also:
    `IPaletteProvider.contributeToPalette(org.eclipse.ui.IEditorPart, java.lang.Object, org.eclipse.gef.palette.PaletteRoot, Map)`

### createPalette

    public PaletteRoot createPalette(IEditorPart editor,
                                     java.lang.Object content)

  Creates default palette root.

  Parameters:
    `editor` - the editor
    `content` - the palette content
  Returns:
    a new palette root with contributions from all providers

### updatePalette

    public void updatePalette(PaletteRoot existingRoot,
                              IEditorPart editor,
                              java.lang.Object content)

  Updates the palette root given.

  Parameters:
    `existingRoot` - existing palette root in which to add/remove entries that are now provided for or no longer provided for
    `editor` - the editor
    `content` - the palette content

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.