/*******************************************************************************
* Copyright (c) 2006-2013 The RCP Company 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:
* The RCP Company - initial API and implementation
*******************************************************************************/
package com.rcpcompany.uibindings;
import org.eclipse.core.commands.ExecutionEvent;
import com.rcpcompany.uibindings.utils.IFormCreator;
/**
* A section in the "Binding Spy Dialog".
* <p>
* For each section {@link #build(IFormCreator, ExecutionEvent)} is called once and can add the
* specified {@link IFormCreator form}. The current binding is found as
* <code>form.getObject()</code>.
* <p>
* The {@link #build(IFormCreator, ExecutionEvent)} can add to the form conditionally...
*
* <pre>
* public class BindingBasicSection implements IBindingSpySection {
* @Override
* public void build(IFormCreator creator) {
* final IBinding b = (IBinding) creator.getObject();
* final IFormCreator subform = creator.addSection("Basic Binding Information");
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__STATE).readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__LABEL).readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__TYPE).readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__WIDGET).type("className").readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__DATA_TYPE).type("className").readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__MODEL_ETYPE).readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__MODEL_TYPE).type("className").readonly();
* subform.addField(null, IUIBindingsPackage.Literals.BINDING__UI_TYPE).type("className").readonly();
* }
* }
* </pre>
*
* @author Tonny Madsen, The RCP Company
*/
public interface IBindingSpySection {
/**
* Builds the section if relevant for the current object.
*
* @param form the form to add to
* @param event TODO
*/
void build(IFormCreator form, ExecutionEvent event);
}