mstahv / diagram-builder

Vaadin Add-on built over ALLOYUI DiagramBuilder
Apache License 2.0
7 stars 11 forks source link

Custom attribute with dropdown #15

Open bsasschetti opened 6 years ago

bsasschetti commented 6 years ago

New features for CustomNodeType and CustomNodeAttribute

Reminder to everyone: It's still a quick approach to fulfill our project needs, surely has a lot of things to improve and everyone is welcome to help to it +1.

Usage

Following the previous Pull Request description, the new constructors signatures to use are the following:

For custom node type:

CustomNodeType(String type)
CustomNodeType(String type, CustomNodeAttribute... customAttributes)
CustomNodeType(String type, boolean usesDefaultAttributes, CustomNodeAttribute... customAttributes)

usesDefaultAttributes defaults to true

For simple text attribute:

CustomNodeAttribute(String name)
CustomNodeAttribute(String name, String defaultValue)
CustomNodeAttribute(String name, String defaultValue, boolean readOnly)

For Dropdown/ComboBox attribute:

CustomNodeAttribute(String name, String defaultValue, boolean isComboBox, List<String> options)
CustomNodeAttribute(String name, String defaultValue, boolean readOnly, boolean isComboBox, List<String> options)

isComboBox and readOnly both default to false when not used on constructor.

Suggested next steps

  1. Create CustomNodeAttribute inheritances for each attribute type, using the different xyzCellEditor types from AUI to render the fields.
  2. Make attribute options compatible with Vaadin DataProvider and asynchronous loading.
  3. Somehow allow to nest attributes from a node, maybe starting by dropdonws (for example, an attribute called Country is set, then another attribute called State is populated)
gguardin commented 5 years ago

I created this by mistake, I can't cancel it.

mstahv commented 5 years ago

Was this supposed to go to the new repository?