- typeCmb.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent event) {
-
- try { // TODO enhance this
- // retrieve old and new node type
- int oldIndex = getCurrTypeIndex();
- int selIndex = typeCmb.getSelectionIndex();
-
- // insure something has really been modified
- if (selIndex < 0 || oldIndex == selIndex)
- return;
-
- // remove old mixin, add new and notify form
- if (oldIndex > -1)
- getAkbNode().removeMixin(connectorTypes[oldIndex]);
- getAkbNode().addMixin(connectorTypes[selIndex]);
- part.markDirty();
- } catch (RepositoryException e) {
- throw new AkbException(
- "Error while updating connector type", e);
- }
- }
- });