/******************************************************************************* * Copyright (c) 2001, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.views.properties.tabbed; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.events.ControlAdapter; import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.views.properties.PropertySheetPage; /** * An advanced section that is intended to show the original table format properties view * provided by base Eclipse. * * @author Anthony Hunter */ public class AdvancedPropertySection extends AbstractPropertySection { /** * The Property Sheet Page. */ protected PropertySheetPage page; /** * @see org.eclipse.ui.views.properties.tabbed.ISection#createControls(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) */ public void createControls(Composite parent, final TabbedPropertySheetPage atabbedPropertySheetPage) { super.createControls(parent, atabbedPropertySheetPage); Composite composite = getWidgetFactory() .createFlatFormComposite(parent); page = new PropertySheetPage(); page.createControl(composite); FormData data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(100, 0); data.top = new FormAttachment(0, 0); data.bottom = new FormAttachment(100, 0); page.getControl().setLayoutData(data); page.getControl().addControlListener(new ControlAdapter() { public void controlResized(ControlEvent e) { atabbedPropertySheetPage.resizeScrolledComposite(); } }); } /** * @see org.eclipse.ui.views.properties.tabbed.ISection#setInput(org.eclipse.ui.IWorkbenchPart, * org.eclipse.jface.viewers.ISelection) */ public void setInput(IWorkbenchPart part, ISelection selection) { super.setInput(part, selection); page.selectionChanged(part, selection); } /** * @see org.eclipse.ui.views.properties.tabbed.ISection#dispose() */ public void dispose() { super.dispose(); if (page != null) { page.dispose(); page = null; } } /** * @see org.eclipse.ui.views.properties.tabbed.ISection#refresh() */ public void refresh() { page.refresh(); } /** * @see org.eclipse.ui.views.properties.tabbed.ISection#shouldUseExtraSpace() */ public boolean shouldUseExtraSpace() { return true; } }