Skip to content

Custom attribute with dropdown#15

Open
bsasschetti wants to merge 2 commits into
mstahv:masterfrom
Thalamuscorp:custom-attribute-with-dropdown
Open

Custom attribute with dropdown#15
bsasschetti wants to merge 2 commits into
mstahv:masterfrom
Thalamuscorp:custom-attribute-with-dropdown

Conversation

@bsasschetti
Copy link
Copy Markdown
Contributor

New features for CustomNodeType and CustomNodeAttribute

  • Added support for Dropdown/ComboBox on CustomNodeAttribute.
  • Added readOnly option to CustomNodeAttribute constructor.
  • Added default attributes override option to CustomNodeType.

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
Copy link
Copy Markdown

gguardin commented Oct 3, 2018

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

@mstahv
Copy link
Copy Markdown
Owner

mstahv commented Oct 16, 2018

Was this supposed to go to the new repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants