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