Browse Source

Merge pull request #310 in DESIGN/design from ~YAOH.WU/design:release/10.0 to release/10.0

* commit '86472c9bad96b1daed72e5edefdd435171565416':
  无任务,国际化规范
  REPORT-10263 远程设计权限验收问题10
  REPORT-10263 远程设计权限验收问题6
  REPORT-10263 远程设计权限验收问题3,4,11
  REPORT-10263 远程设计权限验收问题1,2
research/10.0
yaoh.wu 6 years ago
parent
commit
78326821fa
  1. 13
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java
  2. 28
      designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java
  3. 4
      designer-base/src/main/java/com/fr/design/remote/ui/list/AddedMemberListCellRender.java
  4. 13
      designer-base/src/main/java/com/fr/design/remote/ui/list/AddingMemberListCellRender.java
  5. 92
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  6. BIN
      designer-base/src/main/resources/com/fr/design/images/gui/modern_style_cht_file_icon_16x16.png
  7. BIN
      designer-base/src/main/resources/com/fr/design/images/gui/modern_style_cpt_file_icon_16x16.png
  8. BIN
      designer-base/src/main/resources/com/fr/design/images/gui/modern_style_frm_file_icon_16x16.png

13
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java

@ -37,6 +37,13 @@ public class FileTreeIcon {
public static final Icon FRM_FILE_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/frm.png"); public static final Icon FRM_FILE_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/frm.png");
public static final Icon CHT_FILE_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/cht.png"); public static final Icon CHT_FILE_IMAGE_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/cht.png");
public static final Icon MODERN_CPT_FILE_IMAGE_ICON =
BaseUtils.readIcon("/com/fr/design/images/gui/modern_style_cpt_file_icon_16x16.png");
public static final Icon MODERN_FRM_FILE_IMAGE_ICON =
BaseUtils.readIcon("/com/fr/design/images/gui/modern_style_frm_file_icon_16x16.png");
public static final Icon MODERN_CHT_FILE_IMAGE_ICON =
BaseUtils.readIcon("/com/fr/design/images/gui/modern_style_cht_file_icon_16x16.png");
public static final LockIcon FOLDER_LOCK_ICON = public static final LockIcon FOLDER_LOCK_ICON =
new LockIcon(BaseUtils.readImage("/com/fr/design/images/gui/fold.png")); new LockIcon(BaseUtils.readImage("/com/fr/design/images/gui/fold.png"));
public static final LockIcon FILE_LOCK_ICON = public static final LockIcon FILE_LOCK_ICON =
@ -205,19 +212,19 @@ public class FileTreeIcon {
if (isLocked) { if (isLocked) {
return FileTreeIcon.CPT_FILE_LOCK_ICON; return FileTreeIcon.CPT_FILE_LOCK_ICON;
} else { } else {
return FileTreeIcon.CPT_FILE_IMAGE_ICON; return FileTreeIcon.MODERN_CPT_FILE_IMAGE_ICON;
} }
} else if (fileType == FRM_FILE) { //form frm } else if (fileType == FRM_FILE) { //form frm
if (isLocked) { if (isLocked) {
return FileTreeIcon.FRM_FILE_LOCK_ICON; return FileTreeIcon.FRM_FILE_LOCK_ICON;
} else { } else {
return FileTreeIcon.FRM_FILE_IMAGE_ICON; return FileTreeIcon.MODERN_FRM_FILE_IMAGE_ICON;
} }
} else if (fileType == CHT_FILE) { //chart cht } else if (fileType == CHT_FILE) { //chart cht
if (isLocked) { if (isLocked) {
return FileTreeIcon.CHT_FILE_LOCK_ICON; return FileTreeIcon.CHT_FILE_LOCK_ICON;
} else { } else {
return FileTreeIcon.CHT_FILE_IMAGE_ICON; return FileTreeIcon.MODERN_CHT_FILE_IMAGE_ICON;
} }
} else { } else {
if (isLocked) { if (isLocked) {

28
designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java

@ -1,6 +1,7 @@
package com.fr.design.remote.ui; package com.fr.design.remote.ui;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -14,7 +15,6 @@ import com.fr.design.remote.ui.list.AddedMemberListCellRender;
import com.fr.design.remote.ui.list.AddingMemberList; import com.fr.design.remote.ui.list.AddingMemberList;
import com.fr.design.remote.ui.list.AddingMemberListCellRender; import com.fr.design.remote.ui.list.AddingMemberListCellRender;
import com.fr.design.remote.ui.list.MemberListSelectedChangeListener; import com.fr.design.remote.ui.list.MemberListSelectedChangeListener;
import com.fr.locale.InterProviderFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.ImmutableList; import com.fr.third.guava.collect.ImmutableList;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -95,12 +95,15 @@ public class UserManagerPane extends BasicPane {
* 输入框绑定事件 * 输入框绑定事件
*/ */
private KeyAdapter keyFieldKeyListener = new KeyAdapter() { private KeyAdapter keyFieldKeyListener = new KeyAdapter() {
@Override @Override
public void keyReleased(KeyEvent e) { public void keyPressed(KeyEvent e) {
// 判断按下的键是否是回车键 // 判断按下的键是否是回车键
// 对话框回车键绑定的是对话框的确定按钮,因此按确定没有办法搜索 // 对话框回车键绑定的是对话框的确定按钮
if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
searchAddingMembers(keyWord); searchAddingMembers(keyWord);
// has been processed
e.consume();
} }
} }
}; };
@ -191,15 +194,16 @@ public class UserManagerPane extends BasicPane {
public UserManagerPane() { public UserManagerPane() {
this.setBorder(BorderFactory.createEmptyBorder()); this.setBorder(BorderFactory.createEmptyBorder(0,4,0,4));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add( this.add(
TableLayoutHelper.createTableLayoutPane( TableLayoutHelper.createCommonTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{createLeftPanel(), createRightPanel()} new Component[]{createLeftPanel(), createRightPanel()}
}, },
new double[]{TableLayout.FILL}, new double[]{TableLayout.FILL},
new double[]{TableLayout.FILL, TableLayout.FILL} new double[]{TableLayout.FILL, TableLayout.FILL},
LayoutConstants.VGAP_LARGE
), ),
BorderLayout.CENTER); BorderLayout.CENTER);
} }
@ -351,8 +355,14 @@ public class UserManagerPane extends BasicPane {
addingMembers.clear(); addingMembers.clear();
String username = WorkContext.getConnector().currentUser(); String username = WorkContext.getConnector().currentUser();
synchronized (addingMembers) { synchronized (addingMembers) {
addingMembers.addAll(WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword)); Collection<RemoteDesignMember> more = WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword);
pageNum = 1; pageNum = 1;
if (!more.isEmpty()) {
addingMembers.addAll(more);
if (more.size() >= DEFAULT_NUM_EACH_PAGE) {
addingMembers.add(RemoteDesignMember.DEFAULT_MEMBER);
}
}
} }
return addingMembers; return addingMembers;
} }
@ -372,12 +382,14 @@ public class UserManagerPane extends BasicPane {
protected List<RemoteDesignMember> doInBackground() { protected List<RemoteDesignMember> doInBackground() {
String username = WorkContext.getConnector().currentUser(); String username = WorkContext.getConnector().currentUser();
synchronized (addingMembers) { synchronized (addingMembers) {
addingMembers.remove(RemoteDesignMember.DEFAULT_MEMBER);
Collection<RemoteDesignMember> more = Collection<RemoteDesignMember> more =
WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword, pageNum + 1, count); WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword, pageNum + 1, count);
if (!more.isEmpty()) { if (!more.isEmpty()) {
pageNum += 1; pageNum += 1;
}
addingMembers.addAll(more); addingMembers.addAll(more);
addingMembers.add(RemoteDesignMember.DEFAULT_MEMBER);
}
} }
return addingMembers; return addingMembers;
} }

4
designer-base/src/main/java/com/fr/design/remote/ui/list/AddedMemberListCellRender.java

@ -23,9 +23,9 @@ public class AddedMemberListCellRender extends JPanel implements ListCellRendere
this.setLayout(new FlowLayout(FlowLayout.LEFT)); this.setLayout(new FlowLayout(FlowLayout.LEFT));
label = new UILabel(); label = new UILabel();
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png")); label.setPreferredSize(new Dimension(264, 20));
label.setPreferredSize(new Dimension(260, 20));
this.setPreferredSize(new Dimension(this.getPreferredSize().width, 25)); this.setPreferredSize(new Dimension(this.getPreferredSize().width, 25));
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
this.add(label); this.add(label);
this.add(new IconButton()); this.add(new IconButton());

13
designer-base/src/main/java/com/fr/design/remote/ui/list/AddingMemberListCellRender.java

@ -9,6 +9,7 @@ import javax.swing.BorderFactory;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import javax.swing.SwingConstants;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
@ -43,10 +44,12 @@ public class AddingMemberListCellRender extends JPanel implements ListCellRender
if (member.equals(RemoteDesignMember.DEFAULT_MEMBER)) { if (member.equals(RemoteDesignMember.DEFAULT_MEMBER)) {
this.setLabelText(member.getUsername()); this.setLabelText(member.getUsername());
check.setVisible(false); check.setVisible(false);
fixLoadingDisplay();
} else { } else {
this.setLabelText(member.getRealName() + "(" + member.getUsername() + ")"); this.setLabelText(member.getRealName() + "(" + member.getUsername() + ")");
check.setVisible(true); check.setVisible(true);
check.setSelected(member.isSelected()); check.setSelected(member.isSelected());
recoveryCommonDisplay();
} }
return this; return this;
} }
@ -54,4 +57,14 @@ public class AddingMemberListCellRender extends JPanel implements ListCellRender
private void setLabelText(String name) { private void setLabelText(String name) {
label.setText(name); label.setText(name);
} }
private void fixLoadingDisplay() {
label.setIcon(null);
label.setHorizontalAlignment(SwingConstants.CENTER);
}
private void recoveryCommonDisplay() {
label.setIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Member_normal@1x.png"));
label.setHorizontalAlignment(SwingConstants.LEFT);
}
} }

92
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -1,5 +1,7 @@
package com.fr.env; package com.fr.env;
import com.fr.base.FRContext;
import com.fr.base.ServerConfig;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
@ -9,10 +11,11 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.scrollruler.ModLineBorder;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.guava.base.Strings; import com.fr.third.guava.base.Strings;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -39,7 +42,6 @@ import java.awt.Component;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -63,14 +65,14 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private JDialog dialog; private JDialog dialog;
private UILabel message = new UILabel(); private UILabel message = new UILabel();
private UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("OK")); private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
private UIButton cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Cancel")); private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_Cancel"));
private UILabel uiLabel = new UILabel(); private UILabel uiLabel = new UILabel();
/** /**
* 是否启用 https 勾选框 * 是否启用 https 勾选框
*/ */
private UICheckBox httpsCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Enable_Https")); private UICheckBox httpsCheckbox = new UICheckBox(Toolkit.i18nText("FR-Designer_RemoteEnv_Enable_Https"));
/** /**
* 主机位置输入框 * 主机位置输入框
*/ */
@ -122,11 +124,11 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
/** /**
* https 密钥标签 * https 密钥标签
*/ */
private UILabel certSecretKeyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Secret_Key")); private UILabel certSecretKeyLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Secret_Key"));
/** /**
* https证书路径标签 * https证书路径标签
*/ */
private UILabel certPathLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Cert_Path")); private UILabel certPathLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Cert_Path"));
/** /**
* https 证书路径输入框 * https 证书路径输入框
*/ */
@ -193,6 +195,10 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
fillIndividualField(); fillIndividualField();
} }
}; };
/**
* 测试链接对话框确定取消按钮面板
*/
private JPanel dialogDownPane = new JPanel();
public RemoteEnvPane() { public RemoteEnvPane() {
@ -201,7 +207,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
contentPanel.setBorder( contentPanel.setBorder(
BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 0, 0), new EmptyBorder(6, 0, 0, 0),
UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Config"))) UITitledBorder.createBorderWithTitle(Toolkit.i18nText("FR-Designer_RemoteEnv_Config")))
); );
@ -212,7 +218,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new EmptyBorder(15, 0, 0, 0), new EmptyBorder(15, 0, 0, 0),
BorderFactory.createTitledBorder( BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP), new ModLineBorder(ModLineBorder.TOP),
com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Server") Toolkit.i18nText("FR-Designer_RemoteEnv_Server")
) )
) )
); );
@ -231,7 +237,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new EmptyBorder(15, 0, 0, 0), new EmptyBorder(15, 0, 0, 0),
BorderFactory.createTitledBorder( BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP), new ModLineBorder(ModLineBorder.TOP),
com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Platform_Account") Toolkit.i18nText("FR-Designer_RemoteEnv_Platform_Account")
) )
)); ));
@ -242,9 +248,9 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
testPanel.setBorder(BorderFactory.createEmptyBorder()); testPanel.setBorder(BorderFactory.createEmptyBorder());
testPanel.setPreferredSize(new Dimension(437, 20)); testPanel.setPreferredSize(new Dimension(437, 20));
UIButton testConnectionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Test_Connection")); UIButton testConnectionButton = new UIButton(Toolkit.i18nText("FR-Designer_RemoteEnv_Test_Connection"));
testConnectionButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Datasource-Test_Connection")); testConnectionButton.setToolTipText(Toolkit.i18nText("Datasource-Test_Connection"));
testConnectionButton.addActionListener(new ActionListener() { testConnectionButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent ev) { public void actionPerformed(ActionEvent ev) {
@ -317,19 +323,19 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
// 主机名 // 主机名
UILabel hostNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Host_IP")); UILabel hostNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Host_IP"));
hostNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); hostNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// 端口 // 端口
UILabel portLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Port")); UILabel portLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Port"));
portLabel.setHorizontalAlignment(SwingConstants.RIGHT); portLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// web应用 // web应用
UILabel webAppNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Web_Name")); UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Web_Name"));
webAppNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); webAppNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// servlet // servlet
UILabel servletNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Servlet_Name")); UILabel servletNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Servlet_Name"));
servletNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); servletNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// 主机位置 // 主机位置
UILabel remoteEnvURLLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_URL")); UILabel remoteEnvURLLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_URL"));
remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.RIGHT); remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.RIGHT);
enableSubDocListener(); enableSubDocListener();
@ -353,7 +359,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JTextPane urlTipsPane = new JTextPane(); JTextPane urlTipsPane = new JTextPane();
urlTipsPane.setEditable(false); urlTipsPane.setEditable(false);
urlTipsPane.setText(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Server_Config_Tips")); urlTipsPane.setText(Toolkit.i18nText("FR-Designer_RemoteEnv_Server_Config_Tips"));
urlTipsPane.setBackground(urlPanel.getBackground()); urlTipsPane.setBackground(urlPanel.getBackground());
urlTipsPane.setForeground(TIPS_FONT_COLOR); urlTipsPane.setForeground(TIPS_FONT_COLOR);
@ -367,7 +373,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
JTextPane httpsTipsPane = new JTextPane(); JTextPane httpsTipsPane = new JTextPane();
httpsTipsPane.setEditable(false); httpsTipsPane.setEditable(false);
httpsTipsPane.setText(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Tips")); httpsTipsPane.setText(Toolkit.i18nText("FR-Designer_RemoteEnv_Https_Tips"));
httpsTipsPane.setBackground(configPanel.getBackground()); httpsTipsPane.setBackground(configPanel.getBackground());
httpsTipsPane.setForeground(TIPS_FONT_COLOR); httpsTipsPane.setForeground(TIPS_FONT_COLOR);
@ -381,6 +387,16 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED}, new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED},
new double[]{FILL} new double[]{FILL}
)); ));
setDefaultAppAndServlet();
}
/**
* 设置 app servlet 默认值
*/
private void setDefaultAppAndServlet() {
webAppNameInput.setText(FRContext.getCommonOperator().getAppName());
servletNameInput.setText(ServerConfig.getInstance().getServletName());
} }
@ -425,18 +441,18 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private void packAccountPanel(JPanel accountPanel) { private void packAccountPanel(JPanel accountPanel) {
// 用户名 // 用户名
UILabel userNameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Username")); UILabel userNameLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Username"));
userNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); userNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
// 密码 // 密码
UILabel passwordLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Password")); UILabel passwordLabel = new UILabel(Toolkit.i18nText("FR-Designer_RemoteEnv_Account_Password"));
passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT); passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT);
//输入密码的时候检测下大写锁定 //输入密码的时候检测下大写锁定
passwordInput.addMouseListener(new MouseAdapter() { passwordInput.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
if (Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) { if (java.awt.Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) {
passwordInput.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("CapsLock")); passwordInput.setToolTipText(Toolkit.i18nText("CapsLock"));
} else { } else {
passwordInput.setToolTipText(null); passwordInput.setToolTipText(null);
} }
@ -496,7 +512,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
try { try {
return WorkContext.getConnector().testConnection(connection); return WorkContext.getConnector().testConnection(connection);
} catch (AuthException e) { } catch (AuthException e) {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Auth_Failed")); message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Auth_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
return null; return null;
} }
@ -507,26 +523,33 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
okButton.setEnabled(true); okButton.setEnabled(true);
try { try {
if (get()) { if (get()) {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Successful")); message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Successful"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
} else { } else {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed")); message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed")); FineLoggerFactory.getLogger().error(e, e.getMessage());
message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Connect_Failed"));
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
} }
dialogDownPane.remove(cancelButton);
dialogDownPane.revalidate();
dialogDownPane.repaint();
} }
}; };
worker.execute(); worker.execute();
initMessageDialog(); initMessageDialog();
okButton.addActionListener(new ActionListener() { okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dialog.dispose(); dialog.dispose();
} }
}); });
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
dialog.dispose(); dialog.dispose();
worker.cancel(true); worker.cancel(true);
@ -534,6 +557,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
}); });
dialog.addWindowListener(new WindowAdapter() { dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) { public void windowClosed(WindowEvent e) {
worker.cancel(true); worker.cancel(true);
} }
@ -544,27 +568,27 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
} }
private void initMessageDialog() { private void initMessageDialog() {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Basic_Remote_Env_Try") + "..."); message.setText(Toolkit.i18nText("Fine-Designer_Basic_Remote_Env_Try") + "...");
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0)); message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false); okButton.setEnabled(false);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane.this), com.fr.design.i18n.Toolkit.i18nText("Datasource-Test_Connection"), true); dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(RemoteEnvPane.this), Toolkit.i18nText("Datasource-Test_Connection"), true);
dialog.setSize(new Dimension(268, 118)); dialog.setSize(new Dimension(268, 118));
okButton.setEnabled(false); okButton.setEnabled(false);
JPanel jp = new JPanel(); JPanel jp = new JPanel();
JPanel upPane = new JPanel(); JPanel upPane = new JPanel();
JPanel downPane = new JPanel(); dialogDownPane = new JPanel();
uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); uiLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel); upPane.add(uiLabel);
upPane.add(message); upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); dialogDownPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton); dialogDownPane.add(okButton);
downPane.add(cancelButton); dialogDownPane.add(cancelButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
jp.add(upPane); jp.add(upPane);
jp.add(downPane); jp.add(dialogDownPane);
dialog.add(jp); dialog.add(jp);
dialog.setResizable(false); dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane.this)); dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(RemoteEnvPane.this));

BIN
designer-base/src/main/resources/com/fr/design/images/gui/modern_style_cht_file_icon_16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

BIN
designer-base/src/main/resources/com/fr/design/images/gui/modern_style_cpt_file_icon_16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

BIN
designer-base/src/main/resources/com/fr/design/images/gui/modern_style_frm_file_icon_16x16.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Loading…
Cancel
Save