我大致遵循了这篇博客文章中的食谱 http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html
看起来像这样 - 图像显示为最小化/最大化图标

问题是,如果我没有为动作分配图像,那么该项目不会出现在标题中,而是出现在单独的工具栏中!

为什么?
我在eclipse工作台中创建了一个透视图,而不是在eclipse rcp中.是否可以隐藏其他透视图,如java,debug?我只想在我的应用程序中显示我的视角.这应该是默认的.或者我不需要显示任何视角,但我创建的视角应该是默认视角.我该怎么办?
我创建了一个eclipse应用程序和一个产品配置.
在"启动"选项卡上的产品配置中,可以指定"程序参数"和"VM参数".
是否可以从Application类访问这些参数?目前这个类看起来像这样:
public class Application implements IApplication {
@Override
public Object start(IApplicationContext context) throws Exception {
Map<?, ?> arguments = context.getArguments(); // this is empty!
// This actually does the trick but is a bit ugly - must be parsed
String[] strings = (String[]) context.getArguments()
.get("application.args");
Display display = PlatformUI.createDisplay();
try {
ApplicationWorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
int returnCode = PlatformUI.createAndRunWorkbench(display, advisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IApplication.EXIT_RESTART;
} else {
return IApplication.EXIT_OK;
}
} finally {
display.dispose(); …Run Code Online (Sandbox Code Playgroud) 我按照Vogella RCP教程创建了一个应用程序,像这样lloking:

"我的观点"被明确地添加到视角中.
下面的编辑器是默认的.
问题:
我想通过将org.eclipse.ui.newWizards扩展点添加到plugin.xml文件中,在我的RCP应用程序的File> New菜单中添加我的一些向导.
<extension point="org.eclipse.ui.newWizards">
<category
id="com.my.testapp.ui.objects"
name="Objects"/>
<wizard
category="com.my.testapp.ui.objects"
class="com.my.testapp.ui.wizard.create.COWizard"
icon="icons/co.gif"
id="com.my.testapp.ui.wizard.co"
name="Configure Object"
preferredPerspectives="com.my.testapp.ui.perspective"/>
</wizard>
</extension>
Run Code Online (Sandbox Code Playgroud)
默认情况下,"文件">"新建">"其他"菜单("我的对象"文件夹除了"配置对象向导")外,还包含"常规"文件夹以及以下向导:文件,文件夹,项目和无标题文本文件.在我的应用程序中,这些向导没有意义我想摆脱它们.怎么做?
我正在我的eclipse-rcp应用程序中开发一个搜索对话框.
在搜索对话框中,我有一个组合框,如下所示:
comboImp = new CCombo(grpColSpet, SWT.BORDER | SWT.READ_ONLY);
comboImp.setBounds(556, 46, 184, 27);
comboImpViewer = new ComboViewer(comboImp);
comboImpViewer.setContentProvider(new ArrayContentProvider());
comboImpViewer.setInput(ImpContentProvider.getInstance().getImps());
comboImpViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((Imp)element).getImpName();
}
});
Run Code Online (Sandbox Code Playgroud)
Imp是一个数据库实体,ManyToOne到被搜索的主实体,是ImpContentProvider通过jpa/hibernate与嵌入式sqlite数据库对话的模型类.
这个组合框应该包含所有实例Imp,但也要包含空选择 ; 它的值绑定到服务bean,如下所示:
IObservableValue comboImpSelectionObserveWidget =
ViewersObservables.observeSingleSelection(comboImpViewer);
IObservableValue filterByImpObserveValue =
BeansObservables.observeValue(searchPrep, "imp");
bindingContext.bindValue(comboImpSelectionObserveWidget, filterByImpObserveValue
, null, null);
Run Code Online (Sandbox Code Playgroud)
一旦用户点击组合,就会产生一个选择(第一个元素):我可以看到对我在查看器上添加的selectionlistener的调用.我的问题是:
ImpContentProvider?返回的列表中吗?或者我应该实施替代方案ArrayContentProvider?另外一个相关问题是:
deselectAll()和clearSelection()组合不会为绑定bean设置空值?在我们的一个rcp应用程序窗口中,我需要在创建窗口后动态设置标签文本.
创建窗口时,我会创建标签控件,但那时我不会设置文本.用户在窗口上选择一个按钮后,我想在按钮的选择监听器方法中设置标签的文本.将文本设置为按钮的选择侦听器方法内的标签后,我无法在窗口中看到文本.
当我在侦听器方法中设置它时,为什么我无法在窗口上看到标签文本?是因为窗口已经创建了吗?
我该如何解决这个问题?
应该采用什么方法来更改Eclipse首选项?
它们存储在 <workspace>/.metadata/.plugin/org.eclipse.core.runtime/.settings
但我希望找到Java API以及发现任何首选项ID的方法.
我想保存.metadata/.plugins/com.example.myplugin文件夹中插件的设置.当我使用首选项时,它们会保存在那里,但我想在那里保存自定义文件.现在,Eclipse文档说我不应该使用文件操作在那里写文件,而只使用平台命令.
那么,如何以正确的方式保存自定义工作区元数据?
eclipse-rcp ×10
java ×4
eclipse ×3
combobox ×1
data-binding ×1
editor ×1
jface ×1
rcp ×1
swt ×1