ScrolledForm
のscrollBarで問題が発生することがあります。this guy in EclipseZone Forumと同じ問題が発生します(これは2005年に尋ねられた質問ですが、未解決のようです)。ScrolledFormでスクロールバーを無効にする方法は?
//The scrollbar should only be displayed in the TreeViewer,not the whole form
ScrolledForm
のscrollBarで問題が発生することがあります。this guy in EclipseZone Forumと同じ問題が発生します(これは2005年に尋ねられた質問ですが、未解決のようです)。ScrolledFormでスクロールバーを無効にする方法は?
//The scrollbar should only be displayed in the TreeViewer,not the whole form
私はこの問題accross数回来て、このようにそれを解決してきました。その後、
@Override
protected void createFormContent(IManagedForm managedForm) {
// set the form's body's layout to GridLayout
final Composite body = managedForm.getForm().getBody();
body.setLayout(new GridLayout());
// create the composite which should not have the scrollbar and set its layout data
// to GridData with width and height hints equal to the size of the form's body
final Composite notScrolledComposite = managedForm.getToolkit().createComposite(body);
final GridData gdata = GridDataFactory.fillDefaults()
.grab(true, true)
.hint(body.getClientArea().width, body.getClientArea().height)
.create();
notScrolledComposite.setLayoutData(gdata);
// add resize listener so the composite's width and height hints are updates when
// the form's body resizes
body.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
super.controlResized(e);
gdata.widthHint = body.getClientArea().width;
gdata.heightHint = body.getClientArea().height;
notScrolledComposite.layout(true);
}
});
}
お知らせフォームの体内でGridLayout
とに幅と高さhint
を設定します複合体のGridLayoutData
。
また、グリッドレイアウトデータを更新し、コンポジットをレイアウトする本文のサイズ変更リスナーにも注意してください。
希望すると助かります!
したがって、スクロールしたフォームは使用しないでください。別のコンテナを使用してください。 – jarodeells
@jarodeellsこれは、ManagedFormのメソッド 'getForm()'がScrolledFormを返すためです(http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi% 2Forg%2Feclipse%2Fui%2Fforms%2FManagedForm.html) –
@ janhinkの例で問題を解決できましたか?私は同じ問題であると思われるものを持っているが、その解決策を働かせることができないので、あなたはそれが働くために必要なものが不思議なものを見つけた。 – NealSr