|
|
@ -55,7 +55,7 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
private static final double COLUMN_GAP = 180; |
|
|
|
private static final double COLUMN_GAP = 180; |
|
|
|
private static final double ROW_GAP = 25; |
|
|
|
private static final double ROW_GAP = 25; |
|
|
|
private KeyStroke shortCutKeyStore = null; |
|
|
|
private KeyStroke shortCutKeyStore = null; |
|
|
|
private UICheckBox isEnabledCheckbox, isSearchOnlineCheckbox, needSegmentationCheckbox, needIntelligentCustomerService, isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox, isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox; |
|
|
|
private UICheckBox enabledCheckbox, searchOnlineCheckbox, needSegmentationCheckbox, needIntelligentCustomerService, containRecommendCheckbox, containActionCheckbox, containDocumentCheckbox, containTemplateCheckbox, containPluginCheckbox, containFileContentCheckbox; |
|
|
|
private UITextField shortcutsField; |
|
|
|
private UITextField shortcutsField; |
|
|
|
|
|
|
|
|
|
|
|
public AlphaFineConfigPane() { |
|
|
|
public AlphaFineConfigPane() { |
|
|
@ -75,8 +75,8 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private Component[][] initSearchRangeComponents() { |
|
|
|
private Component[][] initSearchRangeComponents() { |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{isContainRecommendCheckbox, isContainActionCheckbox, isContainDocumentCheckbox}, |
|
|
|
new Component[]{containRecommendCheckbox, containActionCheckbox, containDocumentCheckbox}, |
|
|
|
new Component[]{isContainTemplateCheckbox, isContainPluginCheckbox, isContainFileContentCheckbox}, |
|
|
|
new Component[]{containTemplateCheckbox, containPluginCheckbox, containFileContentCheckbox}, |
|
|
|
new Component[]{needIntelligentCustomerService, null, null} |
|
|
|
new Component[]{needIntelligentCustomerService, null, null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return components; |
|
|
|
return components; |
|
|
@ -84,7 +84,7 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private Component[][] initOnlineComponents() { |
|
|
|
private Component[][] initOnlineComponents() { |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{isSearchOnlineCheckbox, needSegmentationCheckbox, null} |
|
|
|
new Component[]{searchOnlineCheckbox, needSegmentationCheckbox, null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return components; |
|
|
|
return components; |
|
|
|
} |
|
|
|
} |
|
|
@ -95,12 +95,12 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
double[] columnSize = {COLUMN_GAP, COLUMN_GAP, COLUMN_GAP}; |
|
|
|
double[] columnSize = {COLUMN_GAP, COLUMN_GAP, COLUMN_GAP}; |
|
|
|
|
|
|
|
|
|
|
|
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range")); |
|
|
|
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range")); |
|
|
|
isContainRecommendCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Recommend")); |
|
|
|
containRecommendCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Recommend")); |
|
|
|
isContainActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set")); |
|
|
|
containActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set")); |
|
|
|
isContainPluginCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon")); |
|
|
|
containPluginCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon")); |
|
|
|
isContainDocumentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")); |
|
|
|
containDocumentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help")); |
|
|
|
isContainTemplateCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Templates")); |
|
|
|
containTemplateCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Templates")); |
|
|
|
isContainFileContentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); |
|
|
|
containFileContentCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); |
|
|
|
needIntelligentCustomerService = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Intelligent_Customer_Service")); |
|
|
|
needIntelligentCustomerService = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Intelligent_Customer_Service")); |
|
|
|
JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initSearchRangeComponents(), rowSize, columnSize); |
|
|
|
JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initSearchRangeComponents(), rowSize, columnSize); |
|
|
|
northPane.add(searchConfigPane); |
|
|
|
northPane.add(searchConfigPane); |
|
|
@ -147,24 +147,24 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private void createOnlinePane(JPanel contentPane) { |
|
|
|
private void createOnlinePane(JPanel contentPane) { |
|
|
|
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Type")); |
|
|
|
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Type")); |
|
|
|
isSearchOnlineCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Internet_Search")); |
|
|
|
searchOnlineCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Internet_Search")); |
|
|
|
needSegmentationCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Segmentation")); |
|
|
|
needSegmentationCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Segmentation")); |
|
|
|
isSearchOnlineCheckbox.addActionListener(new ActionListener() { |
|
|
|
searchOnlineCheckbox.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
if (!isSearchOnlineCheckbox.isSelected()) { |
|
|
|
if (!searchOnlineCheckbox.isSelected()) { |
|
|
|
isContainRecommendCheckbox.setEnabled(false); |
|
|
|
containRecommendCheckbox.setEnabled(false); |
|
|
|
isContainPluginCheckbox.setEnabled(false); |
|
|
|
containPluginCheckbox.setEnabled(false); |
|
|
|
isContainDocumentCheckbox.setEnabled(false); |
|
|
|
containDocumentCheckbox.setEnabled(false); |
|
|
|
needIntelligentCustomerService.setEnabled(false); |
|
|
|
needIntelligentCustomerService.setEnabled(false); |
|
|
|
isContainRecommendCheckbox.setSelected(false); |
|
|
|
containRecommendCheckbox.setSelected(false); |
|
|
|
isContainPluginCheckbox.setSelected(false); |
|
|
|
containPluginCheckbox.setSelected(false); |
|
|
|
isContainDocumentCheckbox.setSelected(false); |
|
|
|
containDocumentCheckbox.setSelected(false); |
|
|
|
needIntelligentCustomerService.setSelected(false); |
|
|
|
needIntelligentCustomerService.setSelected(false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
isContainRecommendCheckbox.setEnabled(true); |
|
|
|
containRecommendCheckbox.setEnabled(true); |
|
|
|
isContainPluginCheckbox.setEnabled(true); |
|
|
|
containPluginCheckbox.setEnabled(true); |
|
|
|
isContainDocumentCheckbox.setEnabled(true); |
|
|
|
containDocumentCheckbox.setEnabled(true); |
|
|
|
needIntelligentCustomerService.setEnabled(true); |
|
|
|
needIntelligentCustomerService.setEnabled(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -178,8 +178,8 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private void createOpenPane(JPanel contentPane) { |
|
|
|
private void createOpenPane(JPanel contentPane) { |
|
|
|
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable")); |
|
|
|
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable")); |
|
|
|
isEnabledCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_AlphaFine")); |
|
|
|
enabledCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_AlphaFine")); |
|
|
|
northPane.add(isEnabledCheckbox); |
|
|
|
northPane.add(enabledCheckbox); |
|
|
|
contentPane.add(northPane); |
|
|
|
contentPane.add(northPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -189,18 +189,18 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(AlphaFineConfigManager alphaFineConfigManager) { |
|
|
|
public void populate(AlphaFineConfigManager alphaFineConfigManager) { |
|
|
|
this.isEnabledCheckbox.setSelected(alphaFineConfigManager.isEnabled()); |
|
|
|
this.enabledCheckbox.setSelected(alphaFineConfigManager.isEnabled()); |
|
|
|
this.isSearchOnlineCheckbox.setEnabled(FRContext.isChineseEnv()); |
|
|
|
this.searchOnlineCheckbox.setEnabled(FRContext.isChineseEnv()); |
|
|
|
this.isSearchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.searchOnlineCheckbox.setSelected(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.isContainActionCheckbox.setSelected(alphaFineConfigManager.isContainAction()); |
|
|
|
this.containActionCheckbox.setSelected(alphaFineConfigManager.isContainAction()); |
|
|
|
this.isContainTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate()); |
|
|
|
this.containTemplateCheckbox.setSelected(alphaFineConfigManager.isContainTemplate()); |
|
|
|
this.isContainFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent()); |
|
|
|
this.containFileContentCheckbox.setSelected(alphaFineConfigManager.isContainFileContent()); |
|
|
|
this.isContainDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.containDocumentCheckbox.setSelected(alphaFineConfigManager.isContainDocument() && alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.isContainDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.containDocumentCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.isContainPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.containPluginCheckbox.setSelected(alphaFineConfigManager.isContainPlugin() && alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.isContainPluginCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.containPluginCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.isContainRecommendCheckbox.setSelected(alphaFineConfigManager.isContainRecommend() && alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.containRecommendCheckbox.setSelected(alphaFineConfigManager.isContainRecommend() && alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.isContainRecommendCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.containRecommendCheckbox.setEnabled(alphaFineConfigManager.isSearchOnLine()); |
|
|
|
this.shortcutsField.setText(getDisplayShortCut(alphaFineConfigManager.getShortcuts())); |
|
|
|
this.shortcutsField.setText(getDisplayShortCut(alphaFineConfigManager.getShortcuts())); |
|
|
|
|
|
|
|
|
|
|
|
this.needSegmentationCheckbox.setSelected(alphaFineConfigManager.isNeedSegmentationCheckbox()); |
|
|
|
this.needSegmentationCheckbox.setSelected(alphaFineConfigManager.isNeedSegmentationCheckbox()); |
|
|
@ -212,14 +212,14 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
public void update() { |
|
|
|
public void update() { |
|
|
|
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); |
|
|
|
DesignerEnvManager designerEnvManager = DesignerEnvManager.getEnvManager(); |
|
|
|
AlphaFineConfigManager alphaFineConfigManager = designerEnvManager.getAlphaFineConfigManager(); |
|
|
|
AlphaFineConfigManager alphaFineConfigManager = designerEnvManager.getAlphaFineConfigManager(); |
|
|
|
alphaFineConfigManager.setContainPlugin(this.isContainPluginCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainPlugin(this.containPluginCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainAction(this.isContainActionCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainAction(this.containActionCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainDocument(this.isContainDocumentCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainDocument(this.containDocumentCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainRecommend(this.isContainRecommendCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainRecommend(this.containRecommendCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setEnabled(this.isEnabledCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setEnabled(this.enabledCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setSearchOnLine(this.isSearchOnlineCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setSearchOnLine(this.searchOnlineCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainTemplate(this.isContainTemplateCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainTemplate(this.containTemplateCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainFileContent(this.isContainFileContentCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setContainFileContent(this.containFileContentCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setNeedSegmentationCheckbox(this.needSegmentationCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setNeedSegmentationCheckbox(this.needSegmentationCheckbox.isSelected()); |
|
|
|
alphaFineConfigManager.setNeedIntelligentCustomerService(this.needIntelligentCustomerService.isSelected()); |
|
|
|
alphaFineConfigManager.setNeedIntelligentCustomerService(this.needIntelligentCustomerService.isSelected()); |
|
|
|
alphaFineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText()); |
|
|
|
alphaFineConfigManager.setShortcuts(shortCutKeyStore != null ? shortCutKeyStore.toString().replace(TYPE, DISPLAY_TYPE) : this.shortcutsField.getText()); |
|
|
@ -255,10 +255,10 @@ public class AlphaFineConfigPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public UICheckBox getIsContainFileContentCheckbox() { |
|
|
|
public UICheckBox getIsContainFileContentCheckbox() { |
|
|
|
return isContainFileContentCheckbox; |
|
|
|
return containFileContentCheckbox; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setIsContainFileContentCheckbox(UICheckBox isContainFileContentCheckbox) { |
|
|
|
public void setIsContainFileContentCheckbox(UICheckBox isContainFileContentCheckbox) { |
|
|
|
this.isContainFileContentCheckbox = isContainFileContentCheckbox; |
|
|
|
this.containFileContentCheckbox = isContainFileContentCheckbox; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|