Код: Выделить всё
public class CustomPropertySheetPage extends ExtendedPropertySheetPage {
public CustomPropertySheetPage(AdapterFactoryEditingDomain adapterFactoryEditingDomain) {
super(adapterFactoryEditingDomain);
}
@Override
public void createControl(Composite parent) {
// Set a layout for the parent composite
parent.setLayout(new GridLayout());
// Create a composite for the header
Composite headerComposite = new Composite(parent, SWT.NONE);
headerComposite.setLayout(new GridLayout());
headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
// Add a label to act as the header
Label headerLabel = new Label(headerComposite, SWT.NONE);
headerLabel.setText("Extended Properties Header");
headerLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false));
// Create a composite for the property sheet
Composite propertySheetComposite = new Composite(parent, SWT.NONE);
propertySheetComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// Call the super method to create the actual property sheet controls below the
// header
super.createControl(propertySheetComposite);
}
Таблица свойств отображается, но заголовок отсутствует. Я подозреваю, что это как-то связано с тем, как я настраиваю макет или как добавляю элементы управления.
Что я пробовал:
Обеспечение что заголовок создается после вызова super.createControl(parent).
Установка GridLayout для составного элемента.
Вопрос:
Как могу ли я изменить этот код, чтобы правильно отображать заголовок над PropertySheet? Следует ли мне реструктурировать управление макетом?
Подробнее здесь: https://stackoverflow.com/questions/790 ... clipse-rcp
Мобильная версия