Browse Source

Merge pull request #16 in ~HADES/design from ~JOE.JIANG/design:REPORT-20516 to release/10.0

* commit 'f3f07ad21a232f5af88771e8b1c8dd3561973093':
  REPORT-20516 语言切换至英文,创建条件属性、超级链接,点击删除,对话框的“确认”和“取消”显示为中文
feature/big-screen
Hades 5 years ago
parent
commit
93d1b58980
  1. 111
      designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java
  3. 7
      designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java
  4. 3
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java
  5. 3
      designer-form/src/main/java/com/fr/design/designer/creator/XWidgetCreator.java
  6. 5
      designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java
  7. 2
      designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java
  8. 5
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java
  9. 3
      designer-realize/src/main/java/com/fr/design/style/StylePane.java
  10. 3
      designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java
  11. 9
      designer-realize/src/main/java/com/fr/grid/dnd/ElementCasePaneDropTarget.java
  12. 5
      designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java
  13. 3
      designer-realize/src/main/java/com/fr/start/Designer.java

111
designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java

@ -1,6 +1,9 @@
package com.fr.design.dialog;
import com.fr.invoke.Reflect;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import java.awt.Component;
import java.awt.HeadlessException;
@ -35,6 +38,7 @@ public class FineJOptionPane extends JOptionPane {
private final static String MESSAGE_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message");
private final static String CONFIRM_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm");
private final static String INPUT_DIALOG_TITLE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips");
/**
* 使用默认 标题 消息类型 的消息提示弹出框
@ -79,7 +83,7 @@ public class FineJOptionPane extends JOptionPane {
}
/**
* 完全自定义的消息提示弹出框
* 自定义的消息提示弹出框
* @param parentComponent 父容器
* @param message 具体的提示消息
* @param title 标题
@ -159,7 +163,7 @@ public class FineJOptionPane extends JOptionPane {
}
/**
* 完全自定义的确认弹出框
* 自定义的确认弹出框
* @param parentComponent 父容器
* @param message 具体的提示消息
* @param title 标题
@ -178,5 +182,108 @@ public class FineJOptionPane extends JOptionPane {
messageType, icon, options, initialValue);
}
/**
* 指定消息内容的输入弹出框
* @param message 消息内容
* @return
* @throws HeadlessException
*/
public static String showInputDialog(Object message)
throws HeadlessException {
return showInputDialog(null, message);
}
/**
* 使用默认 标题 消息类型 的输入弹出框
* @param parentComponent 父容器
* @param message 消息内容
* @return
* @throws HeadlessException
*/
public static String showInputDialog(Component parentComponent,
Object message) throws HeadlessException {
return showInputDialog(parentComponent, message, INPUT_DIALOG_TITLE, QUESTION_MESSAGE);
}
/**
* 使用默认 标题消息类型Icon 选项 的输入弹出框
* @param parentComponent 父容器
* @param message 消息类型
* @param initialSelectionValue 初始选项
* @return
*/
public static String showInputDialog(Component parentComponent, Object message,
Object initialSelectionValue) {
return (String)showInputDialog(parentComponent, message,
INPUT_DIALOG_TITLE, QUESTION_MESSAGE, null, null,
initialSelectionValue);
}
/**
* 使用默认 父容器消息内容 初始选项 的输入弹出框
* @param message 消息内容
* @param initialSelectionValue 初始选项
* @return
*/
public static String showInputDialog(Object message, Object initialSelectionValue) {
return showInputDialog(null, message, initialSelectionValue);
}
/**
* 使用默认 Icon选项 初始选项 的输入弹出框
* @param parentComponent 父容器
* @param message 消息内容
* @param title 标题
* @param messageType 消息类型
* @return
* @throws HeadlessException
*/
public static String showInputDialog(Component parentComponent,
Object message, String title, int messageType)
throws HeadlessException {
return (String)showInputDialog(parentComponent, message, title,
messageType, null, null, null);
}
/**
* 自定义的输入弹出框
* @param parentComponent 父容器
* @param message 消息内容
* @param title 标题
* @param messageType 消息类型
* @param icon 图标
* @param selectionValues 选项
* @param initialSelectionValue 初始选项
* @return
* @throws HeadlessException
*/
public static Object showInputDialog(Component parentComponent,
Object message, String title, int messageType, Icon icon,
Object[] selectionValues, Object initialSelectionValue)
throws HeadlessException {
JOptionPane pane = new JOptionPane(message, messageType,
OK_CANCEL_OPTION, icon,
OPTION_OK_CANCEL, null);
pane.setWantsInput(true);
pane.setSelectionValues(selectionValues);
pane.setInitialSelectionValue(initialSelectionValue);
pane.setComponentOrientation(((parentComponent == null) ?
getRootFrame() : parentComponent).getComponentOrientation());
int style = Reflect.on(JOptionPane.class).call("styleFromMessageType", messageType).get();
JDialog dialog = Reflect.on(pane).call("createDialog", parentComponent, title, style).get();
pane.selectInitialValue();
dialog.show();
dialog.dispose();
Object value = pane.getInputValue();
if (value == UNINITIALIZED_VALUE) {
return null;
}
return value;
}
}

2
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java

@ -208,7 +208,7 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
public void actionPerformed(ActionEvent e) {
final int selectedRow = table.getSelectedRow();
if (selectedRow > table.getRowCount() - 1 || selectedRow < 0) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No-Alternatives"));
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No-Alternatives"));
return;
}
stopCellEditing();

7
designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

@ -13,6 +13,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener;
import com.fr.design.event.UIObserver;
@ -327,15 +328,15 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver {
}
private void showRenameWaring(String newName){
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), "\"" + newName + "\"" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Has_Been_Existed")
+ "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alert"), JOptionPane.WARNING_MESSAGE);
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), "\"" + newName + "\"" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Has_Been_Existed")
+ "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE);
}
private JMenuItem createRenameItem() {
JMenuItem renameItem = new JMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Rename"));
renameItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String newName = JOptionPane.showInputDialog(DesignerContext.getDesignerFrame().getContentPane(),
String newName = FineJOptionPane.showInputDialog(DesignerContext.getDesignerFrame().getContentPane(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Rename"), groupExtensionPane.getSelectedObject());
if (StringUtils.isNotBlank(newName)) {
String oldName = Utils.objectToString(groupExtensionPane.getSelectedObject());

3
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.custom.component;
import com.fr.chart.chartattr.Chart;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
@ -115,7 +116,7 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane<Chart> {
customTypeList.get(index).getCheckBox().setSelected(true);
//彈出警告框
JOptionPane.showMessageDialog(new JPanel(), MASSAGE,"", JOptionPane.WARNING_MESSAGE);
FineJOptionPane.showMessageDialog(new JPanel(), MASSAGE,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE);
}
//点击后更新已选顺序

3
designer-form/src/main/java/com/fr/design/designer/creator/XWidgetCreator.java

@ -4,6 +4,7 @@
package com.fr.design.designer.creator;
import com.fr.base.BaseUtils;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.FormDesigner;
@ -183,7 +184,7 @@ public abstract class XWidgetCreator extends XCreator {
*/
public void ChangeCreatorName(FormDesigner designer, XCreator creator) {
String oldName = creator.toData().getWidgetName();
String value = JOptionPane.showInputDialog(designer, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Change_Widget_Name_Discription"), oldName);
String value = FineJOptionPane.showInputDialog(designer, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Change_Widget_Name_Discription"), oldName);
if (value != null) {
designer.renameCreator(creator, value);
}

5
designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java

@ -3,6 +3,7 @@ package com.fr.design.cell.editor;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dscolumn.DSColumnPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.Grid;
@ -71,8 +72,8 @@ public class DSColumnCellEditor extends AbstractCellEditor implements DialogActi
try {
this.dsColumnPane.populate(DesignTableDataManager.getEditingTableDataSource(), cellElement);
} catch (Exception exp) {
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(grid), exp.getMessage(),
ProductConstants.APP_NAME, JOptionPane.ERROR_MESSAGE);
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(grid), exp.getMessage(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
}

2
designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java

@ -929,7 +929,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
return;
}
String newName = JOptionPane.showInputDialog(reportComposite, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Rename") + ":", reportComposite.getEditingWorkBook().getReportName(selectedIndex));
String newName = FineJOptionPane.showInputDialog(reportComposite, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Rename") + ":", reportComposite.getEditingWorkBook().getReportName(selectedIndex));
if (newName != null) {
// marks:判断是否重名
boolean isExisted = false;

5
designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

@ -1,6 +1,7 @@
package com.fr.design.report;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.style.StylePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -31,14 +32,14 @@ public class ReportStylePane extends StylePane {
popupMenu.add(menuItem);
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String name = JOptionPane.showInputDialog(getParent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Input_The_Name_Of_Gloabel_Style"));
String name = FineJOptionPane.showInputDialog(getParent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Input_The_Name_Of_Gloabel_Style"));
if (ComparatorUtils.equals(name, "")) {
return;
}
if (ServerPreferenceConfig.getInstance().getStyle(name) == null) {
ServerPreferenceConfig.getInstance().putStyle(name, ReportStylePane.this.updateBean());
} else {
JOptionPane.showMessageDialog(getParent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_This_Name_Has_Exsit") + "!", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Warning"), JOptionPane.WARNING_MESSAGE);
FineJOptionPane.showMessageDialog(getParent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_This_Name_Has_Exsit") + "!", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Warning"), JOptionPane.WARNING_MESSAGE);
}
}
});

3
designer-realize/src/main/java/com/fr/design/style/StylePane.java

@ -9,6 +9,7 @@ import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
@ -358,7 +359,7 @@ public class StylePane extends BasicBeanPane<Style> implements ChangeListener {
this.alignmentPane.checkValid();
}
} catch (Exception exp) {
JOptionPane.showMessageDialog(this, exp.getMessage());
FineJOptionPane.showMessageDialog(this, exp.getMessage());
return editing;
}

3
designer-realize/src/main/java/com/fr/design/webattr/ToolBarPane.java

@ -3,6 +3,7 @@ package com.fr.design.webattr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.ToolBar;
@ -86,7 +87,7 @@ public class ToolBarPane extends BasicBeanPane<ToolBar> {
public Component add(Component comp) {
if (comp instanceof ToolBarButton) {
if (isPopulateFinished() && ((ToolBarButton) comp).getWidget().getClass().isAnnotationPresent(OldPrintMethod.class)) {
JOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_New_Print_Tip"));
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_New_Print_Tip"));
return comp;
}
this.ftoolbar.addButton((ToolBarButton) comp);

9
designer-realize/src/main/java/com/fr/grid/dnd/ElementCasePaneDropTarget.java

@ -2,6 +2,7 @@ package com.fr.grid.dnd;
import com.fr.design.actions.ToggleButtonUpdateAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -192,13 +193,13 @@ public class ElementCasePaneDropTarget extends DropTargetAdapter {
if (direction == RIGHT_2_LEFT) {
int k = cs.getColumn() - columnCount + 1;
if (k < 0) {
JOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Left_Side_Of_Border"));
FineJOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Left_Side_Of_Border"));
return false;
}
} else if (direction == BOTTOM_2_TOP) {
int k = cs.getRow() - columnCount + 1;
if (k < 0) {
JOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Top_Side_Of_Border"));
FineJOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Top_Side_Of_Border"));
return false;
}
}
@ -206,12 +207,12 @@ public class ElementCasePaneDropTarget extends DropTargetAdapter {
if (ePane.mustInVisibleRange()) {
if (direction == LEFT_2_RIGHT) {
if (!GridUtils.canMove(ePane, cs.getColumn() + columnCount - 1, cs.getRow())) {
JOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Right_Side_Of_Border"));
FineJOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Right_Side_Of_Border"));
return false;
}
} else if (direction == TOP_2_BOTTOM) {
if (!GridUtils.canMove(ePane, cs.getRow(), cs.getColumn() + columnCount - 1)) {
JOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Bottom_Side_Of_Border"));
FineJOptionPane.showMessageDialog(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Beyond_The_Bottom_Side_Of_Border"));
return false;
}
}

5
designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java

@ -1,6 +1,7 @@
package com.fr.start;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -50,13 +51,13 @@ public class CollectUserInformationDialog extends UIDialog {
String message;
if (ActiveKeyGenerator.verify(keyValue, ONLINE_VERIFY_TIMEOUT)) {
message = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Activate_Activated_Successfully");
JOptionPane.showMessageDialog(CollectUserInformationDialog.this, message);
FineJOptionPane.showMessageDialog(CollectUserInformationDialog.this, message);
DesignerEnvManager.getEnvManager().setActivationKey(keyValue);
DesignerEnvManager.getEnvManager().saveXMLFile();
doOK();
} else {
message = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Activate_Activation_Code_Invalid");
JOptionPane.showMessageDialog(CollectUserInformationDialog.this, message);
FineJOptionPane.showMessageDialog(CollectUserInformationDialog.this, message);
}
}
};

3
designer-realize/src/main/java/com/fr/start/Designer.java

@ -12,6 +12,7 @@ import com.fr.design.actions.server.StyleListAction;
import com.fr.design.actions.server.WidgetManagerAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
@ -107,7 +108,7 @@ public class Designer extends BaseDesigner {
designerRoot.start();
} catch (LifecycleFatalError fatal) {
SplashContext.getInstance().hide();
JOptionPane.showMessageDialog(null, fatal.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
FineJOptionPane.showMessageDialog(null, fatal.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal);
System.exit(0);
}

Loading…
Cancel
Save