Eclipseフォームの右上隅にボタンを追加する方法はありません。Eclipse RCP - Eclipseフォームの右上隅にボタンを追加する方法
ボタンは、フォームのタイトルのように見えるのフォーム機能やそのちょうど別の複合体の一部であり、フォームのタイトル領域の一部であるように思われますか?どのソースコードの例(ドラフトさえも)は高く評価されています。
編集:
私はセクションにボタンを追加するために管理しているが、まだフォーム自体に、私はここで見つける例を使用していない:それでも
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = new Cursor(Display.getCurrent(),
SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Cursor needs to be explicitly disposed
toolbar.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
if ((handCursor != null) && (handCursor.isDisposed() == false)) {
handCursor.dispose();
}
}
});
// save
CommandContributionItemParameter saveContributionParameter = new CommandContributionItemParameter(
editor.getSite(), null,
"it.wellnet.easysitebox.menu.commands.saveMenu",
CommandContributionItem.STYLE_PUSH);
saveContributionParameter.icon = RegiloCoreImages.getInstance().DESC_UPDATE;
CommandContributionItem saveMenu = new CommandContributionItem(
saveContributionParameter);
toolBarManager.add(saveMenu);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
をフォーム自体には運がありません。
を使用して、ツールバーマネージャを取得してみてください。内部のcreatePartControl(..)メソッドとおそらくthats問題、私のフォームはScrolledForm型ですか? – Kris
私はEclipse RCPでもうプレイしないので、検証する時間がありませんが、そのupvotedとして私はその真実を信じています:そして正しい答えとしてそれをマークします、thx – Kris