eclipse怎么设置透视图图标每次打开都固定在工具栏右上角?
时间: 2023-11-28 15:05:07 浏览: 35
要想设置透视图图标每次打开都固定在工具栏右上角,可以按照以下步骤进行操作:
1. 打开Eclipse软件,点击菜单栏的“Window”选项,选择“Perspective”->“Customize Perspective”。
2. 在弹出的对话框中,点击“Tool Bar Visibility”选项卡。
3. 在“Tool Bar Visibility”选项卡中,找到你要固定的透视图图标所在的工具栏,勾选其前面的复选框。
4. 点击“OK”按钮保存设置,关闭对话框。
现在,每次打开Eclipse软件时,你要固定的透视图图标就会出现在工具栏右上角。
相关问题
在eclipse中,如何通过除org.eclipse.ui.menu以外的扩展实现在工具栏添加combo组件?
你可以通过以下步骤在 Eclipse 工具栏中添加 Combo 组件:
1. 创建一个新的工具栏扩展。在插件的 `plugin.xml` 文件中,选择 "Extensions" 选项卡,然后右键单击 "org.eclipse.ui.menus" 扩展点,选择 "New > menuContribution"。
2. 在 "menuContribution" 对话框中,选择 "toolbar" 作为位置。在 "toolbar" 选项卡上,单击 "Add" 按钮并选择 "combo" 作为类型。
3. 配置 Combo 组件。在 "combo" 选项卡上,输入 Combo 的 ID 和 Label,然后选择所需的图标。
4. 添加 Combo 相关的 Command。在 "combo" 选项卡上,单击 "Add" 按钮并选择 "command" 作为类型。选择所需的 Command ID。
5. 配置 Combo 的下拉菜单。在 "combo" 选项卡上,单击 "Add" 按钮并选择 "menu" 作为类型。选择所需的 Menu ID。
6. 配置 Combo 的下拉菜单项。在 "menu" 选项卡上,单击 "Add" 按钮并选择 "command" 作为类型。选择所需的 Command ID。
7. 最后,保存插件的 `plugin.xml` 文件并重新启动 Eclipse。
这样就可以在 Eclipse 工具栏上添加 Combo 组件了。
在eclipse中,怎么通过代码或者plugin.xml设置所有的透视图都有某个指定的NewWizardShortcut
可以通过在插件的`plugin.xml`文件中定义`org.eclipse.ui.perspectiveExtensions`扩展点来设置透视图的NewWizardShortcut。
以下是一个示例扩展点定义:
```xml
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<newWizardShortcut
id="com.example.myplugin.myNewWizard">
</newWizardShortcut>
</perspectiveExtension>
</extension>
```
在上面的示例中,`targetID`属性指定了要添加NewWizardShortcut的透视图的ID,而`id`属性指定了要添加的NewWizardShortcut的ID。在这个示例中,我们添加了一个ID为`com.example.myplugin.myNewWizard`的NewWizardShortcut到`org.eclipse.jdt.ui.JavaPerspective`透视图中。
注意,如果你想为多个透视图添加相同的NewWizardShortcut,你需要为每个透视图定义一个`perspectiveExtension`元素。