Browse Source

REPORT-53739 提供单按钮ui

feature/10.0
vito 4 years ago
parent
commit
db5d7270fd
  1. 27
      designer-base/src/main/java/com/fr/design/dialog/UIExpandDialog.java
  2. 1
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

27
designer-base/src/main/java/com/fr/design/dialog/UIExpandDialog.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
@ -64,7 +65,7 @@ public class UIExpandDialog extends UIDialog {
private final UILabel narrow = new UILabel();
private final UILabel narrowHit = new UILabel();
private final UIButton buttonOK;
private final UIButton buttonCancel;
private UIButton buttonCancel = null;
private JLabel msg;
private final UITextArea textArea = new UITextArea();
@ -73,7 +74,9 @@ public class UIExpandDialog extends UIDialog {
String okText, String cancelText, boolean isExpand) {
super(owner);
buttonOK = new UIButton(okText);
buttonCancel = new UIButton(cancelText);
if (!StringUtils.isEmpty(cancelText)) {
buttonCancel = new UIButton(cancelText);
}
setTitle(title);
setModal(isModal);
initComponents(messageType, message, detail, isModal, isExpand, null);
@ -82,7 +85,9 @@ public class UIExpandDialog extends UIDialog {
public UIExpandDialog(Builder builder) {
super(builder.owner);
buttonOK = new UIButton(builder.okText);
buttonCancel = new UIButton(builder.cancelText);
if (!StringUtils.isEmpty(builder.cancelText)) {
buttonCancel = new UIButton(builder.cancelText);
}
setTitle(builder.title);
setModal(builder.modal);
initComponents(builder.messageType, builder.message, builder.detail,
@ -133,7 +138,9 @@ public class UIExpandDialog extends UIDialog {
// 操作面板
JPanel actionPanel = new JPanel();
actionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, MARGIN, MARGIN));
actionPanel.add(buttonCancel);
if (buttonCancel != null) {
actionPanel.add(buttonCancel);
}
actionPanel.add(buttonOK);
add(actionPanel, BorderLayout.SOUTH);
@ -185,11 +192,13 @@ public class UIExpandDialog extends UIDialog {
}
});
buttonCancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doCancel();
}
});
if (buttonCancel != null) {
buttonCancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doCancel();
}
});
}
}
protected Icon getIconForType(int messageType) {

1
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -178,6 +178,7 @@ public class DesignerAppUtils {
} else {
UIExpandDialog.Builder().owner(DesignerContext.getDesignerFrame())
.title(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"))
.cancelText(StringUtils.EMPTY)
.message(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Message_Remote"))
.detail(detail)
.build()

Loading…
Cancel
Save