@Override public void widgetSelected(SelectionEvent e) { if (attribute.isFocusControl() && attribute.getSelectionIndex() != -1) { String selectedAttribute = attribute.getText(); text.insert(selectedAttribute); attribute.clearSelection(); changed(); text.setFocus(); return; } if (operation.isFocusControl() && operation.getSelectionIndex() != -1) { String selectedOperation = operation.getText(); text.insert(selectedOperation); operation.clearSelection(); changed(); text.setFocus(); return; } if (value.isFocusControl() && value.getSelectionIndex() != -1) { String selectedValue = value.getText(); text.insert(selectedValue); value.clearSelection(); changed(); text.setFocus(); return; } }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { initialObjectField.clearSelection(); encodingField.clearSelection(); fileField.setFocus(); } }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { if (initialObjectField.getItemCount() == 1) { initialObjectField.clearSelection(); encodingField.setFocus(); } else { encodingField.clearSelection(); initialObjectField.setFocus(); } } }
private void populateOperationCombo() { if (_operationSelectionCombo != null && !_operationSelectionCombo.isDisposed()) { _operationSelectionCombo.removeAll(); _operationSelectionCombo.clearSelection(); if (getTargetObject() == null) { PictogramElement[] pes = SwitchyardSCAEditor.getActiveEditor().getSelectedPictogramElements(); if (pes.length > 0) { Object bo = SwitchyardSCAEditor.getActiveEditor() .getDiagramTypeProvider() .getFeatureProvider() .getBusinessObjectForPictogramElement(pes[0]); if (bo instanceof Contract) { setTargetObject(bo); } } } if (getTargetObject() != null && getTargetObject() instanceof Contract) { String[] operations = InterfaceOpsUtil.gatherOperations((Contract) getTargetObject()); for (int i = 0; i < operations.length; i++) { _operationSelectionCombo.add(operations[i]); } } } }
/** * ************************************************************************* Called when the user * types selections ************************************************************************ */ private void onUserType(String typed) { if (m_promptData != null) if (m_promptData.isList() && m_promptData.getExpected() != null) { boolean found = false; if (!typed.isEmpty()) { for (String expected : m_promptData.getExpected()) { if (expected.equals(typed)) { int idx = m_promptData.getExpected().indexOf(expected); m_selectedOption = idx; if (m_optionsCombo != null) { m_optionsCombo.select(idx); } else { m_optionsRadio.get(idx).setSelection(true); } found = true; break; } } } if (!found) { m_selectedOption = -1; if (m_optionsCombo != null) { m_optionsCombo.clearSelection(); } else { for (Button b : m_optionsRadio) { b.setSelection(false); } } } } }
/** 设置Combo下拉列表中的数据 */ private void setComboData(Combo combo, String[] data) { if (combo == null || data == null || data.length == 0) { return; } combo.clearSelection(); combo.removeAll(); int i = 0; for (String temp : data) { combo.add(temp, i++); } }
/** * clearSelection to the combo. * * @return */ public void clearSelection() { combo.clearSelection(); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public void selectFileField() { initialObjectField.clearSelection(); encodingField.clearSelection(); fileField.selectAll(); fileField.setFocus(); }