elipse retarget="true"

<extension
         id="javaeditor"
         point="org.eclipse.ui.editors">
      <editor
            name="%JavaEditor.label"
            default="true"
            icon="$nl$/icons/full/obj16/jcu_obj.gif"
            contributorClass="org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
            class="org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor"
            symbolicFontName="org.eclipse.jdt.ui.editors.textfont"
            id="org.eclipse.jdt.ui.CompilationUnitEditor">
            <contentTypeBinding
               contentTypeId="org.eclipse.jdt.core.javaSource"
            />
      </editor>
...............................
...............................
</extension>

<action
               definitionId="org.eclipse.jdt.ui.edit.text.java.add.import"
               label="%AddImportAction.label"
               retarget="true"
               menubarPath="org.eclipse.jdt.ui.source.menu/importGroup"
               id="org.eclipse.jdt.ui.actions.AddImport">
 </action>

 看到 retarget="true" 可以知道org.eclipse.jdt.ui.actions.AddImport是一个“可重定目标的操作集操作”(Retargetable action set actions注意,可重定目标的操作不指定实现,因为要靠插件中的每个视图或编辑器设置实现每个操作的处理程序。这里对应的就是上面的org.eclipse.jdt.ui.CompilationUnitEditor.

阅读更多

没有更多推荐了,返回首页