Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

final/10.0
ju 6 years ago
parent
commit
f93c9b48a5
  1. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java
  3. 9
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java
  4. 3
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java
  5. 14
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  6. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java
  7. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  8. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java
  9. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png
  10. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png

8
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -35,12 +35,12 @@ public class JDBCDefPane extends JPanel {
public static final String DRIVER_TYPE = "driver_type"; public static final String DRIVER_TYPE = "driver_type";
public static final String USER_NAME = "user_name"; public static final String USER_NAME = "user_name";
public static final int TIME_MULTIPLE = 1000; public static final int TIME_MULTIPLE = 1000;
private static final String EMPTY_DB = StringUtils.EMPTY; private static final String OTHER_DB = "Others";
private static Map<String, DriverURLName[]> jdbcMap = new HashMap<String, DriverURLName[]>(); private static Map<String, DriverURLName[]> jdbcMap = new HashMap<String, DriverURLName[]>();
static { static {
jdbcMap.put("Others", new DriverURLName[]{new DriverURLName("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:"), jdbcMap.put(OTHER_DB, new DriverURLName[]{new DriverURLName("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:"),
new DriverURLName("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:[PATH_TO_DB_FILES]"), new DriverURLName("com.inet.tds.TdsDriver", "jdbc:inetdae7:localhost:1433/"), new DriverURLName("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:[PATH_TO_DB_FILES]"), new DriverURLName("com.inet.tds.TdsDriver", "jdbc:inetdae7:localhost:1433/"),
new DriverURLName("COM.cloudscape.JDBCDriver", "jdbc:cloudscape:/cloudscape/"), new DriverURLName("COM.cloudscape.JDBCDriver", "jdbc:cloudscape:/cloudscape/"),
new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/")}); new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/")});
@ -65,7 +65,7 @@ public class JDBCDefPane extends JPanel {
private UITextField userNameTextField; private UITextField userNameTextField;
private JPasswordField passwordTextField; private JPasswordField passwordTextField;
// 请不要改动dbtype,只应该最后添加 // 请不要改动dbtype,只应该最后添加
private final String[] dbtype = {EMPTY_DB, "Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre","SQLite","Inceptor", "Others"}; private final String[] dbtype = {"Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre","SQLite","Inceptor", OTHER_DB};
// carl:DBCP的一些属性 // carl:DBCP的一些属性
private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor(); private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor();
@ -184,7 +184,7 @@ public class JDBCDefPane extends JPanel {
} }
} }
if (!out) { if (!out) {
this.dbtypeComboBox.setSelectedItem(EMPTY_DB); this.dbtypeComboBox.setSelectedItem(OTHER_DB);
} }
} }
this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver());

2
designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java

@ -18,4 +18,6 @@ public interface JavaScriptActionProvider extends Mutable{
FurtherBasicBeanPane<? extends JavaScript> getJavaScriptActionPane(JavaScriptActionPane pane); FurtherBasicBeanPane<? extends JavaScript> getJavaScriptActionPane(JavaScriptActionPane pane);
boolean isSupportType();
} }

9
designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java

@ -26,4 +26,13 @@ public abstract class AbstractJavaScriptActionProvider extends AbstractProvider
public FurtherBasicBeanPane<? extends JavaScript> getJavaScriptActionPane(JavaScriptActionPane pane) { public FurtherBasicBeanPane<? extends JavaScript> getJavaScriptActionPane(JavaScriptActionPane pane) {
return getJavaScriptActionPane(); return getJavaScriptActionPane();
} }
/**
* 判断是否是支持的类型cpt,frm默认是
* @return
*/
@Override
public boolean isSupportType(){
return true;
}
} }

3
designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java

@ -9,7 +9,6 @@ import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.form.ui.WebContentUtils; import com.fr.form.ui.WebContentUtils;
import com.fr.js.JavaScript; import com.fr.js.JavaScript;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -46,9 +45,11 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
Set<JavaScriptActionProvider> javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG); Set<JavaScriptActionProvider> javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG);
if (javaScriptActionProviders != null) { if (javaScriptActionProviders != null) {
for (JavaScriptActionProvider jsp : javaScriptActionProviders) { for (JavaScriptActionProvider jsp : javaScriptActionProviders) {
if(jsp.isSupportType()){
paneList.add(jsp.getJavaScriptActionPane(this)); paneList.add(jsp.getJavaScriptActionPane(this));
} }
} }
}
// 自定义事件 // 自定义事件
// paneList.add(new CustomActionPane()); // paneList.add(new CustomActionPane());
return paneList; return paneList;

14
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java

@ -2,9 +2,11 @@ package com.fr.design.mainframe.alphafine;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Font; import java.awt.Font;
import java.util.ArrayList;
/** /**
@ -49,7 +51,7 @@ public class AlphaFineConstants {
public static final Dimension HOT_ICON_LABEL_SIZE = new Dimension(36, 36); public static final Dimension HOT_ICON_LABEL_SIZE = new Dimension(36, 36);
public static final Dimension HOT_ISSUES_JAPNEL_SIZE = new Dimension(213,182); public static final Dimension HOT_ISSUES_JAPNEL_SIZE = new Dimension(213, 182);
public static final Dimension CLOSE_BUTTON_SIZE = new Dimension(40, 40); public static final Dimension CLOSE_BUTTON_SIZE = new Dimension(40, 40);
@ -134,8 +136,16 @@ public class AlphaFineConstants {
public static final String FIRST_PAGE = "-1"; public static final String FIRST_PAGE = "-1";
public static final FileExtension[] FILE_EXTENSIONS= new FileExtension[]{FileExtension.CPT, FileExtension.FRM}; public static final FileExtension[] FILE_EXTENSIONS = new FileExtension[]{FileExtension.CPT, FileExtension.FRM};
public static final int RECOMMEND_MAX_ITEM_NUM = 3; public static final int RECOMMEND_MAX_ITEM_NUM = 3;
public static final String BACK_ICON_NAME = "back@1x.png";
public static final ArrayList<String> CONJUNCTION = new ArrayList<String>() {{
add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Conjunction_HE"));
add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Conjunction_YU"));
add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Conjunction_DE"));
}};
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java

@ -24,7 +24,7 @@ public class BottomCellRender implements ListCellRenderer<Object> {
JPanel line = new JPanel(); JPanel line = new JPanel();
line.setPreferredSize(new Dimension(200, 1)); line.setPreferredSize(new Dimension(200, 1));
line.setBackground(AlphaFineConstants.GRAY); line.setBackground(AlphaFineConstants.WHITE);
panel.add(line, BorderLayout.NORTH); panel.add(line, BorderLayout.NORTH);
goToWebLabel.setFont(AlphaFineConstants.MEDIUM_FONT); goToWebLabel.setFont(AlphaFineConstants.MEDIUM_FONT);

11
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -239,20 +239,21 @@ public class AlphaFineDialog extends UIDialog {
hotPane.setLayout(new BorderLayout()); hotPane.setLayout(new BorderLayout());
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot")); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot"));
uiLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
uiLabel.setFont(AlphaFineConstants.SMALL_FONT); uiLabel.setFont(AlphaFineConstants.SMALL_FONT);
uiLabel.setForeground(AlphaFineConstants.DARK_GRAY); uiLabel.setForeground(AlphaFineConstants.DARK_GRAY);
GridLayout gridLayout = new GridLayout(2, 3, 3, 3); GridLayout gridLayout = new GridLayout(2, 3, 3, 3);
JPanel panel = new JPanel(); JPanel panel = new JPanel();
panel.setLayout(gridLayout); panel.setLayout(gridLayout);
if(AlphaFineHelper.isNetworkOk()) { if (AlphaFineHelper.isNetworkOk()) {
if (hotData == null) { if (hotData == null) {
hotData = HotIssuesManager.getInstance().getHotIssues(); hotData = HotIssuesManager.getInstance().getHotIssues();
} }
for (int i = 0; i < hotData.length; i++) { for (int i = 0; i < hotData.length; i++) {
panel.add(new HotIssueJpanel(hotData[i], i + 1)); panel.add(new HotIssueJpanel(hotData[i], i + 1));
} }
}else { } else {
hotData = null; hotData = null;
for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) {
panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1));
@ -947,7 +948,7 @@ public class AlphaFineDialog extends UIDialog {
Thread sendThread = new Thread(new Runnable() { Thread sendThread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
if(StringUtils.isNotEmpty(storeText)){ if (StringUtils.isNotEmpty(storeText)) {
RecentSearchManager searchManager = RecentSearchManager.getInstance(); RecentSearchManager searchManager = RecentSearchManager.getInstance();
searchManager.addModel(storeText, cellModel); searchManager.addModel(storeText, cellModel);
sendDataToServer(storeText, cellModel); sendDataToServer(storeText, cellModel);
@ -1377,7 +1378,9 @@ public class AlphaFineDialog extends UIDialog {
*/ */
private void initBackPane() { private void initBackPane() {
backPane = new JPanel(new BorderLayout()); backPane = new JPanel(new BorderLayout());
JLabel jLabel = new JLabel(" < " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back")); JLabel jLabel = new JLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back"));
jLabel.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.BACK_ICON_NAME));
jLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
jLabel.setPreferredSize(new Dimension(80, 20)); jLabel.setPreferredSize(new Dimension(80, 20));
jLabel.setFont(AlphaFineConstants.SMALL_FONT); jLabel.setFont(AlphaFineConstants.SMALL_FONT);
jLabel.setForeground(AlphaFineConstants.DARK_GRAY); jLabel.setForeground(AlphaFineConstants.DARK_GRAY);

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java

@ -2,7 +2,6 @@ package com.fr.design.mainframe.alphafine.search.manager.impl;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.ibm.icu.text.BreakIterator; import com.fr.third.ibm.icu.text.BreakIterator;
import java.util.ArrayList; import java.util.ArrayList;
@ -72,7 +71,8 @@ public class SegmentationManager {
int start = itor.first(); int start = itor.first();
for (int end = itor.next(); end != BreakIterator.DONE; start = end, end = itor.next()) { for (int end = itor.next(); end != BreakIterator.DONE; start = end, end = itor.next()) {
String temp = searchText.substring(start, end); String temp = searchText.substring(start, end);
if (!StringUtils.isEmpty(temp)) { //去掉空和连词
if (StringUtils.isNotEmpty(temp) && !AlphaFineConstants.CONJUNCTION.contains(temp)) {
result.add(temp); result.add(temp);
} }
} }

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Loading…
Cancel
Save