使用 Sticky View
这种 view 在多个 perspective 中保持相同的打开位置,与 editor 类似,其在同于 workbench window 中的多个不同 perspective 中是共享同一个实例的,perspective 切换时不会影响其显示。
org.eclipsercp.hyperbola/plugin.xml
<extension point="org.eclipse.ui.views">
<view
class="org.eclipsercp.hyperbola.ContactsView"
icon="icons/groups.gif"
id="org.eclipsercp.hyperbola.views.contacts"
name="Contacts"/>
<stickyView
closeable="false"
id="org.eclipsercp.hyperbola.ContactsView"
location="LEFT"
moveable="false"/>
</extension>
stickyView 只是创建了一个 placeholder,并不是创建实际的 view,它通过 id 来关联一个已存在的 view id。当此 view 打开时,其就变成 sticky view。
这种 view 在多个 perspective 中保持相同的打开位置,与 editor 类似,其在同于 workbench window 中的多个不同 perspective 中是共享同一个实例的,perspective 切换时不会影响其显示。
org.eclipsercp.hyperbola/plugin.xml
<extension point="org.eclipse.ui.views">
<view
class="org.eclipsercp.hyperbola.ContactsView"
icon="icons/groups.gif"
id="org.eclipsercp.hyperbola.views.contacts"
name="Contacts"/>
<stickyView
closeable="false"
id="org.eclipsercp.hyperbola.ContactsView"
location="LEFT"
moveable="false"/>
</extension>
stickyView 只是创建了一个 placeholder,并不是创建实际的 view,它通过 id 来关联一个已存在的 view id。当此 view 打开时,其就变成 sticky view。