Skip to content
Dim edited this page Apr 17, 2019 · 6 revisions

Welcome to the de.dc.emf.javafx.xtext.lang wiki!

Getting started

This section will describe how to define the controls in javafxlang. You can find all the examples in the project de.dc.javafx.xcore.example

TableViewFX

TableViewFX Example

  • First you have to create a file with the extension *.javafxlang
  • Each dsl file need the packagePath, this is required for the infer path
  • All the controls get get into the controls{...} section. This can has more than one control, e.g. TableViewFX
  • The TableViewFX should has an unique name and a referencing usedModel, so you have to create a pojo usedMode, here: Contact
  • The minimalistic column definition is column(name), this will generate a column with the default width 200.0 and it will not used for filtering. To deactivate filtering use the syntax useFilter. The column will show the value of the property name, which is set on name. If another value should be shown on this side, a custom CellValueFactory can set. The custom CellValueFactory should enhanced by the super class de.dc.javafx.xcore.lang.lib.feature.CellValueFactory.
  • The TableViewFX as optionally a propertyview and toolbar for searching
  • To generate a TableViewFX application the generateDemo should be activate.
packagePath "de.dc.javafx.xcore.example"

controls{
	TableViewFX{
		name: ContactTable 
		usedModel: de.dc.javafx.xcore.example.model.Contact
		column(name:Name) 
		column(name:Age cellValueFactory: AgeTreeCellFeature useFilter)
		column(name:Gender cellValueFactory: GenderTreeCellFeature)
		column(name:Address) 
		showPropertyView: false
		showToolbar: true
		generateDemo: true
	}  
} 

TreeViewFX

TreeViewFX Example

  • The TreeViewFX requires an unique name
  • usedModel is the domain model to the three
  • This view supports the property view and toolbar for searching
  • generate demo will create an runnable treeview example
  • To display the properties in the property view, the method #initProperties must be overritten, e.g. add new PropertyValue -> properties.add(new PropertyValue("Name", "Default Value"));
  • To update the property view with selected view items, the method #onTreeViewSelectionChanged must overritten with setting the properties -> e.g. properties.get(0).setValue("Hello World");

EMF Support

With help from e(fx)clipse a lot of methods can supports the editing of emf xmi files:

  • Undo / Redo
  • Notifications
  • XmiReader / XmiWriter
  • Generic CellFeatures

link