org.eclipse.ui.forms.widgets.ScrolledForm Java Examples

The following examples show how to use org.eclipse.ui.forms.widgets.ScrolledForm. 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: DemoGeometryPage.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * <p>
 * Provides the page with the geometryApplication's information to display
 * geometry.
 * </p>
 * 
 * @param managedForm
 *            the managed form that handles the page
 */
@Override
public void createFormContent(IManagedForm managedForm) {

	// Local Declarations
	final ScrolledForm form = managedForm.getForm();
	GridLayout layout = new GridLayout();

	// Setup the layout and layout data
	layout.numColumns = 1;
	form.getBody().setLayoutData(
			new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	form.getBody().setLayout(new FillLayout());

	// Just create some text and say hello
	Label geometryText = new Label(form.getBody(), SWT.FLAT);
	geometryText.setText("Draw something based on the geometry.");

	return;

}
 
Example #2
Source File: DiffEditorDialog.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	String title = M.Diff;
	if (this.title != null)
		title += ": " + this.title;
	ScrolledForm form = UI.formHeader(mform, title);
	if (logo != null)
		form.setImage(logo);
	FormToolkit toolkit = mform.getToolkit();
	Composite body = form.getBody();
	UI.gridLayout(body, 1, 0, 0);
	toolkit.paintBordersFor(body);
	UI.gridData(body, true, true);
	if (editMode)
		editor = DiffEditor.forEditing(body, toolkit);
	else
		editor = DiffEditor.forViewing(body, toolkit);
	editor.initialize(root, labelProvider, dependencyResolver, action);
	UI.gridData(editor, true, true);
	form.reflow(true);
}
 
Example #3
Source File: XSPPerfPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
private ScrolledForm initialize() {
    GridLayout ourLayout = new GridLayout(1, false);
    ourLayout.marginHeight = 0;
    ourLayout.marginWidth = 0;
    setLayout(ourLayout);
    setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    ScrolledForm scrolledForm = toolkit.createScrolledForm(this);
    scrolledForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    Composite formatComposite = XSPEditorUtil.createFormComposite(scrolledForm);

    XSPEditorUtil.createCLabel(formatComposite, "Performance Properties", 2); // $NLX-XSPPerfPage.PerformanceProperties-1$
    
    createLeftSide(formatComposite);
    createRightSide(formatComposite);
    return scrolledForm;
}
 
Example #4
Source File: InfoPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(this);
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	InfoSection info = new InfoSection(getEditor());
	info.render(body, tk);
	checkBox(info.getContainer(),
			M.InfrastructureProcess, "infrastructureProcess");
	createButtons(info.getContainer(), tk);
	createTimeSection(body, tk);
	createGeographySection(body, tk);
	createTechnologySection(body, tk);
	new ImageSection(getEditor(), tk, body);
	createDqSection(body, tk);
	body.setFocus();
	form.reflow(true);
}
 
Example #5
Source File: SankeyMiniViewAction.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
private Composite createForm(Composite parent) {
	FormToolkit toolkit = new FormToolkit(Display.getCurrent());
	ScrolledForm form = toolkit.createScrolledForm(parent);
	Composite body = form.getBody();
	body.setLayout(new FillLayout());
	toolkit.paintBordersFor(body);
	SashForm sash = new SashForm(body, SWT.VERTICAL);
	toolkit.adapt(sash, true, true);
	Section section = toolkit.createSection(sash,
			ExpandableComposite.NO_TITLE | ExpandableComposite.EXPANDED);
	section.setText("");
	Composite composite = toolkit.createComposite(section, SWT.NONE);
	composite.setLayout(new GridLayout());
	section.setClient(composite);
	toolkit.paintBordersFor(composite);
	return composite;
}
 
Example #6
Source File: XSPGenPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
private ScrolledForm initialize() {
    setParentPropertyName("xspProperties"); // $NON-NLS-1$
    GridLayout ourLayout = new GridLayout(1, false);
    ourLayout.marginHeight = 0;
    ourLayout.marginWidth = 0;
    setLayout(ourLayout);
    setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    ScrolledForm scrolledForm = toolkit.createScrolledForm(this);
    scrolledForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    Composite formatComposite = XSPEditorUtil.createFormComposite(scrolledForm);

    XSPEditorUtil.createCLabel(formatComposite, "Page Generation Properties", 2); // $NLX-XSPGenPage.PageGenerationProperties-1$
    
    createLeftSide(formatComposite);
    createRightSide(formatComposite);
    return scrolledForm;
}
 
Example #7
Source File: XSPPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
private ScrolledForm initialize() {
    //setParentPropertyName("xspProperties"); // $NON-NLS-1$
    GridLayout ourLayout = new GridLayout(1, false);
    ourLayout.marginHeight = 0;
    ourLayout.marginWidth = 0;
    setLayout(ourLayout);
    setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    ScrolledForm scrolledForm = toolkit.createScrolledForm(this);
    scrolledForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    Composite formatComposite = XSPEditorUtil.createFormComposite(scrolledForm);

    XSPEditorUtil.createCLabel(formatComposite, "XPage Properties", 2); // $NLX-XSPPage.XPageProperties-1$
    
    createLeftSide(formatComposite);
    createRightSide(formatComposite);
    return scrolledForm;
}
 
Example #8
Source File: TotalImpactResultPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(mform,
			Labels.name(setup.productSystem),
			Images.get(result));
	toolkit = mform.getToolkit();
	Composite body = UI.formBody(form, toolkit);
	Section section = UI.section(body, toolkit, M.ImpactAnalysis + ": "
			+ Labels.name(setup.impactMethod));
	UI.gridData(section, true, true);
	Composite client = toolkit.createComposite(section);
	section.setClient(client);
	UI.gridLayout(client, 1);
	createOptions(client);
	createTree(client);
	spinner.register(viewer);
	form.reflow(true);
}
 
Example #9
Source File: AbstractFormPage.java    From typescript.java with MIT License 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm managedForm) {
	final ScrolledForm form = managedForm.getForm();
	FormToolkit toolkit = managedForm.getToolkit();
	toolkit.decorateFormHeading(form.getForm());

	IToolBarManager manager = form.getToolBarManager();
	if (contributeToToolbar(manager)) {
		form.updateToolBar();
	}
	String titleText = getFormTitleText();
	if (titleText != null) {
		form.setText(titleText);
	}
	Image titleImage = getFormTitleImage();
	if (titleImage != null) {
		form.setImage(titleImage);
	}
	toolkit.decorateFormHeading(form.getForm());
	createUI(managedForm);
}
 
Example #10
Source File: ErrorMessageFormPage.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void createFormContent(IManagedForm managedForm) {
	// Local Declarations
	final ScrolledForm form = managedForm.getForm();
	GridLayout layout = new GridLayout();

	// Setup the layout and layout data
	layout.numColumns = 1;
	form.getBody().setLayoutData(
			new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	form.getBody().setLayout(new FillLayout());

	String errorMsg = "There is no data to show in your Form or in this "
			+ "particular component. Please file a bug or email "
			+ "[email protected].";
	managedForm.getToolkit().createText(form.getBody(), errorMsg);

	return;
}
 
Example #11
Source File: ImpactFactorPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(this);
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	Section section = UI.section(body, tk, M.ImpactFactors);
	UI.gridData(section, true, true);
	Composite client = tk.createComposite(section);
	section.setClient(client);
	UI.gridLayout(client, 1);
	render(client, section);
	List<ImpactFactor> factors = impact().impactFactors;
	sortFactors(factors);
	viewer.setInput(factors);
	form.reflow(true);
}
 
Example #12
Source File: InfoPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ContributionResult result = editor.result;
	ScrolledForm form = UI.formHeader(mform,
			Labels.name(editor.setup.productSystem),
			Images.get(editor.result));
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	InfoSection.create(body, tk, editor.setup);
	if (editor.dqResult != null) {
		new DQInfoSection(body, tk, result, editor.dqResult);
	}
	if (result.hasImpactResults()) {
		ContributionChartSection.forImpacts(editor).render(body, tk);
	}
	ContributionChartSection.forFlows(editor).render(body, tk);
	form.reflow(true);
}
 
Example #13
Source File: FormsPart.java    From codeexamples-eclipse with Eclipse Public License 1.0 6 votes vote down vote up
private void createSecondSection( ScrolledForm form, FormToolkit toolkit) {
	ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), 
		     ExpandableComposite.TREE_NODE|
		     ExpandableComposite.CLIENT_INDENT);
		 ec.setText("Expandable Composite title");
		 String ctext = "We will now create a somewhat long text so that "+
		 "we can use it as content for the expandable composite. "+
		 "Expandable composite is used to hide or show the text using the " +
		 "toggle control";
		 Label client = toolkit.createLabel(ec, ctext, SWT.WRAP);
		 ec.setClient(client);
		 TableWrapData  td = new TableWrapData();
		 td.colspan = 2;
		 ec.setLayoutData(td);
		 ec.addExpansionListener(new ExpansionAdapter() {
		  @Override
		public void expansionStateChanged(ExpansionEvent e) {
		   form.reflow(true);
		  }
		 });

	
}
 
Example #14
Source File: LocationPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(mform,
			Labels.name(setup.productSystem),
			Images.get(result));
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	createCombos(body, tk);
	SashForm sash = new SashForm(body, SWT.VERTICAL);
	UI.gridData(sash, true, true);
	tk.adapt(sash);
	createTree(sash, tk);
	map = ResultMap.on(sash, tk);
	form.reflow(true);
	refreshSelection();
}
 
Example #15
Source File: UI.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public static ScrolledForm formHeader(IManagedForm mform, String title, Image image) {
	ScrolledForm form = mform.getForm();
	FormToolkit tk = mform.getToolkit();
	tk.getHyperlinkGroup().setHyperlinkUnderlineMode(
			HyperlinkSettings.UNDERLINE_HOVER);
	if (title != null)
		form.setText(title);
	if (image != null)
		form.setImage(image);
	tk.decorateFormHeading(form.getForm());
	return form;
}
 
Example #16
Source File: StartPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = mform.getForm();
	Composite comp = form.getBody();
	comp.setLayout(new FillLayout());
	Browser browser = new Browser(comp, SWT.NONE);
	browser.setJavascriptEnabled(true);

	// handles link clicks and opens them in the browser
	UI.bindFunction(browser, "onOpenLink", (args) -> {
		if (args == null || args.length == 0)
			return null;
		Object s = args[0];
		if (!(s instanceof String))
			return null;
		Desktop.browse(s.toString());
		return null;
	});

	// handles click on the "native library hint"
	UI.bindFunction(browser, "onLibHintClick", (args) -> {
		LibraryDownload.open();
		return null;
	});

	// set the start page configuration
	UI.onLoaded(browser, HtmlFolder.getUrl("home.html"), () -> {
		HashMap<String, Object> config = new HashMap<>();
		config.put("version", getVersion());
		String lang = AppArg.get("nl");
		config.put("lang", Strings.nullOrEmpty(lang) ? "en" : lang);
		config.put("showLibHint", !Julia.isWithUmfpack());
		String json = new Gson().toJson(config);
		browser.execute("setData(" + json + ")");
	});
}
 
Example #17
Source File: Editors.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
/**
 * Adds a refresh function to the tool-bar of the given form (content of a
 * editor page). When this function is executed the given editor is closed
 * and opened again.
 */
public static void addRefresh(ScrolledForm form, ModelEditor<?> editor) {
	if (form == null || editor == null)
		return;
	CategorizedEntity model = editor.getModel();
	Action refresh = Actions.create(M.Reload, Icon.REFRESH.descriptor(),
			() -> {
				App.closeEditor(model);
				App.openEditor(model);
			});
	IToolBarManager toolbar = form.getToolBarManager();
	toolbar.add(refresh);
}
 
Example #18
Source File: GeoPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(this);
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	setupSection(body, tk);
	paramSection = new GeoParamSection(this);
	paramSection.drawOn(body, tk);
	flowSection = new GeoFlowSection(this);
	flowSection.drawOn(body, tk);
	form.reflow(true);
}
 
Example #19
Source File: MappingPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(mform, "Flow mapping");
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	createInfoSection(tk, body);
	createTable(body, tk);
	form.reflow(true);
}
 
Example #20
Source File: DatabasePropertiesDialog.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void createFormContent(IManagedForm managedForm) {
	FormToolkit toolkit = managedForm.getToolkit();
	ScrolledForm form = UI.formHeader(managedForm, M.Properties);
	Composite body = UI.formBody(form, toolkit);
	Composite content = UI.formComposite(body, toolkit);
	if (config instanceof DerbyConfiguration) {
		DerbyConfiguration derbyConfig = (DerbyConfiguration) config;
		renderDerbyConfig(derbyConfig, content, toolkit);
	} else if (config instanceof MySQLConfiguration) {
		MySQLConfiguration mysqlConfig = (MySQLConfiguration) config;
		renderMysqlConfiguration(mysqlConfig, content, toolkit);
	}
}
 
Example #21
Source File: ImpactMethodInfoPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(this);
	FormToolkit tk = mform.getToolkit();
	Composite body = UI.formBody(form, tk);
	InfoSection info = new InfoSection(getEditor());
	info.render(body, tk);
	createIndicatorTable(tk, body);
	body.setFocus();
	form.reflow(true);
}
 
Example #22
Source File: WidgetFactory.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public static ExpandableComposite createExpandableComposite(final FormToolkit t,
	final ScrolledForm f, String text){
	ExpandableComposite ret =
		t.createExpandableComposite(f.getBody(), ExpandableComposite.TWISTIE);
	ret.setText(text);
	ret.addExpansionListener(new ExpansionAdapter() {
		public void expansionStateChanged(ExpansionEvent e){
			f.reflow(true);
		}
	});
	return ret;
}
 
Example #23
Source File: UI.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
public static ScrolledForm formHeader(ModelPage<?> page) {
	Image image = Images.get(page.getEditor().getModel());
	ScrolledForm form = formHeader(page.getManagedForm(), page.getFormTitle(), image);
	// "" is 'general' comment on data set
	if (page.getEditor().hasComment("")) {
		form.getToolBarManager().add(new CommentAction("", page.getEditor().getComments()));
	}
	Editors.addRefresh(form, page.getEditor());
	form.getToolBarManager().update(true);
	return form;
}
 
Example #24
Source File: HeaderPageWithSash.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the tool bar actions.
 *
 * @param managedForm the managed form
 */
protected void createToolBarActions(IManagedForm managedForm) {
  final ScrolledForm form = managedForm.getForm();

  haction = new Action("hor", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
    @Override
    public void run() {
      sashForm.setOrientation(SWT.HORIZONTAL);
      form.reflow(true);
    }
  };
  haction.setChecked(true);
  haction.setToolTipText("Horizontal Orientation");
  TAEConfiguratorPlugin instance = TAEConfiguratorPlugin.getDefault();
  haction.setImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
  haction.setDisabledImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));

  vaction = new Action("ver", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
    @Override
    public void run() {
      sashForm.setOrientation(SWT.VERTICAL);
      form.reflow(true);
    }
  };
  vaction.setChecked(false);
  vaction.setToolTipText("Vertical Orientation");
  vaction.setImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
  vaction.setDisabledImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
  form.getToolBarManager().add(haction);
  form.getToolBarManager().add(vaction);
  form.updateToolBar();
  maybeInitialize(managedForm);
}
 
Example #25
Source File: HeaderPage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Setup 2 column layout not sash.
 *
 * @param managedForm the managed form
 * @param equalWidth the equal width
 * @return the form 2 panel
 */
public Form2Panel setup2ColumnLayoutNotSash(IManagedForm managedForm, boolean equalWidth) {
  final ScrolledForm sform = managedForm.getForm();
  final Composite form = sform.getBody();
  GridLayout layout = new GridLayout(2, equalWidth);
  form.setLayout(layout);
  form.setLayoutData(new GridData(GridData.FILL_BOTH));
  leftPanel = newComposite(form);
  rightPanel = newComposite(form);
  // strategy for setting size hints of right and left panels
  // Why set hints? Because they make the inner containing things
  // scroll horiz. if they're too wide (useful for aggregates having
  // long names).
  // What hint to set? The hint should be the smallest size you want
  // with child scrolling, before the tabbed page container itself
  // gets a scroll bar.
  // When in the life cycle to do this? Only need to do it once, but
  // after the Grid Layout has happened. This can be the first resizing
  // event (learned this by debugging)

  sform.addListener(SWT.Resize, new Listener() {
    @Override
    public void handleEvent(Event event) {
      float col1CurrentWidth = leftPanel.getSize().x;
      float col2CurrentWidth = rightPanel.getSize().x;
      final int minLeftPanelWidth = 250; // in pels
      final int minRightPanelWidth = (int) (col2CurrentWidth * minLeftPanelWidth / col1CurrentWidth);
      ((GridData) leftPanel.getLayoutData()).widthHint = minLeftPanelWidth;
      ((GridData) rightPanel.getLayoutData()).widthHint = minRightPanelWidth;
      sform.removeListener(SWT.Resize, this); // only do this one time
    }
  });
  return new Form2Panel(form, leftPanel, rightPanel);
}
 
Example #26
Source File: HeaderPage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Setup 1 column layout.
 *
 * @param managedForm the managed form
 * @return the composite
 */
public Composite setup1ColumnLayout(IManagedForm managedForm) {
  final ScrolledForm sform = managedForm.getForm();
  final Composite form = sform.getBody();
  form.setLayout(new GridLayout(1, false)); // this is required !
  Composite xtra = toolkit.createComposite(form);
  xtra.setLayout(new GridLayout(1, false));
  xtra.setLayoutData(new GridData(GridData.FILL_BOTH));

  Control c = form.getParent();
  while (!(c instanceof ScrolledComposite))
    c = c.getParent();
  ((GridData) xtra.getLayoutData()).widthHint = c.getSize().x;
  return xtra;
}
 
Example #27
Source File: HeaderPage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Setup 2 column grid.
 *
 * @param managedForm the managed form
 * @param equalWidth the equal width
 * @return the composite
 */
// this method creates no new composites.
public Composite setup2ColumnGrid(IManagedForm managedForm, boolean equalWidth) {
  final ScrolledForm sform = managedForm.getForm();
  final Composite form = sform.getBody();
  GridLayout layout = new GridLayout(2, equalWidth);
  form.setLayout(layout);
  form.setLayoutData(new GridData(GridData.FILL_BOTH));
  return form;
}
 
Example #28
Source File: CommitDialog.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
protected void createFormContent(IManagedForm mform) {
	ScrolledForm form = UI.formHeader(mform, M.CommitChangesToRepository);
	FormToolkit toolkit = mform.getToolkit();
	Composite body = form.getBody();
	body.setLayout(new GridLayout());
	toolkit.paintBordersFor(body);
	UI.gridData(body, true, true);
	createCommitMessage(body, toolkit);
	createModelViewer(body, toolkit);
	form.reflow(true);
	viewer.setInput(Collections.singleton(node));
	viewer.setSelection(initialSelection);
}
 
Example #29
Source File: ICESectionPage.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <p>
 * This operation creates ICETableComponentSectionParts for each
 * TableComponent in the list of TableComponents and figures out exactly how
 * they should be arranged and span across the page based on their
 * properties.
 * </p>
 *
 */
private void createTableComponentSections() {

	// Get the parent form and the ToolKit to create decorated Sections.
	final ScrolledForm scrolledForm = managedFormRef.getForm();
	final FormToolkit formToolkit = managedFormRef.getToolkit();

	// Each TableComponent will get is own Section that occupies a single
	// row in the parent GridLayout (that is, the Form's GridLayout). The
	// rows will grab all excess vertical and horizontal space available in
	// the Form.

	// Create the TableComponent Sections.
	Composite container = scrolledForm.getBody();
	for (int i = 0; i < tableComponents.size(); i++) {
		// Create a new Section for the current TableComponent.
		TableComponent tableComponent = tableComponents.get(i);
		Section section = formToolkit.createSection(container,
				ExpandableComposite.TITLE_BAR | Section.DESCRIPTION
						| ExpandableComposite.TWISTIE
						| ExpandableComposite.EXPANDED);
		// Each Section should fill all available horizontal and vertical
		// space in the parent GridLayout, but it should only grab excess
		// horizontal space.
		section.setLayoutData(
				new GridData(SWT.FILL, SWT.FILL, true, false));

		// To populate the Section, use an ICETableComponentSectionPart.
		ICETableComponentSectionPart sectionPart;
		sectionPart = new ICETableComponentSectionPart(section, editor,
				managedFormRef);
		sectionPart.setTableComponent(tableComponent);
		sectionPart.renderSection();
		// Add the part to the ManagedForm's update lifecycle.
		managedFormRef.addPart(sectionPart);
	}

	return;
}
 
Example #30
Source File: ICEScrolledPropertiesBlock.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * <p>
 * This operation creates actions in the toolbar for the block.
 * </p>
 * 
 * @param managedForm
 *            <p>
 *            The parent Form
 *            </p>
 */
@Override
protected void createToolBarActions(IManagedForm managedForm) {
	final ScrolledForm form = managedForm.getForm();
	Action haction = new Action("Horizontal Orientation",
			IAction.AS_RADIO_BUTTON) {
		@Override
		public void run() {
			sashForm.setOrientation(SWT.HORIZONTAL);
			form.reflow(true);
		}
	};
	haction.setChecked(true);
	haction.setToolTipText("Set Details to the Right of Masters");
	Action vaction = new Action("Vertical Orientation",
			IAction.AS_RADIO_BUTTON) {
		@Override
		public void run() {
			sashForm.setOrientation(SWT.VERTICAL);
			form.reflow(true);
		}
	};
	vaction.setChecked(false);
	vaction.setToolTipText("Set Details Below Masters");
	form.getToolBarManager().add(haction);
	form.getToolBarManager().add(vaction);
}