V
Vayu
Gast
Servus,
ich probier grad Sections (Twisties) in eine normale Section zu adden. Aber irgendwie krieg ich nur die Mainsection angezeigt, die enthält keinerlei andere sections
was mache ich noch falsch?
[HIGHLIGHT="Java"]private DateTime m_datePicker = null;
private ScrolledForm m_events = null;
private Composite m_today = null;
private Composite m_tomorrow = null;
private Composite m_soon = null;
private FormToolkit m_toolkit;
private ScrolledForm m_form;
private Composite m_parent;
public CalClipseView() {
}
@Override
public void createPartControl(Composite parent) {
m_toolkit = new FormToolkit(parent.getDisplay());
m_form = m_toolkit.createScrolledForm(parent);
m_parent = m_form.getBody();
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 1;
m_parent.setLayout(layout);
TableWrapData tableWrapData = new TableWrapData(TableWrapData.FILL);
tableWrapData.colspan = 1;
Section date = m_toolkit.createSection(m_parent, Section.NO_TITLE);
date.setLayout(layout);
m_datePicker = new DateTime(date, SWT.CALENDAR);
m_datePicker.setLayoutData(tableWrapData);
date.setClient(m_datePicker);
Section events = m_toolkit.createSection(m_parent, Section.TITLE_BAR);
events.setLayout(layout);
events.setLayoutData(tableWrapData);
events.setText("Anstehende Termine");
m_events = m_toolkit.createScrolledForm(events);
events.setLayout(layout);
m_events.setLayoutData(tableWrapData);
events.setClient(m_events);
Section today = m_toolkit.createSection(m_events.getBody(), Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED | Section.TREE_NODE);
today.setText("Heute");
today.setLayout(layout);
today.setLayoutData(tableWrapData);
m_today = m_toolkit.createComposite(today);
m_today.setLayoutData(tableWrapData);
m_today.setLayout(new GridLayout());
today.setClient(m_today);
Section tomorrow = m_toolkit.createSection(m_events.getBody(), Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED | Section.TREE_NODE);
tomorrow.setLayout(layout);
tomorrow.setLayoutData(tableWrapData);
tomorrow.setText("Morgen");
m_tomorrow = m_toolkit.createComposite(tomorrow);
m_tomorrow.setLayoutData(tableWrapData);
tomorrow.setClient(m_tomorrow);
Section soon = m_toolkit.createSection(m_events.getBody(), Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED | Section.TREE_NODE);
soon.setLayout(layout);
soon.setLayoutData(tableWrapData);
soon.setText("Bald");
m_soon = m_toolkit.createComposite(soon);
m_soon.setLayoutData(tableWrapData);
soon.setClient(m_soon);
m_events.update();
parent.pack(true);
m_form.reflow(true);
}[/HIGHLIGHT]
ich probier grad Sections (Twisties) in eine normale Section zu adden. Aber irgendwie krieg ich nur die Mainsection angezeigt, die enthält keinerlei andere sections
was mache ich noch falsch?
[HIGHLIGHT="Java"]private DateTime m_datePicker = null;
private ScrolledForm m_events = null;
private Composite m_today = null;
private Composite m_tomorrow = null;
private Composite m_soon = null;
private FormToolkit m_toolkit;
private ScrolledForm m_form;
private Composite m_parent;
public CalClipseView() {
}
@Override
public void createPartControl(Composite parent) {
m_toolkit = new FormToolkit(parent.getDisplay());
m_form = m_toolkit.createScrolledForm(parent);
m_parent = m_form.getBody();
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 1;
m_parent.setLayout(layout);
TableWrapData tableWrapData = new TableWrapData(TableWrapData.FILL);
tableWrapData.colspan = 1;
Section date = m_toolkit.createSection(m_parent, Section.NO_TITLE);
date.setLayout(layout);
m_datePicker = new DateTime(date, SWT.CALENDAR);
m_datePicker.setLayoutData(tableWrapData);
date.setClient(m_datePicker);
Section events = m_toolkit.createSection(m_parent, Section.TITLE_BAR);
events.setLayout(layout);
events.setLayoutData(tableWrapData);
events.setText("Anstehende Termine");
m_events = m_toolkit.createScrolledForm(events);
events.setLayout(layout);
m_events.setLayoutData(tableWrapData);
events.setClient(m_events);
Section today = m_toolkit.createSection(m_events.getBody(), Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED | Section.TREE_NODE);
today.setText("Heute");
today.setLayout(layout);
today.setLayoutData(tableWrapData);
m_today = m_toolkit.createComposite(today);
m_today.setLayoutData(tableWrapData);
m_today.setLayout(new GridLayout());
today.setClient(m_today);
Section tomorrow = m_toolkit.createSection(m_events.getBody(), Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED | Section.TREE_NODE);
tomorrow.setLayout(layout);
tomorrow.setLayoutData(tableWrapData);
tomorrow.setText("Morgen");
m_tomorrow = m_toolkit.createComposite(tomorrow);
m_tomorrow.setLayoutData(tableWrapData);
tomorrow.setClient(m_tomorrow);
Section soon = m_toolkit.createSection(m_events.getBody(), Section.TITLE_BAR | Section.TWISTIE
| Section.EXPANDED | Section.TREE_NODE);
soon.setLayout(layout);
soon.setLayoutData(tableWrapData);
soon.setText("Bald");
m_soon = m_toolkit.createComposite(soon);
m_soon.setLayoutData(tableWrapData);
soon.setClient(m_soon);
m_events.update();
parent.pack(true);
m_form.reflow(true);
}[/HIGHLIGHT]
Zuletzt bearbeitet von einem Moderator: