Browse Source

alphafine 修改搜索框弹出逻辑

master
XiaXiang 7 years ago
parent
commit
99fddf29b4
  1. 15
      designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java
  2. 28
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

15
designer/src/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -21,15 +21,22 @@ import java.util.List;
public class AlphaFineHelper {
public static final NoResultModel NO_RESULT_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_AlphaFine_NoResult"));
public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(Inter.getLocText("FR-Designer_ConnectionFailed"));
private static AlphaFineDialog alphaFineDialog;
/**
* 弹出alphafine搜索面板
*/
public static void showAlphaFineDialog(boolean forceOpen) {
AlphaFineDialog dialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
manager.setNeedRemind(false);
dialog.setVisible(true);
if (alphaFineDialog == null) {
alphaFineDialog = new AlphaFineDialog(DesignerContext.getDesignerFrame(), forceOpen);
alphaFineDialog.setVisible(true);
final AlphaFineConfigManager manager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
manager.setNeedRemind(false);
} else {
alphaFineDialog.setVisible(!alphaFineDialog.isVisible());
}
}

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

@ -69,6 +69,7 @@ public class AlphaFineDialog extends UIDialog {
private static final String DS_NAME = "dsname=\"";
private static final String PLUGIN_MARK_SHORT = "k:4 ";
private static final String PLUGIN_MARK = "k:shop ";
private static final String PLACE_HOLDER = "AlphaFine";
private AlphaFineTextField searchTextField;
private UIButton closeButton;
@ -171,7 +172,7 @@ public class AlphaFineDialog extends UIDialog {
* 初始化输入框
*/
private void initSearchTextField() {
searchTextField = new AlphaFineTextField("AlphaFine");
searchTextField = new AlphaFineTextField(PLACE_HOLDER);
initTextFieldKeyListener();
searchTextField.setFont(AlphaFineConstants.GREATER_FONT);
searchTextField.setBackground(Color.white);
@ -235,7 +236,30 @@ public class AlphaFineDialog extends UIDialog {
}
boolean isNeedSearch(String text) {
return ComparatorUtils.equals("AlphaFine", text) || text.contains("'");
return ComparatorUtils.equals(PLACE_HOLDER, text) || text.contains("'");
}
@Override
public void setVisible(boolean isVisible) {
if (!isVisible) {
dispose();
return;
}
super.setVisible(isVisible);
}
@Override
public void dispose() {
resetDialog();
super.dispose();
}
/**
* 重置搜索框
*/
private void resetDialog() {
removeSearchResult();
searchTextField.setText(null);
}
/**

Loading…
Cancel
Save