Jump to: navigation, search

Difference between revisions of "EMF Facet/Table/UI Test"

(UI Test)
Line 1: Line 1:
 +
== Ui Tests ==
 
Create a Java project named test
 
Create a Java project named test
  

Revision as of 07:16, 16 March 2011

Ui Tests

Create a Java project named test

In the project test001, create an ecore model: File > New > Other > Eclipse Modeling Framework > Ecore Model

  • name: MyEcoreModel

Press Next

  • Model Object : EPackage
  • XML Encoding : UTF-8

Press Finish

In MyEcoreModel.ecore, fill the newly created package inforamtion:

  • name : MyPackage
  • Ns Prefix : MyNsPrefix
  • NS URI : MyNsURI

Right click on MyPackage, "New Child" > "EClass"

  • name : Class1

Right click on MyPackage, "New Child" > "EClass"

  • name : Class2

Select Class1 and Class2, right click on them and select "Edit in a Table Editor" You should obtain this result :

Serialization

Test that you can serialize the Table using either the Shortcut "CRTL + S", or the usual menu button.

  • Name it "classes.table", press "Enter", the editor's state has to change from dirty to clean.

Editability

  • Edit Class1 name (Shortcut F2 and double click on the cell name have to be working), change it for Class10.
  • To validate the modification, either press "Enter" or click outside the cell (both should be working)
  • You should be able to cancel your action, either with the "CTRL+Z" shorcut, or through the usual Edit menu
  • The editor state should switch to "dirty", and you sould be able to save modification.
  • Move the Table horizontal scroll bar so that it does not stick to its initial position, and change Class2 name for "Class20"
  • The horizontal scrollBar should stay at its current position.

Drag and Drop

Go back to MyEcoreModel.ecore, and add a new EDataType child

  • name : EDataType1
  • Arrange the editor window so that you can see both ecore and table editor.
  • Drag EDataType1 over the table editor and drop it in an empty area.

A new line should be added to the table (check that undo is possible), save this new table state

Menu Button

Customization

EMF Facet project comes with an example of ECore Customization on CLasses

  • Open classes.table
  • Press "Load a Customization" in the main Eclipse toolbar
  • Choose "Ecore" customization, you should obtain the following result :
  • Test that unload works as well, returning to a "non customized" table (no undo at the time)