From 268f71145e869d85075efff5d639e3125e6bb6bc Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 23 Oct 2018 15:42:40 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-11993=20=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=9D=83=E9=99=90=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=A0=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 02/11] =?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 03/11] =?UTF-8?q?REPORT-11886=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=9B=AE=E5=BD=95=E6=A0=91=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=8D=A1=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 04/11] =?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"); From c27ba8498f985d63c1cf43d001b90b105d076360 Mon Sep 17 00:00:00 2001 From: qinghuiliu Date: Sun, 28 Oct 2018 19:36:27 +0800 Subject: [PATCH 05/11] =?UTF-8?q?CHART-2665=20&=20CHART-2886=20=E5=A0=86?= =?UTF-8?q?=E7=A7=AF=E5=92=8C=E5=9D=90=E6=A0=87=E8=BD=B4update=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=80=E4=B8=AA=E6=96=B0=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?conditionattr=20CHART-1882=E7=9B=B4=E6=8E=A5=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=8D=B3=E5=8F=AF=20=E4=B8=8D=E7=94=A8=E8=AE=B0?= =?UTF-8?q?=E4=BD=8Fconditionattr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nChartCustomStackAndAxisConditionPane.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java index efa071305d..712d5bdd2d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java @@ -99,10 +99,12 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane(seriesStackAndAxis.getXAxisNamesArray()); - YAxis = new UIButtonGroup(seriesStackAndAxis.getYAxisNameArray()); + AttrSeriesStackAndAxis seriesStackAndAxis = conditionAttr.getExisted(AttrSeriesStackAndAxis.class); + + if (XAxis == null || YAxis == null) { + XAxis = new UIButtonGroup(seriesStackAndAxis.getXAxisNamesArray()); + YAxis = new UIButtonGroup(seriesStackAndAxis.getYAxisNameArray()); + } doLayoutPane(); XAxis.setSelectedIndex(seriesStackAndAxis.getXAxisIndex()); @@ -129,11 +131,16 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane Date: Sun, 28 Oct 2018 19:48:06 +0800 Subject: [PATCH 06/11] =?UTF-8?q?CHART-2665=20&=20CHART-2886=20=E5=A0=86?= =?UTF-8?q?=E7=A7=AF=E5=92=8C=E5=9D=90=E6=A0=87=E8=BD=B4update=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=80=E4=B8=AA=E6=96=B0=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?conditionattr=20CHART-1882=E7=9B=B4=E6=8E=A5=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=8D=B3=E5=8F=AF=20=E4=B8=8D=E7=94=A8=E8=AE=B0?= =?UTF-8?q?=E4=BD=8Fconditionattr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/column/VanChartCustomStackAndAxisConditionPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java index 712d5bdd2d..ceb9bf4807 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java @@ -34,8 +34,6 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane isStacked; protected UIButtonGroup isPercentStacked; - private ConditionAttr conditionAttr; - private LiteConditionPane liteConditionPane; public VanChartCustomStackAndAxisConditionPane() { From 59b4b4073e7eeb397a02a43a6730fcc398eef54c Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 29 Oct 2018 17:58:23 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=B6=85=E9=93=BE=E6=94=AF=E6=8C=81=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=92=8C=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/AbstractHyperNorthPane.java | 28 +- .../hyperlink/ReporletHyperNorthPane.java | 184 ------- .../hyperlink/ReportletHyperNorthPane.java | 510 ++++++++++++++++++ .../hyperlink/ReportletHyperlinkPane.java | 47 +- 4 files changed, 563 insertions(+), 206 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java create mode 100644 designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java index cd78c17559..22c12e296b 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -6,11 +6,14 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; - import com.fr.js.Hyperlink; -import javax.swing.*; -import java.awt.*; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -21,11 +24,18 @@ public abstract class AbstractHyperNorthPane extends BasicB public static final int DEFAULT_H_VALUE = 400; public static final int DEFAULT_V_VALUE = 600; - private JPanel headerPane; - private UIComboBox targetFrameComboBox; - - private UINumberField heightTextFiled; - private UINumberField widthTextFiled; + /** + * 链接打开方式对话框 + */ + UIComboBox targetFrameComboBox; + /** + * 对话框高度输入框 + */ + UINumberField heightTextFiled; + /** + * 对话框宽度输入框 + */ + UINumberField widthTextFiled; public AbstractHyperNorthPane() { @@ -35,7 +45,7 @@ public abstract class AbstractHyperNorthPane extends BasicB protected void initComponents() { this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - headerPane = this.setHeaderPanel(); + JPanel headerPane = this.setHeaderPanel(); this.add(headerPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); targetFrameComboBox = new UIComboBox(getTargetFrames()); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java deleted file mode 100644 index d35c70a822..0000000000 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.fr.design.hyperlink; - -import com.fr.design.actions.UpdateAction; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.itree.filetree.ReportletPane; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; - -import com.fr.js.ReportletHyperlink; -import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. - * - * @author kunsnat - */ -public class ReporletHyperNorthPane extends AbstractHyperNorthPane { - private UITextField itemNameTextField; - private boolean needRenamePane = false; - private UITextField reportPathTextField; - private UICheckBox showParameterInterface; - private UIButton browserButton; - - // richer:参数传递方式 - private UIComboBox postComboBox; - - public ReporletHyperNorthPane(boolean needRenamePane) { - this.needRenamePane = needRenamePane; - this.inits(); - } - - public ReporletHyperNorthPane() { - this.inits(); - } - - /** - * 初始化组件 - */ - public void inits() { - super.initComponents(); - } - - @Override - protected JPanel setHeaderPanel() { - JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; - double[] columnSize = {p, TableLayout.FILL}; - // Reportlet. - JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - reportPathTextField = new UITextField(20); - reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); - - browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); - reportletNamePane.add(browserButton, BorderLayout.EAST); - browserButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - final ReportletPane reportletPane = new ReportletPane(); - reportletPane.setSelectedReportletPath(reportPathTextField.getText()); - BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ReporletHyperNorthPane.this)); - - reportletDialog.addDialogActionListener(new DialogActionAdapter() { - public void doOk() { - reportPathTextField.setText(reportletPane.getSelectedReportletPath()); - } - }); - reportletDialog.setVisible(true); - } - }); - - Component[][] components; - if (!this.needRenamePane) { - components = new Component[][]{ - {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane}, - }; - } else { - itemNameTextField = new UITextField(); - components = new Component[][]{ - {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}, - {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane}, - }; - } - JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - headerPane.add(northPane, BorderLayout.NORTH); - return headerPane; - } - - @Override - protected String title4PopupWindow() { - return "reportlet"; - } - - @Override - protected void populateSubHyperlinkBean(ReportletHyperlink link) { - if (itemNameTextField != null) { - this.itemNameTextField.setText(link.getItemName()); - } - this.reportPathTextField.setText(link.getReportletPath()); - this.showParameterInterface.setSelected(link.isShowParameterInterface()); - this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); - } - - @Override - protected ReportletHyperlink updateSubHyperlinkBean() { - ReportletHyperlink reportletHyperlink = new ReportletHyperlink(); - updateSubHyperlinkBean(reportletHyperlink); - - return reportletHyperlink; - } - - @Override - protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { - if (itemNameTextField != null) { - reportletHyperlink.setItemName(this.itemNameTextField.getText()); - } - reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); - reportletHyperlink.setShowParameterInterface(this.showParameterInterface.isSelected()); - reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1 ? true : false); - } - - public String getReportletName() { - return StringUtils.isBlank(this.reportPathTextField.getText()) ? StringUtils.EMPTY : this.reportPathTextField.getText().substring(1); - } - - /** - * 获取按钮焦点 - */ - public void requestButtonFocus() { - this.browserButton.requestFocus(); - JPopupMenu popup = new JPopupMenu(); - FakeTipAction tip = new FakeTipAction(); - tip.setEnabled(false); - popup.add(tip); - GUICoreUtils.showPopupCloseMenu(popup, this.browserButton); - } - - private class FakeTipAction extends UpdateAction { - public FakeTipAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Select")); - } - - public void actionPerformed(ActionEvent e) { - //do nothing - } - } - - @Override - protected JPanel setFootPanel() { - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; - double[] columnSize = {p, TableLayout.FILL}; - showParameterInterface = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); - JPanel showParameterPanel = new JPanel(); - showParameterPanel.add(new UILabel()); - showParameterPanel.add(showParameterInterface); - - postComboBox = new UIComboBox(new String[]{"GET", "POST"}); - JPanel postPanel = new JPanel(); - postPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type"))); - postPanel.add(postComboBox); - Component[][] components = {{postPanel}, - {showParameterPanel}, - {new UILabel(" ")} - }; - - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java new file mode 100644 index 0000000000..bd1b3a4d79 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -0,0 +1,510 @@ +package com.fr.design.hyperlink; + +import com.fr.base.BaseFormula; +import com.fr.design.actions.UpdateAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.event.UIObserverListener; +import com.fr.design.formula.FormulaFactory; +import com.fr.design.formula.UIFormula; +import com.fr.design.formula.VariableResolver; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itree.filetree.ReportletPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; +import com.fr.js.ReportletHyperlink; +import com.fr.js.ReportletHyperlinkDialogAttr; +import com.fr.stable.FormulaProvider; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + +/** + * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. + * + * @author kunsnat + */ +public class ReportletHyperNorthPane extends AbstractHyperNorthPane { + /** + * item name text filed + */ + private UITextField itemNameTextField; + /** + * 是否展示item name + */ + private boolean needRenamePane = false; + /** + * 参数路径输入框 + */ + private UITextField reportPathTextField; + /** + * 是否展示参数面板勾选框 + */ + private UICheckBox showParameterInterface; + /** + * 选择文件按钮 + */ + private UIButton browserButton; + + /** + * 参数传递方式下拉选择框 + */ + private UIComboBox postComboBox; + /** + * 对话框标题输入框 + */ + private JFormulaField titleFiled; + + + /** + * 对话框居中按钮 + */ + private UIRadioButton center; + /** + * 对话框位置自定义按钮 + */ + private UIRadioButton custom; + /** + * 距左 + */ + private UINumberField leftLocation; + /** + * 距上 + */ + private UINumberField topLocation; + + + public ReportletHyperNorthPane(boolean needRenamePane) { + this.needRenamePane = needRenamePane; + } + + public ReportletHyperNorthPane() { + } + + /** + * 初始化面板 + */ + @Override + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + final List dialogComponents = new ArrayList<>(); + final List othersComponents = new ArrayList<>(); + + initRenamePanel(dialogComponents, othersComponents); + initHeaderPanel(dialogComponents, othersComponents); + initTargetComboBoxPanel(dialogComponents, othersComponents); + + initTitlePanel(dialogComponents); + initDialogSizePanel(dialogComponents); + initDialogLocationPanel(dialogComponents); + + initFooterPanel(dialogComponents, othersComponents); + + initPlaceHolder(othersComponents); + + bindListener(dialogComponents, othersComponents); + + // 创建内容面板 + JPanel content = TableLayoutHelper.createTableLayoutPane(dialogComponents.toArray(new Component[dialogComponents.size()][]), TableLayoutHelper.FILL_LASTCOL_AND_ROW); + this.add(content, BorderLayout.CENTER); + } + + + /** + * 生成最上方的配置面板 + * + * @return JPanel + */ + @Override + protected JPanel setHeaderPanel() { + + JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + // 路径输入框 + reportPathTextField = new UITextField(20); + reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); + + // 选择路径按钮 + browserButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Select")); + browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); + reportletNamePane.add(browserButton, BorderLayout.EAST); + browserButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + final ReportletPane reportletPane = new ReportletPane(); + reportletPane.setSelectedReportletPath(reportPathTextField.getText()); + BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ReportletHyperNorthPane.this)); + + reportletDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + reportPathTextField.setText(reportletPane.getSelectedReportletPath()); + } + }); + reportletDialog.setVisible(true); + } + }); + return reportletNamePane; + } + + @Override + protected String title4PopupWindow() { + return "reportlet"; + } + + @Override + protected void populateSubHyperlinkBean(ReportletHyperlink link) { + if (itemNameTextField != null) { + this.itemNameTextField.setText(link.getItemName()); + } + this.reportPathTextField.setText(link.getReportletPath()); + this.showParameterInterface.setSelected(link.isShowParameterInterface()); + this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); + + ReportletHyperlinkDialogAttr attr = link.getAttr(); + titleFiled.setFormulaText(StringUtils.EMPTY); + leftLocation.setText(StringUtils.EMPTY); + topLocation.setText(StringUtils.EMPTY); + center.setSelected(true); + if (attr != null) { + FormulaProvider title = attr.getTitleFormula(); + String titleContent = title == null ? StringUtils.EMPTY : title.getPureContent(); + titleFiled.setFormulaText(titleContent); + boolean isCenter = attr.isCenter(); + if (!isCenter) { + int left = attr.getLeft(), top = attr.getTop(); + leftLocation.setText(Integer.toString(left)); + topLocation.setText(Integer.toString(top)); + } + center.setSelected(isCenter); + custom.setSelected(!isCenter); + } + } + + @Override + protected ReportletHyperlink updateSubHyperlinkBean() { + ReportletHyperlink reportletHyperlink = new ReportletHyperlink(); + updateSubHyperlinkBean(reportletHyperlink); + return reportletHyperlink; + } + + @Override + protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { + if (itemNameTextField != null) { + reportletHyperlink.setItemName(this.itemNameTextField.getText()); + } + reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); + reportletHyperlink.setShowParameterInterface(this.showParameterInterface.isSelected()); + reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1); + + ReportletHyperlinkDialogAttr attr = new ReportletHyperlinkDialogAttr(); + attr.setTitleFormula(BaseFormula.createFormulaBuilder().build(titleFiled.getFormulaText())); + attr.setCenter(center.isSelected()); + if (!attr.isCenter()) { + attr.setLeft((int) leftLocation.getValue()); + attr.setTop((int) topLocation.getValue()); + } + reportletHyperlink.setAttr(attr); + + } + + public String getReportletName() { + String text = this.reportPathTextField.getText(); + return StringUtils.isBlank(text) ? StringUtils.EMPTY : text.substring(1); + } + + /** + * 获取按钮焦点 + */ + public void requestButtonFocus() { + this.browserButton.requestFocus(); + JPopupMenu popup = new JPopupMenu(); + FakeTipAction tip = new FakeTipAction(); + tip.setEnabled(false); + popup.add(tip); + GUICoreUtils.showPopupCloseMenu(popup, this.browserButton); + } + + private class FakeTipAction extends UpdateAction { + public FakeTipAction() { + this.setName(Toolkit.i18nText("Fine-Design_Basic_Template_Select")); + } + + @Override + public void actionPerformed(ActionEvent e) { + // do nothing + } + } + + /** + * 底部面板,参数传递方式 + * + * @return JPanel + */ + @Override + protected JPanel setFootPanel() { + JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + + // 参数传递方式下拉框 + postComboBox = new UIComboBox(new String[]{"GET", "POST"}); + postComboBox.setPreferredSize(new Dimension(60, 20)); + postComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + content.add(postComboBox); + + + showParameterInterface = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); + + showParameterInterface.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + content.add(showParameterInterface); + return content; + } + + private void bindListener(final List dialogComponents, final List othersComponents) { + targetFrameComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + boolean show = DIALOG == targetFrameComboBox.getSelectedIndex(); + JPanel content; + List cs; + if (show) { + cs = dialogComponents; + } else { + cs = othersComponents; + } + ReportletHyperNorthPane.this.removeAll(); + content = TableLayoutHelper.createTableLayoutPane(cs.toArray(new Component[cs.size()][]), TableLayoutHelper.FILL_LASTCOL_AND_ROW); + ReportletHyperNorthPane.this.add(content, BorderLayout.CENTER); + ReportletHyperNorthPane.this.revalidate(); + ReportletHyperNorthPane.this.repaint(); + } + }); + } + + private void initPlaceHolder(List othersComponents) { + JPanel empty1 = new JPanel(); + empty1.setPreferredSize(new Dimension(20, 20)); + JPanel empty2 = new JPanel(); + empty2.setPreferredSize(new Dimension(20, 20)); + JPanel empty3 = new JPanel(); + empty3.setPreferredSize(new Dimension(20, 23)); + + othersComponents.add(new Component[]{empty1, new JPanel()}); + othersComponents.add(new Component[]{empty2, new JPanel()}); + othersComponents.add(new Component[]{empty3, new JPanel()}); + } + + private void initRenamePanel(List dialogComponents, List othersComponents) { + // 是否有重命名属性 + if (this.needRenamePane) { + itemNameTextField = new UITextField(); + Component[] renameComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}; + dialogComponents.add(renameComponents); + othersComponents.add(renameComponents); + } + } + + private void initHeaderPanel(List dialogComponents, List othersComponents) { + //最上方位置的面板 + JPanel headerPane = this.setHeaderPanel(); + Component[] headerComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), headerPane}; + dialogComponents.add(headerComponents); + othersComponents.add(headerComponents); + } + + private void initTargetComboBoxPanel(List dialogComponents, List othersComponents) { + // 链接打开于 + targetFrameComboBox = new UIComboBox(getTargetFrames()); + targetFrameComboBox.setEditable(true); + targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); + JPanel targetFramePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + targetFramePanel.add(targetFrameComboBox); + Component[] targetComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Link_Opened_In") + ":"), targetFramePanel}; + dialogComponents.add(targetComponents); + othersComponents.add(targetComponents); + } + + private void initTitlePanel(List dialogComponents) { + // 对话框标题 + titleFiled = new JFormulaField(15); + final JPanel titlePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + titlePanel.add(titleFiled); + Component[] titleComponents = new Component[]{new UILabel(Toolkit.i18nText("对话框标题") + ":"), titlePanel}; + dialogComponents.add(titleComponents); + } + + private void initDialogSizePanel(List dialogComponents) {// 对话框大小 + final JPanel sizeJPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + UILabel heightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Height") + ":"); + heightLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); + sizeJPanel.add(heightLabel); + heightTextFiled = new UINumberField(); + heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); + heightTextFiled.setPreferredSize(new Dimension(40, 20)); + sizeJPanel.add(heightTextFiled); + UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":"); + widthLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + sizeJPanel.add(widthLabel); + widthTextFiled = new UINumberField(); + widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); + widthTextFiled.setPreferredSize(new Dimension(40, 20)); + sizeJPanel.add(widthTextFiled); + sizeJPanel.setVisible(true); + dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("对话框大小") + ":"), sizeJPanel}); + } + + private void initDialogLocationPanel(List dialogComponents) { + // 显示位置 + final JPanel locationPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + // 居中 + center = new UIRadioButton(Toolkit.i18nText("居中")); + // 自定义 + custom = new UIRadioButton(Toolkit.i18nText("自定义")); + + custom.setBorder(BorderFactory.createEmptyBorder(4, 20, 4, 5)); + ButtonGroup group = new ButtonGroup(); + group.setSelected(center.getModel(), true); + group.add(center); + group.add(custom); + locationPanel.add(center); + locationPanel.add(custom); + + // 位置 距左 + final UILabel leftLabel = new UILabel(Toolkit.i18nText("距左")); + leftLabel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 10)); + leftLocation = new UINumberField(); + leftLocation.setPreferredSize(new Dimension(40, 20)); + // 位置 距上 + final UILabel topLabel = new UILabel(Toolkit.i18nText("距上")); + topLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + topLocation = new UINumberField(); + topLocation.setPreferredSize(new Dimension(40, 20)); + + locationPanel.add(leftLabel); + locationPanel.add(leftLocation); + locationPanel.add(topLabel); + locationPanel.add(topLocation); + leftLabel.setVisible(false); + leftLocation.setVisible(false); + topLabel.setVisible(false); + topLocation.setVisible(false); + ChangeListener actionListener = new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + boolean visible = custom.isSelected(); + leftLabel.setVisible(visible); + leftLocation.setVisible(visible); + topLabel.setVisible(visible); + topLocation.setVisible(visible); + } + }; + // 默认居中 + center.setSelected(true); + center.addChangeListener(actionListener); + custom.addChangeListener(actionListener); + + dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("显示位置") + ":"), locationPanel}); + } + + private void initFooterPanel(List dialogComponents, List othersComponents) { + // 最下方的配置面板 + // 参数传递方式 + Component[] footerComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type") + ":"), this.setFootPanel()}; + dialogComponents.add(footerComponents); + othersComponents.add(footerComponents); + } + + /** + * 公式输入框 + */ + public class JFormulaField extends JPanel { + private UITextField formulaTextField; + + public JFormulaField(int columns) { + + formulaTextField = new UITextField(columns); + JPanel textFieldPane = new JPanel(new BorderLayout()); + textFieldPane.add(formulaTextField, BorderLayout.CENTER); + textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); + UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); + formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); + formulaButton.setPreferredSize(new Dimension(24, formulaTextField.getPreferredSize().height)); + formulaButton.addActionListener(formulaButtonActionListener); + + JPanel pane = new JPanel(new BorderLayout()); + pane.add(textFieldPane, BorderLayout.CENTER); + pane.add(formulaButton, BorderLayout.EAST); + this.setLayout(new BorderLayout()); + this.add(pane, BorderLayout.NORTH); + } + + public void setFormulaText(String formulaContent) { + this.formulaTextField.setText(formulaContent); + } + + public String getFormulaText() { + + String text = formulaTextField.getText(); + if (text == null) { + text = StringUtils.EMPTY; + } + return text; + } + + /** + * 添加事件监听器 + * + * @param listener 公式文本输入框改动事件监听器 + */ + public void addListener(UIObserverListener listener) { + this.formulaTextField.registerChangeListener(listener); + } + + /** + * 取消事件监听器 + */ + public void removeListener() { + this.formulaTextField.registerChangeListener(null); + } + + private ActionListener formulaButtonActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); + valueFormula.setContent(getFormulaText()); + final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); + formulaPane.populate(valueFormula, VariableResolver.DEFAULT); + formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(ReportletHyperNorthPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + BaseFormula valueFormula = formulaPane.update(); + setFormulaText(valueFormula.getContent()); + } + }).setVisible(true); + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java index e50360c197..532fe467c3 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -6,23 +6,30 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterReader; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.js.ReportletHyperlink; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JOptionPane; +import java.awt.BorderLayout; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.List; public class ReportletHyperlinkPane extends AbstractHyperLinkPane { - private ReporletHyperNorthPane northPane; + /** + * 超链配置面板 + */ + private ReportletHyperNorthPane northPane; + /** + * 是否继承参数勾选框 + */ private UICheckBox extendParametersCheckBox; public ReportletHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { @@ -38,22 +45,29 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane Date: Tue, 30 Oct 2018 00:35:37 +0800 Subject: [PATCH 08/11] =?UTF-8?q?REPORT-11520=20=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/hyperlink/ReportletHyperNorthPane.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index bd1b3a4d79..7f36d5a2c8 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -352,7 +352,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents) { // 显示位置 final JPanel locationPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); // 居中 - center = new UIRadioButton(Toolkit.i18nText("居中")); + center = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Center")); // 自定义 - custom = new UIRadioButton(Toolkit.i18nText("自定义")); + custom = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Custom")); custom.setBorder(BorderFactory.createEmptyBorder(4, 20, 4, 5)); ButtonGroup group = new ButtonGroup(); @@ -393,12 +393,12 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents, List othersComponents) { From 5918d7186aaeb1f5c3786646ae921116c08a2a7b Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 30 Oct 2018 09:33:46 +0800 Subject: [PATCH 09/11] ff --- .../fr/design/hyperlink/AbstractHyperNorthPane.java | 6 +++--- .../fr/design/hyperlink/ReportletHyperNorthPane.java | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java index 22c12e296b..42f13ceed5 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -27,15 +27,15 @@ public abstract class AbstractHyperNorthPane extends BasicB /** * 链接打开方式对话框 */ - UIComboBox targetFrameComboBox; + private UIComboBox targetFrameComboBox; /** * 对话框高度输入框 */ - UINumberField heightTextFiled; + private UINumberField heightTextFiled; /** * 对话框宽度输入框 */ - UINumberField widthTextFiled; + private UINumberField widthTextFiled; public AbstractHyperNorthPane() { diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index 7f36d5a2c8..57fcfe25d9 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -284,6 +284,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents, final List othersComponents) { + final UIComboBox targetFrameComboBox = this.getTargetFrameComboBox(); targetFrameComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -337,7 +338,8 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents, List othersComponents) { // 链接打开于 - targetFrameComboBox = new UIComboBox(getTargetFrames()); + UIComboBox targetFrameComboBox = new UIComboBox(getTargetFrames()); + this.setTargetFrameComboBox(targetFrameComboBox); targetFrameComboBox.setEditable(true); targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); JPanel targetFramePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); @@ -361,17 +363,19 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane Date: Tue, 30 Oct 2018 16:38:13 +0800 Subject: [PATCH 10/11] =?UTF-8?q?CHART-3275=20=E5=AE=89=E8=A3=85=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E5=9B=BE=E8=A1=A8=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 26 +++++++++++++++++++ .../design/mainframe/FormParaWidgetPane.java | 7 +++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index a01fc0ce58..154f4c0976 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -37,7 +37,9 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.ChartEditor; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; @@ -57,8 +59,13 @@ import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; +import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; +import com.fr.plugin.injectable.SpecialLevel; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.solution.closeable.CloseableContainedMap; import com.fr.stable.ArrayUtils; import com.fr.stable.AssistUtils; @@ -119,6 +126,25 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr readDefault(); readVanChart(); PluginModule.registerAgent(PluginModule.ExtraChartDesign, classManager); + + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + synchronized (ChartTypeInterfaceManager.class) { + //因为是CloseableContainedMap,所以不能在mount那边处理。 + DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); + } + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraChartDesign, SpecialLevel.IndependentChartUIProvider.getTagName()); + } + }); } public static WidgetOption[] initWidgetOption() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index b78ecbf74b..2fb6950120 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -22,9 +22,9 @@ import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; - import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.injectable.SpecialLevel; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; @@ -47,6 +47,8 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import static com.fr.plugin.injectable.SpecialLevel.IndependentChartUIProvider; + /** * @author null */ @@ -98,7 +100,8 @@ public class FormParaWidgetPane extends JPanel { @Override public boolean accept(PluginContext context) { - return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG); + return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG) + || context.contain(PluginModule.ExtraChartDesign, SpecialLevel.IndependentChartUIProvider.getTagName()); } }); } From ef1340db0e992817d33c35afe812089e561a41ce Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 30 Oct 2018 16:40:10 +0800 Subject: [PATCH 11/11] update --- .../main/java/com/fr/design/mainframe/FormParaWidgetPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index 2fb6950120..1958056b35 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -47,8 +47,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import static com.fr.plugin.injectable.SpecialLevel.IndependentChartUIProvider; - /** * @author null */