Browse Source

Merge branch 'release/9.0' of http://cloud.finedevelop.com:2015/scm/~plough/design into release/9.0

master
plough 7 years ago
parent
commit
5a458a71d7
  1. 71
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  2. 8
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  3. 14
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  4. BIN
      designer_base/src/com/fr/design/images/data/field.png
  5. BIN
      designer_base/src/com/fr/design/images/m_format/cell.png
  6. 16
      designer_base/src/com/fr/design/javascript/beautify/BeautifyOption.java

71
designer_base/src/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -54,6 +54,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class DBTableDataPane extends AbstractTableDataPane<DBTableData> { public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private static final int BOTTOM = 6;
private static final String PREVIEW_BUTTON = Inter.getLocText("FR-Designer_Preview"); private static final String PREVIEW_BUTTON = Inter.getLocText("FR-Designer_Preview");
private static final String REFRESH_BUTTON = Inter.getLocText("FR-Designer_Refresh"); private static final String REFRESH_BUTTON = Inter.getLocText("FR-Designer_Refresh");
private ConnectionTableProcedurePane connectionTableProcedurePane; private ConnectionTableProcedurePane connectionTableProcedurePane;
@ -66,29 +67,11 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
private String pageQuery = null; private String pageQuery = null;
private DBTableData dbTableData; private DBTableData dbTableData;
private void init() {
public DBTableDataPane() {
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout(4, 4));
Box box = new Box(BoxLayout.Y_AXIS);
sqlTextPane = new SQLEditPane(); sqlTextPane = new SQLEditPane();
sqlTextPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); 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() { ParameterTableModel model = new ParameterTableModel() {
@Override @Override
@ -98,14 +81,6 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}; };
editorPane = new UITableEditorPane<ParameterProvider>(model); editorPane = new UITableEditorPane<ParameterProvider>(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 // 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
connectionTableProcedurePane = new ConnectionTableProcedurePane() { connectionTableProcedurePane = new ConnectionTableProcedurePane() {
@Override @Override
@ -131,7 +106,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}); });
sqlTextPane.addFocusListener(new FocusListener() { sqlTextPane.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) { public void focusGained(FocusEvent e) {
// unsupport
} }
public void focusLost(FocusEvent e) { public void focusLost(FocusEvent e) {
@ -140,6 +115,38 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
} }
} }
}); });
}
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)); box.setMinimumSize(new Dimension(310, 400));
// 使用SplitPane // 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);
@ -148,6 +155,12 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
this.add(mainSplitPane, BorderLayout.CENTER); this.add(mainSplitPane, BorderLayout.CENTER);
} }
public DBTableDataPane() {
init();
initMainSplitPane();
}
private boolean isPreviewOrRefreshButton (FocusEvent e) { private boolean isPreviewOrRefreshButton (FocusEvent e) {
if (e.getOppositeComponent() != null) { if (e.getOppositeComponent() != null) {
@ -184,6 +197,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
toolBarDef.addShortCut(dbTableDataMenuHandler.createQueryAction()); toolBarDef.addShortCut(dbTableDataMenuHandler.createQueryAction());
} }
isShareCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Share_DBTableData")); isShareCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Share_DBTableData"));
isShareCheckBox.setBackground(Color.WHITE);
maxPanel = new MaxMemRowCountPanel(); maxPanel = new MaxMemRowCountPanel();
maxPanel.setBorder(null); maxPanel.setBorder(null);
UIToolbar editToolBar = ToolBarDef.createJToolBar(); UIToolbar editToolBar = ToolBarDef.createJToolBar();
@ -296,6 +310,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
@Override @Override
public void checkEnabled() { public void checkEnabled() {
// unsupport
} }
} }

8
designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -90,7 +90,6 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private Parameter[] params; private Parameter[] params;
private JPanel filePath; private JPanel filePath;
private XMLNodeTreePane nodeTreePane; private XMLNodeTreePane nodeTreePane;
private JPanel textSetPanel;
private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题 private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题
private UIRadioButton tableDismemberRadioButton;// 制表符 private UIRadioButton tableDismemberRadioButton;// 制表符
@ -151,8 +150,8 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
southPanel.add(setPanel, BorderLayout.CENTER); southPanel.add(setPanel, BorderLayout.CENTER);
setPanel.setPreferredSize(new Dimension(setPanelWidth, 460)); setPanel.setPreferredSize(new Dimension(setPanelWidth, 460));
setPanel.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer_Set"))); setPanel.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer_Set")));
textSetPanel = textSetPanel(width,height); JPanel controlPane = textSetPanel(width,height);
setPanel.add(textSetPanel, BorderLayout.NORTH); setPanel.add(controlPane, BorderLayout.NORTH);
fileTypeComboBox.addActionListener(getFileTypeListener(setPanel,width,height)); fileTypeComboBox.addActionListener(getFileTypeListener(setPanel,width,height));
this.add(northPanel, BorderLayout.NORTH); this.add(northPanel, BorderLayout.NORTH);
@ -465,11 +464,12 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} else if (fileTypeComboBox.getSelectedIndex() == EXCEL) { } else if (fileTypeComboBox.getSelectedIndex() == EXCEL) {
setPanel.add(excelSetPanel(width,height), BorderLayout.NORTH); setPanel.add(excelSetPanel(width,height), BorderLayout.NORTH);
} else { } 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() + "<br>" String tipContent = Inter.getLocText("FR-Designer-Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> "; + "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips.setText(tipContent); tips.setText(tipContent);
setPanel.revalidate();
} }
}; };

14
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.RestartHelper;
import com.fr.design.bbs.BBSLoginUtils; import com.fr.design.bbs.BBSLoginUtils;
import com.fr.design.dialog.UIDialog; 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.extra.exe.callback.JSCallback;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
@ -17,6 +18,7 @@ import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.manage.PluginManager; import com.fr.plugin.manage.PluginManager;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javafx.concurrent.Task;
import javafx.scene.web.WebEngine; import javafx.scene.web.WebEngine;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
import javafx.stage.Stage; import javafx.stage.Stage;
@ -491,6 +493,18 @@ public class PluginWebBridge {
this.uiLabel = uiLabel; this.uiLabel = uiLabel;
} }
/**
* 设计器端的用户登录
*
* @param username 用户名
* @param password 密码
* @return 登录信息标志
*/
public void defaultLogin(String username, String password, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new PluginLoginExecutor(username, password));
new Thread(task).start();
}
/** /**
* 弹出QQ授权页面 * 弹出QQ授权页面
*/ */

BIN
designer_base/src/com/fr/design/images/data/field.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 190 B

BIN
designer_base/src/com/fr/design/images/m_format/cell.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 477 B

16
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) { public BeautifyOption indentSize(int indentSize) {
this.indentSize = indentSize; this.indentSize = indentSize;
return this; return this;
} }
/**
* 缩进使用的字符默认为一个空格
* @param indentChar 缩进字符
*/
public BeautifyOption indentChar(String indentChar) { public BeautifyOption indentChar(String indentChar) {
this.indentChar = indentChar; this.indentChar = indentChar;
return this; return this;
} }
/**
* 是否使用tab来作为缩进字符默认为false
* @param indentWithTabs 使用tab作为缩进字符则返回true否则返回false
*/
public BeautifyOption indentWithTabs(boolean indentWithTabs) { public BeautifyOption indentWithTabs(boolean indentWithTabs) {
this.indentWithTabs = indentWithTabs; this.indentWithTabs = indentWithTabs;
return this; return this;
} }
/**
* 换行符默认为"\n"
* @param eol 换行符
*/
public BeautifyOption eol(String eol) { public BeautifyOption eol(String eol) {
this.eol = eol; this.eol = eol;
return this; return this;

Loading…
Cancel
Save