예제 #1
0
void RegistryReader::LogError(IConfigurationElement::Pointer element,
    const std::string& text)
{
  const IExtension* extension = element->GetDeclaringExtension();
  std::string buf = "Plugin " + extension->GetNamespace() + ", extension "
      + extension->GetExtensionPointIdentifier();
  // look for an ID if available - this should help debugging
  std::string id;
  if (element->GetAttribute("id", id))
  {
    buf.append(", id ");
    buf.append(id);
  }
  buf.append(": " + text);
  WorkbenchPlugin::Log(buf);
}
bool PerspectiveExtensionReader::ProcessExtension(
    IConfigurationElement::Pointer element)
{
  IConfigurationElement::vector children = element->GetChildren();
  for (unsigned int nX = 0; nX < children.size(); nX++)
  {
    IConfigurationElement::Pointer child = children[nX];
    std::string type = child->GetName();
    if (this->IncludeTag(type))
    {
      bool result = false;
      if (type == WorkbenchRegistryConstants::TAG_ACTION_SET)
      {
        result = this->ProcessActionSet(child);
      }
      else if (type == WorkbenchRegistryConstants::TAG_VIEW)
      {
        result = this->ProcessView(child);
      }
      else if (type == WorkbenchRegistryConstants::TAG_VIEW_SHORTCUT)
      {
        result = this->ProcessViewShortcut(child);
      }
//      else if (type == IorkbenchRegistryConstants::TAG_NEW_WIZARD_SHORTCUT)
//      {
//        result = processWizardShortcut(child);
//      }
      else if (type == WorkbenchRegistryConstants::TAG_PERSP_SHORTCUT)
      {
        result = this->ProcessPerspectiveShortcut(child);
      }
      else if (type == WorkbenchRegistryConstants::TAG_SHOW_IN_PART)
      {
        result = this->ProcessShowInPart(child);
      }
      if (!result)
      {
        WorkbenchPlugin::Log("Unable to process element: " + //$NON-NLS-1$
            type + " in perspective extension: " + //$NON-NLS-1$
            element->GetDeclaringExtension()->GetUniqueIdentifier());
      }
    }
  }
  return true;
}