有没有办法像Eclipse那样制作IntelliJ IDEA格式的条件语句(根据条件优先级)?
的Eclipse
public boolean apply(NewsDocument document) {
return "EDG".equalsIgnoreCase(document.getFeedShortName())
&& (isNullOrEmpty(document.getEdgarFormType())
|| "10-K".equalsIgnoreCase(document.getEdgarFormType())
|| "20-F".equalsIgnoreCase(document.getEdgarFormType()))
&& documentWithinRecentFiscalYear(document);
}
return accessLevel == inFeature.getAccessLevel()
|| accessLevel != AccessLevel.NO_ACCESS
&& inFeature.getAccessLevel() == AccessLevel.NOT_SET;
return hasConnectionHolder() && getConnectionHolder().isRollbackOnly()
|| getHibernateSessionHolder() != null
&& getHibernateSessionHolder().isRollbackOnly()
|| getTxContextHolder() != null
&& getTxContextHolder().isRollbackOnly();
IntelliJ IDEA (设置|代码样式| Java |包装和大括号|二进制表达式|在多行= false 时将对齐括号
public boolean apply(NewsDocument document) {
return "EDG".equalsIgnoreCase(document.getFeedShortName())
&& (isNullOrEmpty(document.getEdgarFormType())
|| "10-K".equalsIgnoreCase(document.getEdgarFormType())
|| "20-F".equalsIgnoreCase(document.getEdgarFormType()))
&& documentWithinRecentFiscalYear(document);
}
return accessLevel == inFeature.getAccessLevel()
|| accessLevel != AccessLevel.NO_ACCESS
&& inFeature.getAccessLevel() == AccessLevel.NOT_SET;
return hasConnectionHolder() && getConnectionHolder().isRollbackOnly()
|| getHibernateSessionHolder() != null
&& getHibernateSessionHolder().isRollbackOnly()
|| getTxContextHolder() != null
&& getTxContextHolder().isRollbackOnly();
IntelliJ IDEA (设置|代码样式| Java |包装和大括号|二进制表达式|在多行= 为真时将对齐括号)
public boolean apply(NewsDocument document) {
return "EDG".equalsIgnoreCase(document.getFeedShortName())
&& (isNullOrEmpty(document.getEdgarFormType())
|| "10-K".equalsIgnoreCase(document.getEdgarFormType())
|| "20-F".equalsIgnoreCase(document.getEdgarFormType()))
&& documentWithinRecentFiscalYear(document);
}
return accessLevel == inFeature.getAccessLevel()
|| accessLevel != AccessLevel.NO_ACCESS
&& inFeature.getAccessLevel() == AccessLevel.NOT_SET;
return hasConnectionHolder() && getConnectionHolder().isRollbackOnly()
|| getHibernateSessionHolder() != null
&& getHibernateSessionHolder().isRollbackOnly()
|| getTxContextHolder() != null
&& getTxContextHolder().isRollbackOnly();
IntelliJ IDEA版本:2017.3.5
答案 0 :(得分:0)
您只需从Eclipse导入代码格式化程序设置