use of com.servoy.j2db.smart.dataui.DataComboBox in project servoy-client by Servoy.
the class SwingForm method setTabSeqComponents.
public void setTabSeqComponents(List<Component> tabSequence) {
IDataRenderer formEditorRenderer = formController.getDataRenderers()[FormController.FORM_EDITOR];
if (formEditorRenderer instanceof TableView && (tabSequence == null || !tabSequence.contains(formEditorRenderer))) {
// table view should be added to tab sequence
((TableView) formEditorRenderer).setTabSeqComponents(tabSequence);
if (tabSequence != null && tabSequence.size() > 0) {
// this means that we have to identify components that are part of the table view and based on where these are located set the view's tabIndex
// when called from JS tabSequence will only contain table columns, not table view as opposed to initialization when tabSequence only contains the view
int i;
for (i = 0; i < tabSequence.size(); i++) {
if (((TableView) formEditorRenderer).isColumnIdentifierComponent(tabSequence.get(i))) {
tabSequence = new ArrayList<Component>(tabSequence);
tabSequence.add(i, (Component) formEditorRenderer);
break;
}
}
i++;
while (i < tabSequence.size()) {
if (((TableView) formEditorRenderer).isColumnIdentifierComponent(tabSequence.get(i))) {
tabSequence.remove(i);
} else {
i++;
}
}
}
}
this.tabSeqComponentList = tabSequence;
if (tabSeqComponentList != null) {
if (tabSeqComponentList.size() > 0) {
JComponent lastComponent = (JComponent) tabSeqComponentList.get(tabSeqComponentList.size() - 1);
if (!(lastComponent instanceof SpecialTabPanel)) {
int modifier = 0;
if ((lastComponent instanceof TableView))
modifier = InputEvent.CTRL_DOWN_MASK;
if ((lastComponent instanceof DataComboBox) && ((DataComboBox) lastComponent).isEditable())
lastComponent = (JComponent) ((DataComboBox) lastComponent).getEditor().getEditorComponent();
addJumpOutActionToComponent(lastComponent, KeyStroke.getKeyStroke(KeyEvent.VK_TAB, modifier), ACTION_GO_OUT_TO_NEXT, false);
}
JComponent firstComponent = (JComponent) tabSeqComponentList.get(0);
if (!(firstComponent instanceof SpecialTabPanel)) {
int modifier = 0;
if ((firstComponent instanceof TableView))
modifier = InputEvent.CTRL_DOWN_MASK;
if ((firstComponent instanceof DataComboBox) && ((DataComboBox) firstComponent).isEditable())
firstComponent = (JComponent) ((DataComboBox) firstComponent).getEditor().getEditorComponent();
addJumpOutActionToComponent(firstComponent, KeyStroke.getKeyStroke(KeyEvent.VK_TAB, modifier | InputEvent.SHIFT_DOWN_MASK), ACTION_GO_OUT_TO_PREV, true);
}
}
}
}
Aggregations