|
|
@ -35,7 +35,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_NUMBER))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_NUMBER), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -57,6 +57,12 @@ public enum CellFormatType { |
|
|
|
public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { |
|
|
|
public boolean isNeed(CellElement cellElement, String firstStr, String secondStr) { |
|
|
|
return cellElement.getStyle().getFormat() == null; |
|
|
|
return cellElement.getStyle().getFormat() == null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isEverChanged(Info info, String inputStr, String extraStr) { |
|
|
|
|
|
|
|
CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); |
|
|
|
|
|
|
|
return (cellElement.getStyle() != null && cellElement.getStyle().getFormat() == null); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 单元格-格式-货币 |
|
|
|
* 单元格-格式-货币 |
|
|
@ -69,7 +75,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_MONEY))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_MONEY), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -89,7 +95,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_DATE))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_DATE), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -97,6 +103,11 @@ public enum CellFormatType { |
|
|
|
Format format = cellElement.getStyle().getFormat(); |
|
|
|
Format format = cellElement.getStyle().getFormat(); |
|
|
|
return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); |
|
|
|
return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isEverChanged(Info info, String inputStr, String extraStr) { |
|
|
|
|
|
|
|
return isEverChanged4FineDataFormat(info, extraStr); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 单元格-格式-时间 |
|
|
|
* 单元格-格式-时间 |
|
|
@ -109,7 +120,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_TIME))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_TIME), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -117,6 +128,11 @@ public enum CellFormatType { |
|
|
|
Format format = cellElement.getStyle().getFormat(); |
|
|
|
Format format = cellElement.getStyle().getFormat(); |
|
|
|
return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); |
|
|
|
return format instanceof FineDateFormat && StringUtils.equals(((FineDateFormat) format).toPattern(), secondStr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isEverChanged(Info info, String inputStr, String extraStr) { |
|
|
|
|
|
|
|
return isEverChanged4FineDataFormat(info, extraStr); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 单元格-格式-科学计数 |
|
|
|
* 单元格-格式-科学计数 |
|
|
@ -129,7 +145,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_SCIENCE))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_SCIENCE), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -149,7 +165,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERCENT))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERCENT), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -169,7 +185,7 @@ public enum CellFormatType { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<String> getItems() { |
|
|
|
public List<String> getItems() { |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERMILLAGE))); |
|
|
|
return Arrays.asList(FormatField.getInstance().getFormatArray(FormatField.getInstance().getContents(SettingContent.FORMAT_PERMILLAGE), false)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -187,6 +203,14 @@ public enum CellFormatType { |
|
|
|
Format format = cellElement.getStyle().getFormat(); |
|
|
|
Format format = cellElement.getStyle().getFormat(); |
|
|
|
return format instanceof TextFormat; |
|
|
|
return format instanceof TextFormat; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean isEverChanged(Info info, String inputStr, String extraStr) { |
|
|
|
|
|
|
|
CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); |
|
|
|
|
|
|
|
return !(cellElement.getStyle() != null |
|
|
|
|
|
|
|
&& cellElement.getStyle().getFormat() != null |
|
|
|
|
|
|
|
&& cellElement.getStyle().getFormat() instanceof TextFormat); |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -256,4 +280,35 @@ public enum CellFormatType { |
|
|
|
((NameStyle) cellElement.getStyle()).refreshStyle(); |
|
|
|
((NameStyle) cellElement.getStyle()).refreshStyle(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 是否修改过 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param info 存储单元格信息的数据结构 |
|
|
|
|
|
|
|
* @param inputStr 用户输入的第一级下拉框内容 |
|
|
|
|
|
|
|
* @param extraStr 用户输入的第二级下拉框内容 |
|
|
|
|
|
|
|
* @return 修改过返回true |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean isEverChanged(Info info, String inputStr, String extraStr) { |
|
|
|
|
|
|
|
CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); |
|
|
|
|
|
|
|
return !(cellElement.getStyle() != null |
|
|
|
|
|
|
|
&& cellElement.getStyle().getFormat() != null |
|
|
|
|
|
|
|
&& cellElement.getStyle().getFormat() instanceof CoreDecimalFormat |
|
|
|
|
|
|
|
&& StringUtils.equals(((CoreDecimalFormat) cellElement.getStyle().getFormat()).toPattern(), extraStr)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 针对日期和时间类型的修改判定 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param info 存储单元格信息的数据结构 |
|
|
|
|
|
|
|
* @param extraStr 用户输入的第二级下拉框内容 |
|
|
|
|
|
|
|
* @return 修改过返回true |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean isEverChanged4FineDataFormat(Info info, String extraStr) { |
|
|
|
|
|
|
|
CellElement cellElement = (CellElement) info.getContent().getReplaceObject(); |
|
|
|
|
|
|
|
return !(cellElement.getStyle() != null |
|
|
|
|
|
|
|
&& cellElement.getStyle().getFormat() != null |
|
|
|
|
|
|
|
&& cellElement.getStyle().getFormat() instanceof FineDateFormat |
|
|
|
|
|
|
|
&& StringUtils.equals(((FineDateFormat) cellElement.getStyle().getFormat()).toPattern(), extraStr)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|