|
|
|
@ -7,7 +7,6 @@ import com.fr.design.gui.icombobox.DictionaryComboBox;
|
|
|
|
|
import com.fr.design.gui.icombobox.DictionaryConstants; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.gui.itextfield.UINumberField; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
@ -20,7 +19,7 @@ import java.awt.*;
|
|
|
|
|
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> { |
|
|
|
|
private DictionaryComboBox acceptType; |
|
|
|
|
private UICheckBox singleFileCheckBox; |
|
|
|
|
private UINumberField fileSizeField; |
|
|
|
|
private UISpinner fileSizeField; |
|
|
|
|
private UISpinner fontSizeField; |
|
|
|
|
|
|
|
|
|
public MultiFileEditorPane(XCreator xCreator) { |
|
|
|
@ -38,36 +37,30 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
|
|
|
|
|
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays); |
|
|
|
|
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD")); |
|
|
|
|
singleFileCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
fileSizeField = new UINumberField(); |
|
|
|
|
fileSizeField = new UISpinner(0, Integer.MAX_VALUE, 1, -1); |
|
|
|
|
fileSizeField.setPreferredSize(new Dimension(140, 20)); |
|
|
|
|
fontSizeField = new UISpinner(0, 20, 1, 0); |
|
|
|
|
|
|
|
|
|
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
|
|
|
|
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
singleFilePane.add(singleFileCheckBox); |
|
|
|
|
|
|
|
|
|
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
|
|
|
|
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
|
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":")); |
|
|
|
|
allowTypePane.add(acceptType); |
|
|
|
|
|
|
|
|
|
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); |
|
|
|
|
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":")); |
|
|
|
|
fileSizePane.add(fileSizeField); |
|
|
|
|
fileSizePane.add(new UILabel(" KB")); |
|
|
|
|
JPanel fileSizePane = new JPanel(new BorderLayout()); |
|
|
|
|
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[]{new UILabel(Inter.getLocText("File-Allow_Upload_Files")), acceptType}, |
|
|
|
|
new Component[]{new UILabel( Inter.getLocText("File-File_Size_Limit")), fileSizeField}, |
|
|
|
|
new Component[]{new UILabel( Inter.getLocText("File-File_Size_Limit")), fileSizePane}, |
|
|
|
|
new Component[]{new UILabel( Inter.getLocText("FR-Designer_Font-Size")), fontSizeField} |
|
|
|
|
}; |
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
double[] columnSize = {p,f}; |
|
|
|
|
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
boundsPane.add(panel); |
|
|
|
|
|
|
|
|
|