Browse Source

REPORT-39308 参数输入面板参数名显示不完整

feature/big-screen
vito 4 years ago
parent
commit
9af539cbbd
  1. 34
      designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java

34
designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java

@ -20,14 +20,18 @@ import com.fr.design.editor.editor.TextEditor;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
@ -37,6 +41,7 @@ import java.util.Map.Entry;
/**
* The dialog used to input parameter.
*
* @editor zhou
* @since 2012-3-26上午11:09:45
*/
@ -47,10 +52,12 @@ public class ParameterInputPane extends BasicPane {
private static final long serialVersionUID = 1L;
// alex:保存编辑器对应的参数的名字
private java.util.Map<ValueEditorPane,String> editorNameMap; // Map<Editor, Name>
private java.util.Map<ValueEditorPane, String> editorNameMap; // Map<Editor, Name>
private boolean allowBlank = true;
private FlowTableLayoutHelper flowTableLayoutHelper;
/**
* Constructor.
*/
@ -71,9 +78,9 @@ public class ParameterInputPane extends BasicPane {
this.add(new JScrollPane(contentPane), BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters") + ":"));
FlowTableLayoutHelper flowTableLayoutHelper = new FlowTableLayoutHelper();
flowTableLayoutHelper = new FlowTableLayoutHelper();
editorNameMap = new java.util.HashMap<ValueEditorPane,String>();
editorNameMap = new java.util.HashMap<ValueEditorPane, String>();
//Parameter list.
java.util.List<String> nameAddedList = new java.util.ArrayList<String>(); // alex:已经加到界面中去的参数名
@ -85,7 +92,7 @@ public class ParameterInputPane extends BasicPane {
if (nameAddedList.contains(parameter.getName())) {
continue;
}
if(parameter instanceof StoreProcedureParameter
if (parameter instanceof StoreProcedureParameter
&& ((StoreProcedureParameter) parameter).getSchema() == StoreProcedureConstants.OUT) {
continue;
}
@ -100,7 +107,7 @@ public class ParameterInputPane extends BasicPane {
editPane.setPreferredSize(new Dimension(180, editPane.getPreferredSize().height));
String parameterDisplayName = parameter.getName();
if(StringUtils.isNotBlank(parameter.getName())) {
if (StringUtils.isNotBlank(parameter.getName())) {
parameterDisplayName = parameter.getName();
}
contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane));
@ -112,7 +119,12 @@ public class ParameterInputPane extends BasicPane {
nameAddedList.add(parameter.getName());
}
}
}
@Override
public void addNotify() {
super.addNotify();
// windows 高DPI下,使用getPreferredSize必须在添加到容器之后,否则得到的数值不准确,因此先放到这调整大小
flowTableLayoutHelper.adjustLabelWidth();
}
@ -153,12 +165,12 @@ public class ParameterInputPane extends BasicPane {
/**
* Update
*/
public Map<String,Object> update() {
public Map<String, Object> update() {
java.util.Map<String,Object> nameValueMap = new java.util.HashMap<String,Object>();
java.util.Map<String, Object> nameValueMap = new java.util.HashMap<String, Object>();
Iterator<Entry<ValueEditorPane, String>> entryIt = this.editorNameMap.entrySet().iterator();
while(entryIt.hasNext()) {
while (entryIt.hasNext()) {
java.util.Map.Entry<ValueEditorPane, String> entry = entryIt.next();
ValueEditorPane editor = entry.getKey();
String parameterName = entry.getValue();

Loading…
Cancel
Save