<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.hyades.trace.views">
<annotation>
      <appInfo>
         <meta.schema plugin="org.eclipse.hyades.trace.views" id="columnExtension" name="column.extension"/>
      </appInfo>
      <documentation>
         This extension point allows an extender to add its self-computed columns to the Coverage Statistic View
      </documentation>
   </annotation>

   <element name="extension">
      <complexType>
         <sequence>
            <element ref="columnExtension" minOccurs="1" maxOccurs="unbounded"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  a fully qualified identifier of the target extension point
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  an optional identifier of the extension instance
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  an optional name of the extension instance
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="columnExtension">
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  specifies an identifier for this column
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  specifies a title for this column
               </documentation>
            </annotation>
         </attribute>
         <attribute name="pos" type="string" use="required">
            <annotation>
               <documentation>
                  specifies a position for this column (0 is the position of the first column added by this extension, the following ones must be numbered 1, 2 and so on)
               </documentation>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  the fully qualified name of the class implementing org.eclipse.hyades.trace.views.columnExtension
               </documentation>
               <appInfo>
                  <meta.attribute kind="java" basedOn="org.eclipse.hyades.trace.views.util.internal.IColumnExtention"/>
               </appInfo>
            </annotation>
         </attribute>
         <attribute name="style" type="string" use="required">
            <annotation>
               <documentation>
                  a combination of:&lt;br&gt;
- public final static int IS_VISIBLE 		= 0x00000001;&lt;br&gt;
- public final static int NONDELETABLE		= 0x00000002;&lt;br&gt;
- public final static int NONMOVABLE		= 0x00000004;&lt;br&gt;
- public final static int NONRESIZABLE		= 0x00000008;&lt;br&gt;
- public final static int SUPPORTS_DELTA 	= 0x00000010;&lt;br&gt;
These styles are defined in org.eclipse.hyades.trace.views.util.internal.ColumnData
               </documentation>
            </annotation>
         </attribute>
         <attribute name="width" type="string" use="required">
            <annotation>
               <documentation>
                  default size
               </documentation>
            </annotation>
         </attribute>
         <attribute name="align" type="string" use="required">
            <annotation>
               <documentation>
                  left, right or center alignment of the cells contents
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appInfo>
         <meta.section type="since"/>
      </appInfo>
      <documentation>
         1.1.0
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="examples"/>
      </appInfo>
      <documentation>
         Look at the contents of:&lt;br&gt;
      - a &lt;a href=&quot;#plugin.xml&quot;&gt;plugin.xml&lt;/a&gt; file from an extender plugin&lt;br&gt;
      - the &lt;a href=&quot;#ExtenderPlugin&quot;&gt;ExtenderPlugin&lt;/a&gt; class&lt;br&gt;
      - the &lt;a href=&quot;#ExtenderPlugin&quot;&gt;TableLabelProviderVendor&lt;/a&gt; class&lt;br&gt;
&lt;p&gt;

&lt;a name=&quot;plugin.xml&quot;&gt;      Here are the contents of a plugin.xml file from an extender plugin:&lt;/a&gt;
&lt;pre&gt;
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;plugin
   id=&quot;com.somebody.test.extender&quot;
   name=&quot;Extender Plug-in&quot;
   version=&quot;1.0.0&quot;
   provider-name=&quot;IBM&quot;
   class=&quot;com.somebody.test.extender.ExtenderPlugin&quot;&gt;

   &lt;runtime&gt;
      &lt;library name=&quot;extender.jar&quot;/&gt;
   &lt;/runtime&gt;
   &lt;requires&gt;
      &lt;import plugin=&quot;org.eclipse.core.resources&quot;/&gt;
      &lt;import plugin=&quot;org.eclipse.ui&quot;/&gt;
      &lt;import plugin=&quot;org.eclipse.hyades.trace.views&quot;/&gt;
      &lt;import plugin=&quot;org.eclipse.hyades.models.trace&quot;/&gt;
      &lt;import plugin=&quot;org.eclipse.hyades.trace.ui&quot;/&gt;
   &lt;/requires&gt;


   &lt;extension
         point=&quot;org.eclipse.hyades.trace.views.columnExtension&quot;&gt;
      &lt;columnExtension
            name=&quot;lines missed&quot;
            width=&quot;90&quot;
            style=&quot;1&quot;
            class=&quot;com.somebody.test.extender.TableLabelProviderVendor&quot;
            pos=&quot;0&quot;
            id=&quot;com.somebody.test.extender.TableLabelProviderVendor&quot;
            align=&quot;right&quot;&gt;
      &lt;/columnExtension&gt;
      &lt;columnExtension
            name=&quot;lines hit&quot;
            width=&quot;90&quot;
            style=&quot;1&quot;
            class=&quot;com.somebody.test.extender.TableLabelProviderVendor&quot;
            pos=&quot;1&quot;
            id=&quot;com.somebody.test.extender.TableLabelProviderVendor&quot;
            align=&quot;rigth&quot;&gt;
      &lt;/columnExtension&gt;
      &lt;columnExtension
            name=&quot; &amp;quot;%&amp;quot; lines hit&quot;
            width=&quot;90&quot;
            style=&quot;1&quot;
            class=&quot;com.somebody.test.extender.TableLabelProviderVendor&quot;
            pos=&quot;2&quot;
            id=&quot;com.somebody.test.extender.TableLabelProviderVendor&quot;
            align=&quot;right&quot;&gt;
      &lt;/columnExtension&gt;
   &lt;/extension&gt;

&lt;/plugin&gt;

&lt;/pre&gt;


&lt;a name=&quot;ExtenderPlugin&quot;&gt;      Here is the code of the ExtenderPlugin class:&lt;/a&gt;
&lt;pre&gt;
package com.somebody.test.extender;

import org.eclipse.ui.plugin.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.resources.*;
import java.util.*;

/**
 * The main plugin class to be used in the desktop.
 */
public class ExtenderPlugin extends AbstractUIPlugin {
 //The shared instance.
 private static ExtenderPlugin plugin;
 //Resource bundle.
 private ResourceBundle resourceBundle;
 
 /**
  * The constructor.
  */
 public ExtenderPlugin(IPluginDescriptor descriptor) {
  super(descriptor);
  plugin = this;
  try {
   resourceBundle= ResourceBundle.getBundle(&quot;com.somebody.test.extender.ExtenderPluginResources&quot;);
  } catch (MissingResourceException x) {
   resourceBundle = null;
  }
 }

 /**
  * Returns the shared instance.
  */
 public static ExtenderPlugin getDefault() {
  return plugin;
 }

 /**
  * Returns the workspace instance.
  */
 public static IWorkspace getWorkspace() {
  return ResourcesPlugin.getWorkspace();
 }

 /**
  * Returns the string from the plugin&apos;s resource bundle,
  * or &apos;key&apos; if not found.
  */
 public static String getResourceString(String key) {
  ResourceBundle bundle= ExtenderPlugin.getDefault().getResourceBundle();
  try {
   return bundle.getString(key);
  } catch (MissingResourceException e) {
   return key;
  }
 }

 /**
  * Returns the plugin&apos;s resource bundle,
  */
 public ResourceBundle getResourceBundle() {
  return resourceBundle;
 }
}
&lt;/pre&gt;

&lt;a name=&quot;TableLabelProviderVendor&quot;&gt;    Here is the code of the TableLabelProviderVendor class:&lt;/a&gt;
&lt;pre&gt;
package com.somebody.test.extender;

import org.eclipse.jface.viewers.ILabelProviderListener;
import java.lang.Object;
import java.lang.String;
import org.eclipse.swt.graphics.Image;
//import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.core.runtime.*;

import org.eclipse.hyades.trace.views.util.internal.*;
import org.eclipse.hyades.models.trace.*;
import org.eclipse.hyades.trace.ui.internal.util.TString;

/**
 * TODO: Provide description for &quot;TableLabelProviderVendor&quot;.
 * @see ITableLabelProvider
 */
public class TableLabelProviderVendor implements IColumnExtension{
 /**
  * TODO: Implement the &quot;TableLabelProviderVendor&quot; constructor.
  */
 public TableLabelProviderVendor() {
 }

 /**
  * TODO: Implement &quot;addListener&quot;.
  * @see ITableLabelProvider#addListener
  */
 public void addListener(ILabelProviderListener listener)  {
 }

 /**
  * TODO: Implement &quot;dispose&quot;.
  * @see ITableLabelProvider#dispose
  */
 public void dispose()  {
 }

 /**
  * TODO: Implement &quot;isLabelProperty&quot;.
  * @see ITableLabelProvider#isLabelProperty
  */
 public boolean isLabelProperty(Object element, String property)  {
  return false;
 }

 /**
  * TODO: Implement &quot;removeListener&quot;.
  * @see ITableLabelProvider#removeListener
  */
 public void removeListener(ILabelProviderListener listener)  {
 }

 /**
  * TODO: Implement &quot;getColumnImage&quot;.
  * @see ITableLabelProvider#getColumnImage
  */
 public Image getColumnImage(Object element, int columnIndex)  {
  return null;
 }

 /**
  * TODO: Implement &quot;getColumnText&quot;.
  * @see ITableLabelProvider#getColumnText
  */
 public String getColumnText(Object element, int columnIndex)  {
  
  Coverage cov= (Coverage)element; 
     
  switch (columnIndex) {
   
      
      case 0 : //lines missed
        if ((cov.getTraceObj() instanceof TRCPackage)||(cov.getTraceObj() instanceof TRCClass)||(cov.getTraceObj() instanceof TRCProcess))
         return String.valueOf(cov.getMethodsMissed());
        else if(cov.getTraceObj() instanceof TRCMethod)
        {
         if (cov.getMethodsMissed()==1)
        return &quot;all lines missed&quot;; 
                  
         else return &quot;&quot;;
        }
         
      case 1 : //lines hits
      if ((cov.getTraceObj() instanceof TRCPackage)||(cov.getTraceObj() instanceof TRCClass)||(cov.getTraceObj() instanceof TRCProcess))
         return String.valueOf(cov.getMethodsHit());
      else if(cov.getTraceObj() instanceof TRCMethod)
       {
         if (cov.getMethodsHit()==1)
         return &quot;all lines hit&quot;;
               
         else return &quot;&quot;;
        }
   case 2 : //%lines hit
      if ((cov.getTraceObj() instanceof TRCPackage)||(cov.getTraceObj() instanceof TRCClass)||(cov.getTraceObj() instanceof TRCProcess))
        return TString.formatAsPercentage(cov.getCovPercentage());
      else return &quot;&quot;;
  }
 return &quot;&quot;; 
 }
 
 public void setInitializationData(IConfigurationElement config,String classPropertyName,Object data)throws CoreException
 {
 }
 
 
 public int compare(int pos,Object e1, Object e2) {
 
    Coverage cov1 = (Coverage)e1;
    Coverage cov2 = (Coverage)e2;
   
    String name1 =null;
    String name2 =null;
 
    switch(pos)
    {
     case 0: //Methods missed
     return (int)(cov1.getMethodsMissed() - cov2.getMethodsMissed());
        
  case 1://Methods hit
     return (int) (cov1.getMethodsHit() - cov2.getMethodsHit());
         
  case 2: //% methods hit
     return (int)((cov1.getCovPercentage() - cov2.getCovPercentage())*10000);
    }
    return 0;
 }
}
&lt;/pre&gt;
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="apiInfo"/>
      </appInfo>
      <documentation>
         Implement the org.eclipse.hyades.trace.views.columnExtension interface
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="implementation"/>
      </appInfo>
      <documentation>
         
      </documentation>
   </annotation>

   <annotation>
      <appInfo>
         <meta.section type="copyright"/>
      </appInfo>
      <documentation>
         Copyright (c) 2003 Hyades project.
All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/cpl-v10.html&quot;&gt;http://www.eclipse.org/legal/cpl-v10.html&lt;/a&gt;
      </documentation>
   </annotation>

</schema>
