【发布时间】:2017-09-14 21:03:46
【问题描述】:
我为我的 e4 rcp 应用程序创建了一个状态栏,但状态栏太小了。
在我的 Appliication.e4xmi 中配置了以下内容:
修剪的窗口 -> TrimBars -> 窗口修剪(底部) -> 工具栏 -> 工具控件(链接到我的 StatusBar 类)
链接状态栏类:
public class StatusBar {
private Label label;
@Inject
private IEventBroker eventBroker;
public static final String STATUSBAR = "statusbar";
@Inject
@Optional
public void getEvent(@UIEventTopic(STATUSBAR) String message) {
updateInterface(message);
}
@PostConstruct
public void createControls(Composite parent) {
label = new Label(parent, SWT.LEFT);
label.setBackground(parent.getBackground());
}
public void updateInterface(String message) {
try {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
try {
label.setText(message);
} catch (Exception e) {
logger.error(e.fillInStackTrace());
}
}
});
} catch (Exception exception) {
logger.error(exception.fillInStackTrace());
}
}
【问题讨论】:
-
太小了怎么办?不够深?不够长?
-
状态栏高度太小了。