Java Code Examples for org.eclipse.ui.forms.widgets.Section#TITLE_BAR

The following examples show how to use org.eclipse.ui.forms.widgets.Section#TITLE_BAR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EvaluateConstantExpressionPage.java    From tlaplus with MIT License 5 votes vote down vote up
@Override
protected void createBodyContent(IManagedForm managedForm) {
       final int sectionFlags = Section.TITLE_BAR | Section.TREE_NODE | Section.EXPANDED | SWT.WRAP;
       final int textFieldFlags = SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY | SWT.FULL_SELECTION | SWT.WRAP;

       final FormToolkit toolkit = managedForm.getToolkit();
       final Composite body = managedForm.getForm().getBody();
       final GridLayout gl = new GridLayout();
       gl.marginHeight = 0;
       gl.marginWidth = 0;
       body.setLayout(gl);
       
	final BodyContentAssets bca = createBodyContent(body, toolkit, sectionFlags, textFieldFlags,
			getExpansionListener(), (ModelEditor)getEditor());
	m_expressionInput = bca.getExpressionInput();
	m_expressionOutput = bca.getExpressionOutput();
	m_toggleButton = bca.m_toggleButton;

	m_validateableCalculatorSection = new ValidateableSectionPart(bca.getSection(), this, SEC_EXPRESSION);
       // This ensures that when the part is made dirty, the model appears unsaved.
       managedForm.addPart(m_validateableCalculatorSection);

       // This makes the widget unsaved when text is entered.
       m_expressionInput.getTextWidget().addModifyListener(new DirtyMarkingListener(m_validateableCalculatorSection, false));

       getDataBindingManager().bindSection(m_validateableCalculatorSection, SEC_EXPRESSION, getId());
       getDataBindingManager().bindAttribute(Model.MODEL_EXPRESSION_EVAL, m_expressionInput, m_validateableCalculatorSection);
}
 
Example 2
Source File: ValidateableTableSectionPart.java    From tlaplus with MIT License 4 votes vote down vote up
/**
 * Constructor of the part without section flags
 * @see ValidateableTableSectionPart#TableSectionPart(Composite, String, String, FormToolkit, int)
 */
public ValidateableTableSectionPart(Composite composite, String title, String description, FormToolkit toolkit,
        BasicFormPage page, String sectionName)
{
    this(composite, title, description, toolkit, Section.DESCRIPTION | Section.TITLE_BAR, page, sectionName);
}