Browse Source

Merge pull request #1454 in BA/design from ~XIAOXIA/design:release/9.0 to release/9.0

* commit '0758690e2de6690209b7c8d6f002c0cff798f9b7':
  rt
  控件名遍历
  rt
  rt
  rt
  遍历控件名问题
  enter键问题
master
superman 7 years ago
parent
commit
bc307a957b
  1. 10
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  2. 8
      designer_base/src/com/fr/design/actions/UpdateAction.java

10
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -676,7 +676,7 @@ public class AlphaFineDialog extends UIDialog {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1); searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() + 1);
} else if (e.getKeyCode() == KeyEvent.VK_UP) { } else if (e.getKeyCode() == KeyEvent.VK_UP) {
searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() - 1); searchResultList.setSelectedIndex(searchResultList.getSelectedIndex() - 1);
} else escAlphaFine(e); } else escAlphaFineDialog(e);
} }
}); });
@ -888,7 +888,7 @@ public class AlphaFineDialog extends UIDialog {
* *
* @param e * @param e
*/ */
private void escAlphaFine(KeyEvent e) { private void escAlphaFineDialog(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) { if (StringUtils.isBlank(searchTextField.getText()) || ComparatorUtils.equals(searchTextField.getText(), searchTextField.getPlaceHolder())) {
AlphaFineDialog.this.setVisible(false); AlphaFineDialog.this.setVisible(false);
@ -896,6 +896,10 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.setText(null); searchTextField.setText(null);
removeSearchResult(); removeSearchResult();
} }
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (searchResultList.getModel().getSize() > 1) {
dealWithSearchResult(searchResultList.getSelectedValue());
}
} }
} }
@ -969,7 +973,7 @@ public class AlphaFineDialog extends UIDialog {
addKeyListener(new KeyAdapter() { addKeyListener(new KeyAdapter() {
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
escAlphaFine(e); escAlphaFineDialog(e);
} }
}); });

8
designer_base/src/com/fr/design/actions/UpdateAction.java

@ -504,10 +504,12 @@ public abstract class UpdateAction extends ShortCut implements Action {
} else if (component instanceof JComboBox) { } else if (component instanceof JComboBox) {
for (int i = 0; i < ((JComboBox) component).getItemCount(); i++) { for (int i = 0; i < ((JComboBox) component).getItemCount(); i++) {
text.append(((JComboBox) component).getItemAt(i)); Object componentName = ((JComboBox) component).getItemAt(i);
String title = String.valueOf(((JComboBox) component).getItemAt(i)); if (componentName instanceof String && StringUtils.isNotBlank(String.valueOf(componentName))) {
String title = String.valueOf(componentName);
text.append(title);
handleSearchText(separator, text, pinyin, shortPinyin, title); handleSearchText(separator, text, pinyin, shortPinyin, title);
}
} }
} else if (component instanceof JTabbedPane) { } else if (component instanceof JTabbedPane) {
getTabPaneTexts((JTabbedPane) component, separator, text, pinyin, shortPinyin); getTabPaneTexts((JTabbedPane) component, separator, text, pinyin, shortPinyin);

Loading…
Cancel
Save