Plug-in metedata tell eclipse runtime kernel how to create a expected object and set its perperties, 

and assign these objects to defined interfce object, make these interface objects 

communicate with each other.

org.eclipse.compare/plugin.xml

 <?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?> <plugin>
<!-- Compare extension point definitions -->
<extension-point id="streamMergers" name="%streamMergers" schema="schema/streamMergers.exsd"/>
<extension-point id="structureCreators" name="%structureCreators" schema="schema/structureCreators.exsd"/>
<extension-point id="structureMergeViewers" name="%structureMergeViewers" schema="schema/structureMergeViewers.exsd"/>
<extension-point id="contentMergeViewers" name="%contentMergeViewers" schema="schema/contentMergeViewers.exsd"/>
<extension-point id="contentViewers" name="%contentViewers" schema="schema/contentViewers.exsd"/>
<!-- Extensions -->
<extension
point="org.eclipse.ui.themes">
<themeElementCategory
label="%textCompareAppearance.label"
id="org.eclipse.compare.contentmergeviewer.TextMergeViewer">
</themeElementCategory>
<colorDefinition
label="%compareIncomingColor.label"
categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
value="COLOR_BLUE"
id="INCOMING_COLOR">
<description>
%compareIncomingColor.description
</description>
</colorDefinition>
<colorDefinition
label="%compareOutgoingColor.label"
categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
value="COLOR_BLACK"
id="OUTGOING_COLOR">
<description>
%compareOutgoingColor.description
</description>
</colorDefinition>
<colorDefinition
label="%compareConflictColor.label"
categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
value="COLOR_RED"
id="CONFLICTING_COLOR">
<description>
%compareConflictColor.description
</description>
</colorDefinition>
<colorDefinition
label="%compareResolvedColor.label"
categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
value="COLOR_GREEN"
id="RESOLVED_COLOR">
<description>
%compareResolvedColor.description
</description>
</colorDefinition>
<fontDefinition
label="%compareFontDefiniton.label"
defaultsTo="org.eclipse.jface.textfont"
categoryId="org.eclipse.compare.contentmergeviewer.TextMergeViewer"
id="org.eclipse.compare.contentmergeviewer.TextMergeViewer">
<description>
%compareFontDefiniton.description
</description>
</fontDefinition>
</extension>
<extension
id="rejectedPatchMarker"
name="%rejectedPatchMarker.name"
point="org.eclipse.core.resources.markers">
<super
type="org.eclipse.core.resources.taskmarker">
</super>
<persistent
value="true">
</persistent>
</extension>
<extension
point="org.eclipse.ui.editors">
<editor
name="%defaultCompareEditor.name"
icon="$nl$/icons/full/eview16/compare_view.gif"
contributorClass="org.eclipse.compare.internal.CompareEditorContributor"
class="org.eclipse.compare.internal.CompareEditor"
id="org.eclipse.compare.CompareEditor">
</editor>
</extension>
<extension
point="org.eclipse.ui.preferencePages">
<page
name="%ComparePreferencePage.name"
category="org.eclipse.ui.preferencePages.Workbench"
class="org.eclipse.compare.internal.ComparePreferencePage"
id="org.eclipse.compare.internal.ComparePreferencePage">
<keywordReference id="org.eclipse.compare.general"/>
</page>
</extension>
<extension
point="org.eclipse.ui.keywords">
<keyword
label="%preferenceKeywords.general"
id="org.eclipse.compare.general"/>
</extension>
<!-- commands and their bindings -->
<extension
point="org.eclipse.ui.contexts">
<context
name="%context.name"
description="%context.description"
parentId="org.eclipse.ui.contexts.window"
id="org.eclipse.compare.compareEditorScope">
</context>
</extension>
<extension
point="org.eclipse.ui.commands">
<category
name="%compareCategory.name"
description="%compareCategory.description"
id="org.eclipse.compare.ui.category.compare">
</category>
<command
name="%Command.copyRightToLeft.name"
description="%Command.copyRightToLeft.description"
categoryId="org.eclipse.compare.ui.category.compare"
id="org.eclipse.compare.copyRightToLeft">
</command>
<command
name="%Command.copyLeftToRight.name"
description="%Command.copyLeftToRight.description"
categoryId="org.eclipse.compare.ui.category.compare"
id="org.eclipse.compare.copyLeftToRight">
</command>
<command
name="%Command.copyAllRightToLeft.name"
description="%Command.copyAllRightToLeft.description"
categoryId="org.eclipse.compare.ui.category.compare"
id="org.eclipse.compare.copyAllRightToLeft">
</command>
<command
name="%Command.copyAllLeftToRight.name"
description="%Command.copyAllLeftToRight.description"
categoryId="org.eclipse.compare.ui.category.compare"
id="org.eclipse.compare.copyAllLeftToRight">
</command>
<command
name="%Command.selectNextChange.name"
description="%Command.selectNextChange.description"
categoryId="org.eclipse.compare.ui.category.compare"
id="org.eclipse.compare.selectNextChange">
</command>
<command
name="%Command.selectPreviousChange.name"
description="%Command.selectPreviousChange.description"
categoryId="org.eclipse.compare.ui.category.compare"
id="org.eclipse.compare.selectPreviousChange">
</command>
<command
categoryId="org.eclipse.compare.ui.category.compare"
description="%Command.ignoreWhiteSpace.description"
id="org.eclipse.compare.ignoreWhiteSpace"
name="%Command.ignoreWhiteSpace.name">
</command>
<command
categoryId="org.eclipse.compare.ui.category.compare"
defaultHandler="org.eclipse.compare.internal.CompareWithOtherResourceHandler"
description="%Command.compareWithOther.description"
id="org.eclipse.compare.compareWithOther"
name="%Command.compareWithOther.name">
</command>
</extension>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
objectClass="org.eclipse.core.resources.mapping.ResourceMapping"
adaptable="true"
id="org.eclipse.compare.MenuGroups">
<menu
label="%ReplaceWithMenu.label"
path="additions"
id="replaceWithMenu">
<separator
name="replaceWithGroup">
</separator>
</menu>
<menu
label="%CompareWithMenu.label"
path="additions"
id="compareWithMenu">
<separator
name="compareWithGroup">
</separator>
</menu>
</objectContribution>
<objectContribution
objectClass="org.eclipse.core.resources.IResource"
adaptable="true"
id="org.eclipse.compare.CompareAction">
<action
label="%CompareWithEachOtherAction.label"
tooltip="%CompareWithEachOtherAction.tooltip"
class="org.eclipse.compare.internal.CompareAction"
menubarPath="compareWithMenu/compareWithGroup"
enablesFor="2+"
id="compareWithEachOther">
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
adaptable="true"
id="org.eclipse.compare.ReplaceWithEditionAction">
<menu
label="%ReplaceWithMenu.label"
path="additions"
id="replaceWithMenu">
<separator
name="replaceWithGroup">
</separator>
</menu>
<action
class="org.eclipse.compare.internal.ReplaceWithEditionAction"
enablesFor="1"
helpContextId="org.eclipse.compare.replace_with_edition_action_context"
id="replaceFromHistory"
label="%ReplaceFromHistoryAction.label"
menubarPath="replaceWithMenu/replaceWithGroup"
tooltip="%ReplaceFromHistoryAction.tooltip">
</action>
<action
label="%ReplaceWithPreviousFromHistoryAction.label"
tooltip="%ReplaceWithPreviousFromHistoryAction.tooltip"
class="org.eclipse.compare.internal.ReplaceWithPreviousEditionAction"
menubarPath="replaceWithMenu/replaceWithGroup"
enablesFor="1"
id="replaceWithPreviousFromHistory">
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.core.resources.IFile"
adaptable="true"
id="org.eclipse.compare.CompareWithEditionAction">
<menu
label="%CompareWithMenu.label"
path="additions"
id="compareWithMenu">
<separator
name="compareWithGroup">
</separator>
</menu>
<action
label="%CompareWithHistoryAction.label"
tooltip="%CompareWithHistoryAction.tooltip"
class="org.eclipse.compare.internal.CompareWithEditionAction"
menubarPath="compareWithMenu/compareWithGroup"
enablesFor="1"
id="compareWithHistory">
</action>
</objectContribution>
<objectContribution
objectClass="org.eclipse.core.resources.IContainer"
adaptable="true"
id="org.eclipse.compare.AddFromHistoryAction">
<action
label="%addFromHistoryAction.label"
tooltip="%addFromHistoryAction.tooltip"
class="org.eclipse.compare.internal.AddFromHistoryAction"
menubarPath="replaceWithMenu"
enablesFor="1"
id="addFromHistoryAction">
</action>
</objectContribution>
</extension>
<extension
point="org.eclipse.compare.streamMergers">
<streamMerger
extensions="txt"
class="org.eclipse.compare.internal.merge.TextStreamMerger"
id="org.eclipse.compare.internal.merge.TextStreamMerger">
</streamMerger>
<contentTypeBinding
contentTypeId="org.eclipse.core.runtime.text"
streamMergerId="org.eclipse.compare.internal.merge.TextStreamMerger">
</contentTypeBinding>
</extension> <extension
point="org.eclipse.compare.structureCreators">
<structureCreator
extensions="zip"
class="org.eclipse.compare.ZipFileStructureCreator"
id="org.eclipse.compare.ZipFileStructureCreator">
</structureCreator>
</extension>
<extension
point="org.eclipse.compare.contentMergeViewers">
<viewer
class="org.eclipse.compare.internal.BinaryCompareViewerCreator"
extensions="class,exe,dll,binary,zip,jar"
id="org.eclipse.compare.BinaryCompareViewerCreator"
label="%BinaryCompare.label">
</viewer>
<viewer
class="org.eclipse.compare.internal.TextMergeViewerCreator"
extensions="txt"
id="org.eclipse.compare.TextMergeViewerCreator"
label="%TextCompare.label">
</viewer>
<viewer
class="org.eclipse.compare.internal.ImageMergeViewerCreator"
extensions="gif,jpg,jpeg,png,bmp,ico,tif,tiff"
id="org.eclipse.compare.ImageMergeViewerCreator"
label="%ImageCompare.label">
</viewer>
<contentTypeBinding
contentTypeId="org.eclipse.core.runtime.text"
contentMergeViewerId="org.eclipse.compare.TextMergeViewerCreator">
</contentTypeBinding>
</extension>
<extension
point="org.eclipse.compare.contentViewers">
<viewer
extensions="txt"
class="org.eclipse.compare.internal.TextViewerCreator"
id="org.eclipse.compare.TextViewerCreator">
</viewer>
<contentTypeBinding
contentTypeId="org.eclipse.core.runtime.text"
contentViewerId="org.eclipse.compare.TextViewerCreator">
</contentTypeBinding>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.eclipse.compare.internal.ComparePreferenceInitializer">
</initializer>
</extension>
<extension
point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.eclipse.compare.CompareEditorInput"
class="org.eclipse.compare.internal.AdapterFactory">
<adapter
type="org.eclipse.ui.IContributorResourceAdapter">
</adapter>
</factory>
</extension>
</plugin>
  • The description of extension-point which is contributed to other plug-ins.
  •  <extension-point id="streamMergers" name="%streamMergers" schema="schema/streamMergers.exsd"/>

    <extension-point> define a extension which can be as a extension point for other plug-in. Provide the features for other plug-ins.Now you can find detailed information of the StreamMergers provided by org.eclipse.compare plug-in as follows:

  •  public interface IStreamMerger {
    public static final int OK= IStatus.OK;
    public static final int CONFLICT= 1;
    public static final int INTERNAL_ERROR= 2;
    IStatus merge(OutputStream output, String outputEncoding,
    InputStream ancestor, String ancestorEncoding,
    InputStream target, String targetEncoding,
    InputStream other, String otherEncoding,
    IProgressMonitor monitor);
    }
  • Stream Merger
    Identifier: org.eclipse.compare.streamMergers
    Since: 3.0
    Description: This extension point allows a plug-in to register a stream merger for specific content types. The stream merger is expected to perform a three-way merge on three input streams and writes the result to an output stream. The extension point must implement the interface org.eclipse.compare.IStreamMerger.
    Configuration Markup:
    <!ELEMENT extension (streamMerger* , contentTypeBinding*)>
    <!ATTLIST extension
    point CDATA #REQUIRED
    id CDATA #IMPLIED
    name CDATA #IMPLIED
    >
    point - a fully qualified identifier of the target extension point
    id - an optional identifier of the extension instance
    name - an optional name of the extension instance <!ELEMENT streamMerger EMPTY>
    <!ATTLIST streamMerger
    id CDATA #REQUIRED
    class CDATA #REQUIRED
    extensions CDATA #IMPLIED
    >
    id - a unique identifier that can be used to reference the stream merger
    class - a fully qualified name of a class that implements org.eclipse.compare.IStreamMerger
    extensions - a comma separated list of file extensions e.g. "java, properties"
    <!ELEMENT contentTypeBinding EMPTY>
    <!ATTLIST contentTypeBinding
    contentTypeId IDREF #REQUIRED
    streamMergerId IDREF #REQUIRED
    >
    A contentTypeBinding binds a stream merger to a content type.
    contentTypeId - The id of a content type defined using the org.eclipse.core.contenttype.contentTypes extension point.
    streamMergerId - The id of a stream merger defined using the streamMerger element of this extension point (i.e. org.eclipse.compare.streamMergers) Examples: The following is an example of a stream merger for property files (extension "properties"):
    <extension point = "org.eclipse.compare.streamMergers">
    <streamMerger
    id="org.eclipse.compare.internal.merge.TextStreamMerger"
    class="org.eclipse.compare.internal.merge.TextStreamMerger"
    extensions="properties"
    />
    </extension>
    API Information: The contributed class must implement org.eclipse.compare.IStreamMerger
    Supplied Implementation: The Compare UI plugin defines a stream merger for line oriented text files.
  • The definition of <extension point>

  •  <extension  point="org.eclipse.ui.themes">

    <extension point=""> indicates that this plug-in want to extend from that point, add additional features or want that point service for this plug-in.Now we have a look at extenion-point of org.eclipse.ui.themes.

  • Take a look at interface ITheme.when we need a Theme object, elipse kernel can load plug-ins which define all properties of Theme through plug-in.xml of this exclipse plug-in.
  •  package org.eclipse.ui.themes;
    import java.util.Set;
    import org.eclipse.jface.resource.ColorRegistry;
    import org.eclipse.jface.resource.FontRegistry;
    import org.eclipse.jface.util.IPropertyChangeListener;
    public interface ITheme {
    void addPropertyChangeListener(IPropertyChangeListener listener);
    void dispose();
    boolean getBoolean(String key);
    ColorRegistry getColorRegistry();
    FontRegistry getFontRegistry();
    String getId();
    public int getInt(String key);
    String getLabel();
    String getString(String key);
    Set keySet();
    void removePropertyChangeListener(IPropertyChangeListener listener);
    }

Configuration Markup:

<!ELEMENT extension (theme* , colorDefinition* , fontDefinition* , themeElementCategory* , data* , categoryPresentationBinding*)>

<!ATTLIST extension point CDATA #REQUIRED id CDATA #IMPLIED name CDATA #IMPLIED >

  • point - a fully qualified identifier of the target extension point
  • id - an optional identifier of the extension instance
  • name - an optional name of the extension instance

<!ELEMENT theme (colorOverride* , fontOverride* , description? , data*)>

<!ATTLIST theme id CDATA #REQUIRED name CDATA #IMPLIED >

A collection of font, color and data overrides. Such a collection may be used to alter the appearance of the workbench. Many theme elements may exist with the same id. This allows component authors to contribute to existing themes.

  • id - a unique name that will be used to identify this theme
  • name - a translatable name of the theme to be presented to the user.

At least one theme definition with any given id should contain this attribute.

<!ELEMENT themeElementCategory (description?)>

<!ATTLIST themeElementCategory id CDATA #REQUIRED parentId IDREF #IMPLIED class CDATA #IMPLIED label CDATA #IMPLIED >

A logical grouping of theme element definitions. This category may include colors and fonts.

  • id - the id for this category
  • parentId - the id of the parent category, if any.
  • class - a class that implements org.eclipse.ui.themes.IThemePreview
  • label - a translatable name of the theme element category to be presented to the user

<!ELEMENT colorDefinition (colorFactory? , colorValue* , description?)>

<!ATTLIST colorDefinition id CDATA #REQUIRED label CDATA #REQUIRED defaultsTo CDATA #IMPLIED value CDATA #IMPLIED categoryId IDREF #IMPLIED colorFactory CDATA #IMPLIED isEditable (true | false) >

A symbolic color definition.

  • id - a unique id that can be used to identify this color definition.
  • label - a translatable name of the color to be presented to the user.
  • defaultsTo - the id of another color definition that is the default setting for the receiver. When there is no preference for this color the color registry will have the value of defaultsTo set for it in the registry. Only one of defaultsTo, value or colorFactory may be defined.
  • value - The default value of this color. The value may be specified in the following ways:
    • a String containing comma separated integers in the form red,green,blue
    • a String that maps to an SWT color constant (ie: COLOR_RED).
    • Only one of defaultsTo, value or colorFactory may be defined. If value is specified, additional value definitions may be specified on a per platform/windowing system basis via the colorValue element.
  • categoryId - the optional id of the themeElementCategory this color belongs to.
  • colorFactory - a class that implements org.eclipse.ui.themes.IColorFactory. This may be used instead of value to specify the default value of the color. Please be advised that this should be used with caution - usage of this attribute will cause plugin activation on workbench startup.
  • isEditable - whether the user should be allowed to edit this color in the preference page. If this is false then the contribution is not shown to the user.
  • <!ELEMENT fontDefinition (fontValue* , description?)> <!ATTLIST fontDefinition id CDATA #REQUIRED label CDATA #REQUIRED value CDATA #IMPLIED categoryId IDREF #IMPLIED defaultsTo CDATA #IMPLIED isEditable (true | false) > A symbolic font definition.
  • id - a unique name that can be used to identify this font definition. label - a translatable name of the font to be presented to the user.
  • value - the font value. This is in the form: fontname-style-height where fontname is the name of a font, style is a font style (one of "regular", "bold", "italic", or "bold italic") and height is an integer representing the font height.

Eclipse org.eclipse.compare plug-in的更多相关文章

  1. Eclipse及Eclipse为基础的App报错“Failed to create the Java Virtual Machine”的解决办法

    由于OracleJDK马上就要收费了,公司要求更换OpenJDK,结果安装后Eclipse及Eclipse为基础的App启动报错:“Failed to create the Java Virtual ...

  2. 【eclipse】Eclipse安装插件支持jQ…

    [eclipse]Eclipse安装插件支持jQuery智能提示 最近工作中用到jQuery插件,需要安装eclipse插件才能支持jQuery智能提示,在网上搜索了一下,常用的有三个插件支持jQue ...

  3. eclipse 去掉Eclipse打开后定期弹出Usage Data Upload对话框

    Eclipse 的 UDC 老定期蹦出来说要上传使用数据到 eclipse 官网服务器去除方法: 1.删除 eclipse/plugins 目录下以 org.eclipse.epp.usagedata ...

  4. Scala Eclipse org.eclipse.e4.workbench异常奔溃修复

     Scala Eclipse org.eclipse.e4.workbench异常奔溃修复: 找到<workspace>/.metadata/.plugins/org.eclipse.e4 ...

  5. 【玩转Eclipse】——eclipse实现代码块折叠-类似于VS中的#region……#endregion

    [玩转Eclipse]——eclipse实现代码块折叠-类似于VS中的#region……#endregion http://www.cnblogs.com/Micheal-G/articles/507 ...

  6. eclipse安装Eclipse Memory Analyzer插件

    在Install New software中输入 http://archive.eclipse.org/mat/1.2/update-site/ 然后选择Memory Analyzer for Ecl ...

  7. 【Eclipse】 Eclipse 中JPEGEncodeParam 错误波浪线问题

    [异常信息] Description Resource Path Location Type Access restriction: The method encode(BufferedImage, ...

  8. 【Eclipse】eclipse che 协作开发

    http://www.eclipse.org/che/ http://blog.csdn.net/ccfeng2008/article/details/50881024 http://www.osch ...

  9. eclipse dbviewer,eclipse java8

    进入/home/xxx(用户名)/.local/share/applications,看是否有eclipse和深度音乐desktop配置文件,为eclipse.desktop配置图标, 那现在终端输入 ...

随机推荐

  1. 最大子树和 树形dp

    题目描述 小明对数学饱有兴趣,并且是个勤奋好学的学生,总是在课后留在教室向老师请教一些问题.一天他早晨骑车去上课,路上见到一个老伯正在修剪花花草草,顿时想到了一个有关修剪花卉的问题.于是当日课后,小明 ...

  2. 4、numpy+pandas速查手册

    <Python数据分析常用手册>一.NumPy和Pandas篇 一.常用链接: 1.Python官网:https://www.python.org/2.各种库的whl离线安装包:http: ...

  3. MarkDown语法实操

    一级标题 这是引用 二级标题 https://daringfireball.net/projects/markdown/dingus 你好啊,这是斜体 引用 添加图片 图片alt就是显示在图片下面的文 ...

  4. Android 使用URL访问网络资源

    1.介绍 2.使用方法 3.java后台代码 package com.lucky.test51url; import android.annotation.SuppressLint; import a ...

  5. php 页面压缩---

    网站优化中,页面压缩是很有效的一种方法,可以明显提升页面访问速度. 页面压缩也有很多的方法,有PHP自带的zlib的gzip压缩,还有清除html页面中不必要的字符,空格,注释,换行符等. 第一种打开 ...

  6. liunx 请求服务器连接数相关设置

    一. 文件数限制修改 1.用户级别 修改 nr_open 限制 (用途:能够配置nofile最大数) cat /proc/sys/fs/nr_open Linux 内核 2.6.25 以前,在内核里面 ...

  7. C++_异常5-异常规范和栈解退

    异常规范 异常规范的理念看似有前途,但实际的使用效果并不好. 忽视异常规范之前,您至少应该知道它是什么样的,如下所示: double harm(double a) throw(bad_thing);  ...

  8. rest-assured的对象映射(序列化和反序列化)

    rest-assured支持映射Java对象到Json和XML以及从Json和XML中映射到Java对象.Json映射需要在classpath 中有Jackson.Jackson 2或者是Gson,X ...

  9. 最近闲着利用QQ协议写了一个聊天器

    最近闲着,把以前一个利用QQ协议写了的聊天器找出来玩,采用的是QQ比较稳定的协议,之前听说有人用WEB协议,或是安卓版QQ协议,都不太稳定.而我这个版的已经有好几年没动了.今天找出来依旧能登陆.获取好 ...

  10. hibernateUtil类

    package com.test.Util; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfi ...