`
JasonRight
  • 浏览: 72926 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

link with editor

    博客分类:
  • Java
阅读更多

为eidtor在ProjectExplorer中支持'Link with editor' 功能,需要在plug.xml中扩展 'org.eclipse.ui.navigator.linkHelper' 和 'org.eclipse.ui.navigator.viewer'

 

  <extension
         point="org.eclipse.ui.navigator.linkHelper">
      <linkHelper
            class="org.myym.MyLinkHelper"
            id="org.myym.mylinkhelper">
         <editorInputEnablement></editorInputEnablement>
         <selectionEnablement>
            <instanceof
                  value="org.eclipse.core.resources.IFile">
            </instanceof>
         </selectionEnablement>
      </linkHelper>
   </extension>
   <extension
         point="org.eclipse.ui.navigator.viewer">
      <viewerContentBinding
            viewerId="org.eclipse.ui.navigator.ProjectExplorer">
         <includes>
            <contentExtension
                  pattern="org.myym.mylinkhelper">
            </contentExtension>
         </includes>
      </viewerContentBinding>
   </extension>

 

MyLinkHelper.java

/**
 * Link Helper for editors.
 */
public class MyLinkHelper implements ILinkHelper {

    /**
     * Default Constructor. 
     */
    public MyLinkHelper() {
    }

	public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
    }

    public IStructuredSelection findSelection(IEditorInput anInput) {
        if (anInput instanceof MyClass) //check the IEditorInput whether are interested 
	    IFile file = getFile(MyClass); //create method 'getFile' to get the IFile refer to this input
            if (file != null) {
                return new StructuredSelection(file);
            }
        }
        return StructuredSelection.EMPTY;
    }
}
 
分享到:
评论

相关推荐

    Common Navigator Framework

    Link with Editor Support 提供了一种机制来确保 Navigator 中选中的元素与当前打开的编辑器之间保持同步。 ##### 8.2 扩展点 Link with Editor Support 的扩展点允许开发者定制编辑器与 Navigator 之间的联动行为...

    Eclipse 常用设置

    启用“Link with Editor”功能,当在编辑器中打开一个类时,Eclipse会在包浏览器中自动定位到该类的位置。在`Windows -&gt; Preferences -&gt; General -&gt; Editors`中可以找到这个选项。 为了减少性能影响,可以禁用不必...

    A text editor mixed with an HTML editor.

    标题 "A text editor mixed with an HTML editor" 描述了一个创新的编辑器软件,它结合了文本编辑和HTML编辑的功能。这种工具对Web开发者和内容创作者来说尤其有用,因为它允许他们在同一环境中同时处理纯文本和HTML...

    eclipse PropertiesEditor 资源文件插件

    安装PropertiesEditor插件后,只需在Eclipse的"Package Explorer"或"Project Explorer"视图中右键点击`.properties`文件,选择"Open With" -&gt; "Properties Editor"即可打开该插件的界面。在该界面中,用户可以享受到...

    An HTML editor with complete VB source code.

    标题 "An HTML editor with complete VB source code" 提供了一个关键信息,即这是一个基于Visual Basic (VB) 开发的HTML编辑器。这意味着它可能是一个用于创建和编辑HTML文档的图形用户界面工具,用户可以通过该...

    link v8 frimware

    jlink-v8-frimware - Changed ID in location 0xFF00 with hex editor - Changed GDBFull - Changed expire date

    Eclipse属性编辑器(PropertiesEditor)及安装说明.rar

    4. 使用:一旦安装完成,你可以在Eclipse的工作区中右键点击一个.properties文件,选择"Open With" -&gt; "PropertiesEditor"来打开属性编辑器。编辑器通常提供了一个友好的界面,包括分栏视图、键值对的列表以及实时...

    Total Commander, Version 8.51a

    Compare files (now with editor) / synchronize directories Quick View panel with bitmap display ZIP, ARJ, LZH, RAR, UC2, TAR, GZ, CAB, ACE archive handling + plugins Built-in FTP client with FXP ...

    Totoal Commander 官方版本9.12

    Compare files (now with editor) / synchronize directories Quick View panel with bitmap display ZIP, 7ZIP, ARJ, LZH, RAR, UC2, TAR, GZ, CAB, ACE archive handling + plugins Built-in FTP client with FXP ...

    h5-editor:一个 h5 页面 ui 编辑器

    H5 Editor移动端页面 UI 生成器用于将设计稿样式转化为组件化的代码有时间会持续更新维护的 :grinning_face_with_smiling_eyes:使用者设计师:通过拖拽编辑,生成UI稿前端开发:划分模块、组件、重命名 class ----&...

    OpenCV for Unity 2.3.2

    - Since this package is a clone of OpenCV Java, you are able to use the same API as OpenCV Java 3.4.2 (link). - You can image processing in real-time by using the WebCamTexture capabilities of Unity...

    jce for joomla

    •Take control of your code with syntax highlighting in the Advanced Code editor and advanced style and element attribute editing •Integrated Spellchecking using Google™ Spellchecker (or PSpell and ...

    [App] 网络应用开发 学习手册 (英文版)

    - Set up a basic workflow with a text editor, version control system, and web browser - Structure a user interface with HTML, and include styles with CSS - Use JQuery and JavaScript to add ...

    SEGGER Embedded Studio 6.40 (SES)安装文件FREE IDE FOR ARM

    Version 6.40 Build Updated segger-cc compiler to version 14.2.1 Updated segger-cc-ng compiler to version 14.92.0 Fixed Source Navigator/Analyze command lines for libcxx projects. ...Editor

    SEGGER Embedded Studio 6.34 (SES)安装文件FREE IDE FOR ARM

    Version 6.34 Build Updated segger-cc compiler to version 14.2.1 Updated segger-cc-ng compiler to version 14.92.0 Fixed Source Navigator/Analyze command lines for libcxx projects. ...Editor

    OpenCV for Unity 2.3.4

    - Since this package is a clone of OpenCV Java, you are able to use the same API as OpenCV Java 4.0.0 (link). - You can image processing in real-time by using the WebCamTexture capabilities of Unity....

    编辑任意PDF文件

    12. Fixed a problem with cursor display in the Image Editor window. 13. Optimized the feature for image editing. 14. Automated recall of previous windows size settings. 15. Other minor bug fixes to ...

    Shader Sandwich

    - Check out real-time 2D previews in the editor with no re-compile time, and another 3D previewer to get a more accurate look at your shader. Shader Sandwich comes with: - The editor itself (Source ...

    Unity Skele: Character Animation Tools 1.96p2 - 角色动作调整插件

    4. Integrated with Timeline Editor [BETA]. Edit the cutscene right inplace, and easily integrate with code/fx/audio/gui/etc. 5. Visualize the bone link, the vertices, and bone weights, etc. 6. Reduce ...

    Easy Movie Texture

    iOS( with tvOS) source path: Plugins/iOS folder This Demo Supported platforms: Android, iOS, AppleTV(tvOS) Supported platforms(Beta Version): PC (windows, Mac 64bit) EasyMovieTexture Editor ...

Global site tag (gtag.js) - Google Analytics