|
|
|
@ -1,27 +1,22 @@
|
|
|
|
|
package com.fr.design.widget.ui; |
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
|
import com.fr.design.gui.icombobox.DictionaryComboBox; |
|
|
|
|
import com.fr.design.gui.icombobox.DictionaryConstants; |
|
|
|
|
import com.fr.design.gui.itextfield.UINumberField; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.FRLeftFlowLayout; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.form.ui.MultiFileEditor; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.awt.*; |
|
|
|
|
|
|
|
|
|
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> { |
|
|
|
|
private DictionaryComboBox acceptType; |
|
|
|
|
private UICheckBox singleFileCheckBox; |
|
|
|
|
private UINumberField fileSizeField; |
|
|
|
|
private UISpinner fileSizeField; |
|
|
|
|
|
|
|
|
|
public MultiFileEditorPane() { |
|
|
|
|
this.initComponents(); |
|
|
|
@ -35,34 +30,35 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected JPanel setFirstContentPane() { |
|
|
|
|
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); |
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
|
|
|
|
// centerPane.add(singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel contenter = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); |
|
|
|
|
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); |
|
|
|
|
acceptType.setPreferredSize(new Dimension(100, 18)); |
|
|
|
|
fileSizeField = new UINumberField(); |
|
|
|
|
fileSizeField.setPreferredSize(new Dimension(80, 18)); |
|
|
|
|
|
|
|
|
|
JPanel singleFilePane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); |
|
|
|
|
singleFilePane.add(singleFileCheckBox); |
|
|
|
|
centerPane.add(singleFilePane); |
|
|
|
|
|
|
|
|
|
JPanel allowTypePane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); |
|
|
|
|
allowTypePane.add(new UILabel(Inter.getLocText("File-Allow_Upload_Files") + ":")); |
|
|
|
|
allowTypePane.add(acceptType); |
|
|
|
|
centerPane.add(allowTypePane); |
|
|
|
|
|
|
|
|
|
JPanel fileSizePane = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane_First0(); |
|
|
|
|
fileSizePane.add(new UILabel(Inter.getLocText("File-File_Size_Limit") + ":")); |
|
|
|
|
fileSizePane.add(fileSizeField); |
|
|
|
|
fileSizePane.add(new UILabel(" KB")); |
|
|
|
|
centerPane.add(fileSizePane); |
|
|
|
|
// acceptType.setPreferredSize(new Dimension(100, 20));
|
|
|
|
|
fileSizeField = new UISpinner(0, Integer.MAX_VALUE, 1, -1); |
|
|
|
|
fileSizeField.setPreferredSize(new Dimension(140, 20)); |
|
|
|
|
|
|
|
|
|
JPanel fileSizePane = new JPanel(new BorderLayout()); |
|
|
|
|
UILabel fileTypeLabel = new UILabel(Inter.getLocText("Utils-File_type")); |
|
|
|
|
UILabel fileSizeLabel = new UILabel(Inter.getLocText("FR-Designer_Size_Limit")); |
|
|
|
|
fileSizePane.add(fileSizeField, BorderLayout.CENTER); |
|
|
|
|
fileSizePane.add(new UILabel(" KB"), BorderLayout.EAST); |
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{singleFileCheckBox, null}, |
|
|
|
|
new Component[]{fileTypeLabel, acceptType}, |
|
|
|
|
new Component[]{fileSizeLabel, fileSizePane}, |
|
|
|
|
}; |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 22, 10); |
|
|
|
|
|
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 00)); |
|
|
|
|
contenter.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
contenter.add(centerPane); |
|
|
|
|
return contenter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|