diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 947e17106b..85c75e3292 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -54,6 +54,7 @@ import java.util.ArrayList; import java.util.List; public class DBTableDataPane extends AbstractTableDataPane { + private static final int BOTTOM = 6; private static final String PREVIEW_BUTTON = Inter.getLocText("FR-Designer_Preview"); private static final String REFRESH_BUTTON = Inter.getLocText("FR-Designer_Refresh"); private ConnectionTableProcedurePane connectionTableProcedurePane; @@ -66,29 +67,11 @@ public class DBTableDataPane extends AbstractTableDataPane { private String pageQuery = null; private DBTableData dbTableData; - - - public DBTableDataPane() { + private void init() { this.setLayout(new BorderLayout(4, 4)); - Box box = new Box(BoxLayout.Y_AXIS); - sqlTextPane = new SQLEditPane(); sqlTextPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); - JPanel northPane = new JPanel(new BorderLayout(4, 4)); - JToolBar editToolBar = createToolBar(); - northPane.add(editToolBar, BorderLayout.CENTER); - northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); - - RTextScrollPane sqlTextScrollPane = new RTextScrollPane(sqlTextPane); - sqlTextScrollPane.setLineNumbersEnabled(true); - sqlTextScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); - sqlTextScrollPane.setPreferredSize(new Dimension(680, 600)); - - JPanel paraMeanPane = new JPanel(new BorderLayout()); - paraMeanPane.setPreferredSize(new Dimension(680, 90)); - UILabel paraMean = new UILabel(Inter.getLocText("FR-Designer-Datasource-Param_DES")); - paraMeanPane.add(paraMean, BorderLayout.CENTER); ParameterTableModel model = new ParameterTableModel() { @Override @@ -98,14 +81,6 @@ public class DBTableDataPane extends AbstractTableDataPane { }; editorPane = new UITableEditorPane(model); - box.add(northPane); - box.add(sqlTextScrollPane); - box.add(paraMeanPane); - box.add(editorPane); - - JPanel sqlSplitPane = new JPanel(new BorderLayout(4, 4)); - sqlSplitPane.add(box, BorderLayout.CENTER); - // 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table connectionTableProcedurePane = new ConnectionTableProcedurePane() { @Override @@ -131,7 +106,7 @@ public class DBTableDataPane extends AbstractTableDataPane { }); sqlTextPane.addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { - + // unsupport } public void focusLost(FocusEvent e) { @@ -140,6 +115,38 @@ public class DBTableDataPane extends AbstractTableDataPane { } } }); + } + + + private void initMainSplitPane() { + Box box = new Box(BoxLayout.Y_AXIS); + + + JPanel northPane = new JPanel(new BorderLayout(4, 4)); + JToolBar editToolBar = createToolBar(); + northPane.add(editToolBar, BorderLayout.CENTER); + northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, BOTTOM, 0)); + + RTextScrollPane sqlTextScrollPane = new RTextScrollPane(sqlTextPane); + sqlTextScrollPane.setLineNumbersEnabled(true); + sqlTextScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); + sqlTextScrollPane.setPreferredSize(new Dimension(680, 600)); + + JPanel paraMeanPane = new JPanel(new BorderLayout()); + paraMeanPane.setPreferredSize(new Dimension(680, 90)); + UILabel paraMean = new UILabel(Inter.getLocText("FR-Designer-Datasource-Param_DES")); + paraMeanPane.add(paraMean, BorderLayout.CENTER); + + + box.add(northPane); + box.add(sqlTextScrollPane); + box.add(paraMeanPane); + box.add(editorPane); + + JPanel sqlSplitPane = new JPanel(new BorderLayout(4, 4)); + sqlSplitPane.add(box, BorderLayout.CENTER); + + box.setMinimumSize(new Dimension(310, 400)); // 使用SplitPane JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); @@ -148,6 +155,12 @@ public class DBTableDataPane extends AbstractTableDataPane { this.add(mainSplitPane, BorderLayout.CENTER); } + public DBTableDataPane() { + init(); + initMainSplitPane(); + } + + private boolean isPreviewOrRefreshButton (FocusEvent e) { if (e.getOppositeComponent() != null) { @@ -184,6 +197,7 @@ public class DBTableDataPane extends AbstractTableDataPane { toolBarDef.addShortCut(dbTableDataMenuHandler.createQueryAction()); } isShareCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Share_DBTableData")); + isShareCheckBox.setBackground(Color.WHITE); maxPanel = new MaxMemRowCountPanel(); maxPanel.setBorder(null); UIToolbar editToolBar = ToolBarDef.createJToolBar(); @@ -296,6 +310,7 @@ public class DBTableDataPane extends AbstractTableDataPane { @Override public void checkEnabled() { + // unsupport } } diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index db98a6928b..baeb4798ca 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -90,7 +90,6 @@ public class FileTableDataPane extends AbstractTableDataPane { private Parameter[] params; private JPanel filePath; private XMLNodeTreePane nodeTreePane; - private JPanel textSetPanel; private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题 private UIRadioButton tableDismemberRadioButton;// 制表符 @@ -151,8 +150,8 @@ public class FileTableDataPane extends AbstractTableDataPane { southPanel.add(setPanel, BorderLayout.CENTER); setPanel.setPreferredSize(new Dimension(setPanelWidth, 460)); setPanel.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer_Set"))); - textSetPanel = textSetPanel(width,height); - setPanel.add(textSetPanel, BorderLayout.NORTH); + JPanel controlPane = textSetPanel(width,height); + setPanel.add(controlPane, BorderLayout.NORTH); fileTypeComboBox.addActionListener(getFileTypeListener(setPanel,width,height)); this.add(northPanel, BorderLayout.NORTH); @@ -465,11 +464,12 @@ public class FileTableDataPane extends AbstractTableDataPane { } else if (fileTypeComboBox.getSelectedIndex() == EXCEL) { setPanel.add(excelSetPanel(width,height), BorderLayout.NORTH); } else { - setPanel.add(textSetPanel, BorderLayout.NORTH); + setPanel.add(textSetPanel(width,height), BorderLayout.NORTH); } String tipContent = Inter.getLocText("FR-Designer-Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "
" + "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp
" + "  "; tips.setText(tipContent); + setPanel.revalidate(); } }; diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index 14b70aa87e..438deb9145 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -5,6 +5,7 @@ import com.fr.base.FRContext; import com.fr.design.RestartHelper; import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.dialog.UIDialog; +import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.extra.exe.callback.JSCallback; import com.fr.design.gui.ilable.UILabel; import com.fr.general.FRLogger; @@ -17,6 +18,7 @@ import com.fr.plugin.context.PluginMarker; import com.fr.plugin.manage.PluginManager; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; +import javafx.concurrent.Task; import javafx.scene.web.WebEngine; import javafx.stage.FileChooser; import javafx.stage.Stage; @@ -491,6 +493,18 @@ public class PluginWebBridge { this.uiLabel = uiLabel; } + /** + * 设计器端的用户登录 + * + * @param username 用户名 + * @param password 密码 + * @return 登录信息标志 + */ + public void defaultLogin(String username, String password, final JSObject callback) { + Task task = new PluginTask<>(webEngine, callback, new PluginLoginExecutor(username, password)); + new Thread(task).start(); + } + /** * 弹出QQ授权页面 */ diff --git a/designer_base/src/com/fr/design/images/data/field.png b/designer_base/src/com/fr/design/images/data/field.png index 080cc10778..3ce09b6895 100644 Binary files a/designer_base/src/com/fr/design/images/data/field.png and b/designer_base/src/com/fr/design/images/data/field.png differ diff --git a/designer_base/src/com/fr/design/images/m_format/cell.png b/designer_base/src/com/fr/design/images/m_format/cell.png index 2f42e1e4ca..e000c81b7c 100644 Binary files a/designer_base/src/com/fr/design/images/m_format/cell.png and b/designer_base/src/com/fr/design/images/m_format/cell.png differ diff --git a/designer_base/src/com/fr/design/javascript/beautify/BeautifyOption.java b/designer_base/src/com/fr/design/javascript/beautify/BeautifyOption.java index 227197a4bc..a1fcc9dc24 100644 --- a/designer_base/src/com/fr/design/javascript/beautify/BeautifyOption.java +++ b/designer_base/src/com/fr/design/javascript/beautify/BeautifyOption.java @@ -35,21 +35,37 @@ public class BeautifyOption { } + /** + * 缩进个数,默认为4 + * @param indentSize 缩进个数 + */ public BeautifyOption indentSize(int indentSize) { this.indentSize = indentSize; return this; } + /** + * 缩进使用的字符,默认为一个空格 + * @param indentChar 缩进字符 + */ public BeautifyOption indentChar(String indentChar) { this.indentChar = indentChar; return this; } + /** + * 是否使用tab来作为缩进字符,默认为false + * @param indentWithTabs 使用tab作为缩进字符则返回true,否则返回false + */ public BeautifyOption indentWithTabs(boolean indentWithTabs) { this.indentWithTabs = indentWithTabs; return this; } + /** + * 换行符,默认为"\n" + * @param eol 换行符 + */ public BeautifyOption eol(String eol) { this.eol = eol; return this;