|
|
@ -16,79 +16,68 @@ import javax.swing.*; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class AlphaFineConfigManager implements XMLable { |
|
|
|
public class AlphaFineConfigManager implements XMLable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager(); |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否开启alphafine |
|
|
|
* 是否开启alphafine |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isEnabled = true; |
|
|
|
private boolean isEnabled = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否联网搜索 |
|
|
|
* 是否联网搜索 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isSearchOnLine = true; |
|
|
|
private boolean isSearchOnLine = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 快捷键设置 |
|
|
|
* 搜索范围 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String shortcuts; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 搜索范围 |
|
|
|
* 快捷键设置 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
private String shortcuts; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 猜您需要 |
|
|
|
* 猜您需要 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isContainRecommend = true; |
|
|
|
private boolean isContainRecommend = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置 |
|
|
|
* 设置 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isContainAction = true; |
|
|
|
private boolean isContainAction = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 帮助文档 |
|
|
|
* 帮助文档 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isContainDocument = true; |
|
|
|
private boolean isContainDocument = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 模板 |
|
|
|
* 模板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isContainTemplate = true; |
|
|
|
private boolean isContainTemplate = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 模板内容 |
|
|
|
* 模板内容 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isContainFileContent; |
|
|
|
private boolean isContainFileContent; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 应用中心 |
|
|
|
* 应用中心 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isContainPlugin = true; |
|
|
|
private boolean isContainPlugin = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 快捷键 |
|
|
|
* 快捷键 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private KeyStroke shortCutKeyStore; |
|
|
|
private KeyStroke shortCutKeyStore; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否提醒 |
|
|
|
* 是否提醒 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean isNeedRemind = true; |
|
|
|
private boolean isNeedRemind = true; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 直接操作菜单次数 |
|
|
|
* 直接操作菜单次数 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int operateCount; |
|
|
|
private int operateCount; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static AlphaFineConfigManager alphaFineConfigManager = new AlphaFineConfigManager(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static AlphaFineConfigManager getInstance() { |
|
|
|
public static AlphaFineConfigManager getInstance() { |
|
|
|
return alphaFineConfigManager; |
|
|
|
return alphaFineConfigManager; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean isALPHALicAvailable() { |
|
|
|
|
|
|
|
return FRContext.getCurrentEnv() != null && VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Object clone() throws CloneNotSupportedException { |
|
|
|
public Object clone() throws CloneNotSupportedException { |
|
|
|
AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone(); |
|
|
|
AlphaFineConfigManager manager = (AlphaFineConfigManager) super.clone(); |
|
|
@ -131,8 +120,6 @@ public class AlphaFineConfigManager implements XMLable { |
|
|
|
writer.end(); |
|
|
|
writer.end(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isSearchOnLine() { |
|
|
|
public boolean isSearchOnLine() { |
|
|
|
return isSearchOnLine; |
|
|
|
return isSearchOnLine; |
|
|
|
} |
|
|
|
} |
|
|
@ -148,20 +135,20 @@ public class AlphaFineConfigManager implements XMLable { |
|
|
|
return shortcuts; |
|
|
|
return shortcuts; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setShortcuts(String shortcuts) { |
|
|
|
|
|
|
|
this.shortcuts = shortcuts; |
|
|
|
|
|
|
|
this.shortCutKeyStore = convert2KeyStroke(this.shortcuts); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回默认快捷键 |
|
|
|
* 返回默认快捷键 |
|
|
|
|
|
|
|
* |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String getDefaultShortCuts() { |
|
|
|
private String getDefaultShortCuts() { |
|
|
|
return OperatingSystem.isMacOS() ? "meta + D" : "ctrl + D"; |
|
|
|
return OperatingSystem.isMacOS() ? "meta + D" : "ctrl + D"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setShortcuts(String shortcuts) { |
|
|
|
|
|
|
|
this.shortcuts = shortcuts; |
|
|
|
|
|
|
|
this.shortCutKeyStore = convert2KeyStroke(this.shortcuts); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isContainAction() { |
|
|
|
public boolean isContainAction() { |
|
|
|
return isContainAction; |
|
|
|
return isContainAction; |
|
|
|
} |
|
|
|
} |
|
|
@ -248,9 +235,4 @@ public class AlphaFineConfigManager implements XMLable { |
|
|
|
public void setOperateCount(int operateCount) { |
|
|
|
public void setOperateCount(int operateCount) { |
|
|
|
this.operateCount = operateCount; |
|
|
|
this.operateCount = operateCount; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean isALPHALicAvailable() { |
|
|
|
|
|
|
|
return FRContext.getCurrentEnv() != null && VT4FR.isLicAvailable(FRCoreContext.getBytes()) && VT4FR.ALPHA_FINE.support(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|