From 268f71145e869d85075efff5d639e3125e6bb6bc Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 23 Oct 2018 15:42:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-11993=20=E6=99=AE=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/ConnectionComboBoxPanel.java | 10 ++++++++++ designer-base/src/main/java/com/fr/design/mingche.java | 6 ------ 2 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/mingche.java diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index 68db344fba..f4a7910b1c 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -15,11 +15,13 @@ import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; import com.fr.workspace.WorkContext; +import com.fr.workspace.server.connection.DBConnectAuth; import javax.swing.SwingUtilities; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; +import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -62,8 +64,16 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { ConnectionConfig mgr = ConnectionConfig.getInstance(); Iterator nameIt = mgr.getConnections().keySet().iterator(); + + Collection noAuthConnections = WorkContext.getCurrent().get(DBConnectAuth.class).getNoAuthConnections(); + if (noAuthConnections == null) { + return nameList.iterator(); + } while (nameIt.hasNext()) { String conName = nameIt.next(); + if (noAuthConnections.contains(conName)) { + continue; + } Connection connection = mgr.getConnection(conName); filterConnection(connection, conName, nameList); } diff --git a/designer-base/src/main/java/com/fr/design/mingche.java b/designer-base/src/main/java/com/fr/design/mingche.java deleted file mode 100644 index da6ffa948c..0000000000 --- a/designer-base/src/main/java/com/fr/design/mingche.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.fr.design; - -public class mingche -{ - -} From 0a81bbe1dbccb3d5dfb03a0162243122a86cb711 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 24 Oct 2018 17:48:21 +0800 Subject: [PATCH 2/4] =?UTF-8?q?REPORT-11016=2010.0=E7=89=88=E6=9C=ACmac?= =?UTF-8?q?=E4=B8=8A=E7=82=B9=E5=87=BB=E6=9C=80=E5=A4=A7=E5=8C=96=E4=BC=9A?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/start/jni/splash.dylib | Bin 32320 -> 41248 bytes 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 designer-realize/src/main/resources/com/fr/start/jni/splash.dylib diff --git a/designer-realize/src/main/resources/com/fr/start/jni/splash.dylib b/designer-realize/src/main/resources/com/fr/start/jni/splash.dylib old mode 100644 new mode 100755 index 3e19cd20e55488220c6ea4559390f4cc112921b9..5d096b2b37d34197e377f7b1ed115c3768bd0d08 GIT binary patch literal 41248 zcmeHP4R}=5nZ5yHgBTLjX;DO@Mi&+GC!--1nS=xfBq0(&x|R-;nHy$cG85+~Kh`{r z8^$snr%ktF>DsOFx7c6o;}5#pMzn&umDFxEYpul=>#(aW#ce@$W%m8PbI#128-CJf z`|R%X^d7kPocEmXd(U^ibMBdY&YaBNqwgR4n5Gp>)->%jTxa6icDkm;wNj)s?HpV_ z6uMlin%1u3to&P5KGY-zr&fpy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UWqHpODnD_4SUv|;wOj3{mCVV?!xv?xU8w=Iz5OVDh&0NdbK%OEfMFd z)|d)ut~8gK=Dh0h<(b7YqU~72BUAn4f1-9}G zU0G^8O(o}%Qz}*d1LkhIIZ@jEPyYmnO%x3N(|#a|kIny!2Y`Ni%@=U{qnK0FZduv- zs2~Dm=Y_3%B{hxr10q z+>h6ItPn&h!JSqcTWEm+dJlAncWM(v0j)W{fs0o1ls`+;R<~OwjQ%XE_>skVR;2k? z&!6wE>eM||dbxE$hvzESf(2Ebm7awi1L68M@?=c}EW}{MJQv$7m&T%JgWgefrEt{^d1Ge1r3H*W-KJCOv%H2G`d0Uw-Y@ zyosGpHtxOuoUVnpynD~j&ii2atv6PE^WKGTHEn5leg5q9+9H45^S8PG`p_rp&wKJ$ z_Re|V`$*T0@5noLsPOfD7alB`@aks=Hh;e54-a32@KRjQrAB`En@>_6n=!eRi$E>{ zxd`MUkc&Vr0=Wp}B9MzfE&{m-{xd`MUkc&Vr0=Wp}B9Mzf aE&{m-{+W!Kk_o_(% From eb1ebc95c833bb8aa30ccee02582a22f4ab62365 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 25 Oct 2018 10:27:05 +0800 Subject: [PATCH 3/4] =?UTF-8?q?REPORT-11886=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E7=9B=AE=E5=BD=95=E6=A0=91=E5=88=B7=E6=96=B0=E5=8D=A1?= =?UTF-8?q?=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/EnvFileTree.java | 14 +- .../itree/filetree/FileNodeComparator.java | 109 ++++++---- .../design/gui/itree/filetree/JFileTree.java | 201 +++++++++--------- .../gui/itree/filetree/TemplateFileTree.java | 2 +- .../main/java/com/fr/file/FileNodeFILE.java | 8 +- 5 files changed, 177 insertions(+), 157 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index 0c894ff924..550ba715e5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -146,14 +146,14 @@ public class EnvFileTree extends RefreshableJTree { * * 返回currentTreeNode下是否找到了filePath */ - private boolean selectFilePath(ExpandMutableTreeNode currentTreeNode, String prefix, String filePath, DefaultTreeModel m_model) { + private boolean selectFilePath(ExpandMutableTreeNode currentTreeNode, String prefix, String filePath, DefaultTreeModel model) { FileNode fileNode = (FileNode) currentTreeNode.getUserObject(); String nodePath = fileNode.getName(); String currentTreePath = prefix + nodePath; // 如果equals,说明找到了,不必再找下去了 if (ComparatorUtils.equals(new File(currentTreePath), new File(filePath))) { - this.setSelectionPath(new TreePath(m_model.getPathToRoot(currentTreeNode))); + this.setSelectionPath(new TreePath(model.getPathToRoot(currentTreeNode))); return true; } // 如果当前路径是currentFilePath的ParentFile,则expandTreeNode,并继续往下找 @@ -164,7 +164,7 @@ public class EnvFileTree extends RefreshableJTree { for (int i = 0, len = currentTreeNode.getChildCount(); i < len; i++) { ExpandMutableTreeNode childTreeNode = (ExpandMutableTreeNode) currentTreeNode.getChildAt(i); - if (selectFilePath(childTreeNode, prefix, filePath, m_model)) { + if (selectFilePath(childTreeNode, prefix, filePath, model)) { return true; } } @@ -219,7 +219,7 @@ public class EnvFileTree extends RefreshableJTree { resFns = tList.toArray(new FileNode[tList.size()]); } - Arrays.sort(resFns, new FileNodeComparator()); + Arrays.sort(resFns, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); return resFns; } @@ -248,8 +248,8 @@ public class EnvFileTree extends RefreshableJTree { */ public void refreshEnv() { - DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); - ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) m_model.getRoot(); + DefaultTreeModel model = (DefaultTreeModel) this.getModel(); + ExpandMutableTreeNode rootTreeNode = (ExpandMutableTreeNode) model.getRoot(); rootTreeNode.removeAllChildren(); FileNode[] fns; @@ -273,7 +273,7 @@ public class EnvFileTree extends RefreshableJTree { rootTreeNode.add(node); } - m_model.reload(rootTreeNode); + model.reload(rootTreeNode); } /* diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java index bf4a5155c7..f963d80d14 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java @@ -10,17 +10,45 @@ import java.util.Comparator; * Directory is in the first. and normal file the in the last. */ public class FileNodeComparator implements Comparator { - // 正序还是倒序 - private boolean isReverse = false; - - public FileNodeComparator() { - this(false); - } - - public FileNodeComparator(boolean reverse) { - this.isReverse = reverse; - } - + /** + * 正序还是倒序 + */ + private boolean isReverse; + + /** + * 文件扩展名类型 + */ + private String[] supportTypes; + + /** + * @see FileNodeComparator#FileNodeComparator(boolean, String[]) + * @deprecated + */ + @Deprecated + public FileNodeComparator() { + this(false); + } + + public FileNodeComparator(String[] types) { + this(false, types); + } + + /** + * @param reverse 是否是倒序,{@code true} 倒序,{@code false} 正序 + * @see FileNodeComparator#FileNodeComparator(boolean, String[]) + * @deprecated + */ + @Deprecated + public FileNodeComparator(boolean reverse) { + this.isReverse = reverse; + this.supportTypes = FRContext.getFileNodes().getSupportedTypes(); + } + + public FileNodeComparator(boolean reverse, String[] types) { + this.isReverse = reverse; + this.supportTypes = types; + } + /** * This method should return > 0 if v1 is greater than v2, 0 if * v1 is equal to v2, or < 0 if v1 is less than v2. @@ -29,49 +57,48 @@ public class FileNodeComparator implements Comparator { * @return < 0, 0, or > 0 for v1v2. */ public int compare(FileNode nameNode1, FileNode nameNode2) { - int returnVal; + int returnVal; if (nameNode1.isDirectory()) { if (nameNode2.isDirectory()) { - returnVal = nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); + returnVal = nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); } else { - returnVal = -1; + returnVal = -1; } } else { if (nameNode2.isDirectory()) { - returnVal = 1; + returnVal = 1; } else { - returnVal=groupByFileType(nameNode1, nameNode2, 0); + returnVal = groupByFileType(nameNode1, nameNode2, 0); } } if (isReverse) { - returnVal = 0 - returnVal; + returnVal = 0 - returnVal; } return returnVal; } /** - * 一个简单的递归判断算法 - * @param nameNode1 - * @param nameNode2 - * @param i - * @return + * 一个简单的递归判断算法,依据文件类型排序 + * + * @param nameNode1 节点1 + * @param nameNode2 节点2 + * @param i i + * @return value */ - private int groupByFileType(FileNode nameNode1, FileNode nameNode2, - int i) { - - String[] supportTypes = FRContext.getFileNodes().getSupportedTypes(); - if (i < supportTypes.length) { - if (nameNode1.isFileType(supportTypes[i])) - if (nameNode2.isFileType(supportTypes[i])) - return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); - else - return-1; - else if (nameNode2.isFileType(supportTypes[i])) - return 1; - else{ - return groupByFileType(nameNode1, nameNode2, i+1); - } - }else - return -1; - } - } \ No newline at end of file + private int groupByFileType(FileNode nameNode1, FileNode nameNode2, + int i) { + if (i < supportTypes.length) { + if (nameNode1.isFileType(supportTypes[i])) + if (nameNode2.isFileType(supportTypes[i])) + return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); + else + return -1; + else if (nameNode2.isFileType(supportTypes[i])) + return 1; + else { + return groupByFileType(nameNode1, nameNode2, i + 1); + } + } else + return -1; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java index 1ade707d49..a1a1567c53 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java @@ -1,5 +1,18 @@ package com.fr.design.gui.itree.filetree; +import com.fr.base.BaseUtils; +import com.fr.design.i18n.Toolkit; +import com.fr.general.ComparatorUtils; +import com.fr.stable.ArrayUtils; +import com.fr.stable.project.ProjectConstants; + +import javax.swing.Icon; +import javax.swing.JTree; +import javax.swing.filechooser.FileSystemView; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellRenderer; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; import java.awt.Color; import java.awt.Component; import java.awt.Font; @@ -11,26 +24,12 @@ import java.util.Comparator; import java.util.List; import java.util.Stack; -import javax.swing.Icon; -import javax.swing.JTree; -import javax.swing.filechooser.FileSystemView; -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeCellRenderer; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.TreePath; - -import com.fr.base.BaseUtils; -import com.fr.general.ComparatorUtils; - -import com.fr.stable.ArrayUtils; -import com.fr.stable.project.ProjectConstants; - /** * File Tree. */ public class JFileTree extends AbstractFileTree { - protected FileFilter fileFilter ; + protected FileFilter fileFilter; public JFileTree() { this(null); @@ -43,9 +42,9 @@ public class JFileTree extends AbstractFileTree { private void init(FileFilter filter) { this.fileFilter = filter; - DefaultTreeModel m_model = new DefaultTreeModel(new DefaultMutableTreeNode(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_My_Computer"))); + DefaultTreeModel m_model = new DefaultTreeModel(new DefaultMutableTreeNode(Toolkit.i18nText("Fine-Design_Basic_My_Computer"))); this.setModel(m_model); - + this.putClientProperty("JTree.lineStyle", "Angled"); this.addTreeExpansionListener(this); @@ -57,7 +56,7 @@ public class JFileTree extends AbstractFileTree { } public void setRootFile(File rootFile) { - setRootFiles(new File[] { rootFile }); + setRootFiles(new File[]{rootFile}); } public void setRootFiles(File[] rootFiles) { @@ -65,8 +64,8 @@ public class JFileTree extends AbstractFileTree { return; } - DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); - DefaultMutableTreeNode rootTreeNode = (DefaultMutableTreeNode) m_model.getRoot(); + DefaultTreeModel defaultTreeModel = (DefaultTreeModel) this.getModel(); + DefaultMutableTreeNode rootTreeNode = (DefaultMutableTreeNode) defaultTreeModel.getRoot(); rootTreeNode.removeAllChildren(); for (int k = 0; k < rootFiles.length; k++) { @@ -78,7 +77,7 @@ public class JFileTree extends AbstractFileTree { } } // richer:不是LocalEnv根本就不会运行到这儿 - m_model.reload(rootTreeNode); + defaultTreeModel.reload(rootTreeNode); if (rootFiles.length == 1) { File expandFile = rootFiles[0]; @@ -96,22 +95,19 @@ public class JFileTree extends AbstractFileTree { public File getSelectedFile() { TreePath selectedTreePath = this.getSelectionPath(); - if(selectedTreePath == null) { + if (selectedTreePath == null) { return null; } DefaultMutableTreeNode currentTreeNode = this.getMutableTreeNode(selectedTreePath); - StringBuffer fBuf = new StringBuffer(); - while (true) { - // 如果已经到了根节点,直接退出. - if (currentTreeNode == null) { - break; - } + StringBuilder fBuf = new StringBuilder(); + while (currentTreeNode != null) { + // 如果已经到了根节点,直接退出. Object object = currentTreeNode.getUserObject(); if (object instanceof RootFile) { - // 当前文件. - RootFile rootFileNode = (RootFile) object; + // 当前文件. + RootFile rootFileNode = (RootFile) object; return new File(rootFileNode.getFile() + fBuf.toString()); } @@ -128,6 +124,7 @@ public class JFileTree extends AbstractFileTree { /** * 通过文件夹寻找展开路径 + * * @param currentFile 当前文件 */ public void selectFile(File currentFile) { @@ -181,26 +178,25 @@ public class JFileTree extends AbstractFileTree { /** * 列出当前所有的File + * * @param currentTreeNode 当前文件节点 * @return 当前节点下的所有File */ + @Override public FileDirectoryNode[] listFileNodes(DefaultMutableTreeNode currentTreeNode) { - StringBuffer fBuf = new StringBuffer(); - while (true) { - // 如果已经到了根节点,直接退出. - if (currentTreeNode == null) { - break; - } + StringBuilder fBuf = new StringBuilder(); + while (currentTreeNode != null) { + // 如果已经到了根节点,直接退出. Object object = currentTreeNode.getUserObject(); if (object instanceof RootFile) { - RootFile rootFileNode = (RootFile) object; + RootFile rootFileNode = (RootFile) object; // 当前文件. (rootFileNode + fBuf.toString = Path  local地址) File currentFile = new File(rootFileNode.getFile() + fBuf.toString()); // 列出当前文件的所有子文件,要判断下是否是系统保护的文件 能否打开. 打不开的话显示为null File[] files = currentFile.listFiles(); // 如果文件列表为null 或者为File[0] = []返回null - if (files == null ) { - return new FileDirectoryNode[0]; + if (files == null) { + return new FileDirectoryNode[0]; } List fileNodeList = new ArrayList(); for (int k = 0; k < files.length; k++) { @@ -211,8 +207,8 @@ public class JFileTree extends AbstractFileTree { } // 过滤只显示文件夹 并进行 名字简化 if (fileFilter.accept(tmpFile)) { - // newNode 传递 isDirectory属性 并且只显示文件夹名字 - FileDirectoryNode newNode = FileDirectoryNode.createFileDirectoryNode(tmpFile); + // newNode 传递 isDirectory属性 并且只显示文件夹名字 + FileDirectoryNode newNode = FileDirectoryNode.createFileDirectoryNode(tmpFile); fileNodeList.add(newNode); } } @@ -220,78 +216,77 @@ public class JFileTree extends AbstractFileTree { FileDirectoryNode[] fileNodes = new FileDirectoryNode[fileNodeList.size()]; fileNodeList.toArray(fileNodes); // 对文件夹进行排序 - Arrays.sort(fileNodes, new FileNodeComparator()); + Arrays.sort(fileNodes, new FileDirectoryNodeComparator()); return fileNodes; } // 名字进行逐层反序的回加. 例: Doload ==> C:\java\Doload ,返回到文件夹的path,因为有可能是String. 所以加上instanceof if (object instanceof FileDirectoryNode) { - FileDirectoryNode nameNode = (FileDirectoryNode)object; - fBuf.insert(0, nameNode.getName()); - fBuf.insert(0, "/"); + FileDirectoryNode nameNode = (FileDirectoryNode) object; + fBuf.insert(0, nameNode.getName()); + fBuf.insert(0, "/"); } // 逐层返回 currentTreeNode = (DefaultMutableTreeNode) currentTreeNode.getParent(); } return new FileDirectoryNode[0]; } - + /** - * cellRenderer: tree中显示文件的类型图标 + * cellRenderer: tree中显示文件的类型图标 */ - private DefaultTreeCellRenderer fileTreeCellRenderer = new DefaultTreeCellRenderer() { - - public Component getTreeCellRendererComponent(JTree tree, Object value, - boolean selected, boolean expanded, boolean leaf, int row, - boolean hasFocus) { - super.getTreeCellRendererComponent(tree, value, selected, expanded, - leaf, row, hasFocus); - - DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; - StringBuffer fBuf = new StringBuffer(); - while(true) { - if (treeNode == null) { - break; - } - Object userObj = treeNode.getUserObject(); - if (userObj instanceof RootFile) { - RootFile rootFileNode = (RootFile) userObj; - // 当前文件的全部路径. (rootFileNode + fBuf.toString = Path  local地址) - File currentFile = new File(rootFileNode.getFile() + fBuf.toString()); - FileSystemView view = FileSystemView.getFileSystemView(); - // File的全部路径. - // 得到本地tree图标 - Icon tmpIcon = view.getSystemIcon(currentFile); + private DefaultTreeCellRenderer fileTreeCellRenderer = new DefaultTreeCellRenderer() { + + @Override + public Component getTreeCellRendererComponent(JTree tree, Object value, + boolean selected, boolean expanded, boolean leaf, int row, + boolean hasFocus) { + super.getTreeCellRendererComponent(tree, value, selected, expanded, + leaf, row, hasFocus); + + DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) value; + StringBuilder fBuf = new StringBuilder(); + while (treeNode != null) { + Object userObj = treeNode.getUserObject(); + if (userObj instanceof RootFile) { + RootFile rootFileNode = (RootFile) userObj; + // 当前文件的全部路径. (rootFileNode + fBuf.toString = Path  local地址) + File currentFile = new File(rootFileNode.getFile() + fBuf.toString()); + FileSystemView view = FileSystemView.getFileSystemView(); + // File的全部路径. + // 得到本地tree图标 + Icon tmpIcon = view.getSystemIcon(currentFile); if (currentFile.isDirectory() && fBuf.length() > 0) { - tmpIcon=BaseUtils.readIcon("/com/fr/design/images/gui/folder.png"); + tmpIcon = BaseUtils.readIcon("/com/fr/design/images/gui/folder.png"); } this.setIcon(tmpIcon); - this.setName(null); - Font oldFont = this.getFont(); - if(ComparatorUtils.equals(currentFile.getName(), ProjectConstants.WEBINF_NAME)){ - this.setForeground(Color.blue); - this.setFont(new Font(oldFont.getName(),1,oldFont.getSize())); - }else{ - this.setFont(new Font(oldFont.getName(),0,oldFont.getSize())); - } - } - // 名字进行逐层反序的回加. 例: Doload ==> C:\java\Doload - if (userObj instanceof FileDirectoryNode ) { - FileDirectoryNode nameNode = (FileDirectoryNode)userObj; - fBuf.insert(0, nameNode.getName()); - fBuf.insert(0, "/"); - } - // 逐层往上 倒退返回 - treeNode = (DefaultMutableTreeNode) treeNode.getParent(); - } - return this; - } - }; - + this.setName(null); + Font oldFont = this.getFont(); + if (ComparatorUtils.equals(currentFile.getName(), ProjectConstants.WEBINF_NAME)) { + this.setForeground(Color.blue); + this.setFont(new Font(oldFont.getName(), Font.BOLD, oldFont.getSize())); + } else { + this.setFont(new Font(oldFont.getName(), Font.PLAIN, oldFont.getSize())); + } + } + // 名字进行逐层反序的回加. 例: Doload ==> C:\java\Doload + if (userObj instanceof FileDirectoryNode) { + FileDirectoryNode nameNode = (FileDirectoryNode) userObj; + fBuf.insert(0, nameNode.getName()); + fBuf.insert(0, "/"); + } + // 逐层往上 倒退返回 + treeNode = (DefaultMutableTreeNode) treeNode.getParent(); + } + return this; + } + }; + /** - * 对文件夹进行排序 先文件夹 然后各种类型文件 + * 对文件夹进行排序 先文件夹 然后各种类型文件 + * * @author kunsnat */ - public class FileNodeComparator implements Comparator { + public class FileDirectoryNodeComparator implements Comparator { /** * This method should return > 0 if v1 is greater than v2, 0 if * v1 is equal to v2, or < 0 if v1 is less than v2. @@ -302,21 +297,19 @@ public class JFileTree extends AbstractFileTree { * @param v2 comparison value.值2 * @return < 0, 0, or > 0 for v1v2 .值1大于值2返回大于0,相等返回0,小于和大于相反 */ - public int compare(Object v1, Object v2) { - FileDirectoryNode nameNode1 = (FileDirectoryNode) v1; - FileDirectoryNode nameNode2 = (FileDirectoryNode) v2; - - if (nameNode1.isDirectory()) { - if (nameNode2.isDirectory()) { - return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); + @Override + public int compare(FileDirectoryNode v1, FileDirectoryNode v2) { + if (v1.isDirectory()) { + if (v2.isDirectory()) { + return v1.getName().toLowerCase().compareTo(v2.getName().toLowerCase()); } else { return -1; } } else { - if (nameNode2.isDirectory()) { + if (v2.isDirectory()) { return 1; } else { - return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); + return v1.getName().toLowerCase().compareTo(v2.getName().toLowerCase()); } } } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index 0a13dd1bdb..f9b18b7f8d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -217,7 +217,7 @@ public class TemplateFileTree extends EnvFileTree { fileNodes = list.toArray(new FileNode[list.size()]); } - Arrays.sort(fileNodes, new FileNodeComparator()); + Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); return fileNodes; } diff --git a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java index 84724df35e..207c51d24a 100644 --- a/designer-base/src/main/java/com/fr/file/FileNodeFILE.java +++ b/designer-base/src/main/java/com/fr/file/FileNodeFILE.java @@ -211,7 +211,7 @@ public class FileNodeFILE implements FILE { try { FileNode[] nodeArray; nodeArray = listFile(node.getEnvPath()); - Arrays.sort(nodeArray, new FileNodeComparator()); + Arrays.sort(nodeArray, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); return fileNodeArray2FILEArray(nodeArray, envPath); } catch (Exception e) { @@ -240,7 +240,7 @@ public class FileNodeFILE implements FILE { return FRContext.getFileNodes().list(rootFilePath); } } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return new FileNode[0]; } @@ -280,7 +280,7 @@ public class FileNodeFILE implements FILE { try { return FRContext.getCommonOperator().fileLocked(node.getEnvPath()); } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; } } @@ -304,7 +304,7 @@ public class FileNodeFILE implements FILE { try { return WorkContext.getWorkResource().exist(node.getEnvPath()); } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; } } From db2334e1965acb05a8e5641d14fef5406fb02e24 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 25 Oct 2018 10:29:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/gui/itree/filetree/JFileTree.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java index a1a1567c53..69875a97fb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/JFileTree.java @@ -42,8 +42,8 @@ public class JFileTree extends AbstractFileTree { private void init(FileFilter filter) { this.fileFilter = filter; - DefaultTreeModel m_model = new DefaultTreeModel(new DefaultMutableTreeNode(Toolkit.i18nText("Fine-Design_Basic_My_Computer"))); - this.setModel(m_model); + DefaultTreeModel treeModel = new DefaultTreeModel(new DefaultMutableTreeNode(Toolkit.i18nText("Fine-Design_Basic_My_Computer"))); + this.setModel(treeModel); this.putClientProperty("JTree.lineStyle", "Angled");