Revision 2847 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.dynform/org.gvsig.tools.dynform.services/src/main/java/org/gvsig/tools/dynform/services/dynformfield/Bytearray/JDynFormFieldBytearray.java

View differences:

JDynFormFieldBytearray.java
49 49
    protected JTextComponent jtext = null;
50 50
    protected JButton jbuttonUpload = null;
51 51
    protected JButton jbuttonDownload = null;
52
    protected JButton jbuttonEditAsText = null;
52 53
    private PickerController<byte[]> picker;
53 54

  
54 55
    public JDynFormFieldBytearray(
......
84 85
        this.contents = new JPanel();
85 86
        this.contents.setLayout(new BorderLayout());
86 87

  
87
        DynFormSPIManager.ComponentsFactory components = this.getComponentsFactory();
88
        DynFormSPIManager.ComponentsFactory componentsFactory = this.getComponentsFactory();
88 89
        ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager();
89 90

  
90
        this.jtext = components.getJTextField(this.getDefinition(), null);
91
        this.jbuttonDownload = components.getJButton(this.getDefinition(), "Download");
92
        this.jbuttonUpload = components.getJButton(this.getDefinition(), "Upload");
91
        this.jtext = componentsFactory.getJTextField(this.getDefinition(), null);
92
        this.jbuttonDownload = componentsFactory.getJButton(this.getDefinition(), "Download");
93
        this.jbuttonUpload = componentsFactory.getJButton(this.getDefinition(), "Upload");
94
        this.jbuttonEditAsText = componentsFactory.getJButton(this.getDefinition(), "EditAsText");
93 95

  
94 96
        this.picker = toolsSwingManager.createByteArrayPickerController(
95 97
                (JTextField) jtext,
96 98
                jbuttonUpload,
97 99
                jbuttonDownload,
100
                jbuttonEditAsText,
98 101
                this.getForm().getDefinition().getName() + ".RAWDATA",
99 102
                null
100 103
        );
......
104 107
                fireFieldChangedEvent();
105 108
            }
106 109
        });
107
        if (!components.containsComponents(this.getDefinition())) {
110
        if (!componentsFactory.containsComponents(this.getDefinition())) {
108 111
            toolsSwingManager.removeBorder(this.jbuttonDownload);
109 112
            toolsSwingManager.removeBorder(this.jbuttonUpload);
113
            toolsSwingManager.removeBorder(this.jbuttonEditAsText);
110 114
            JPanel buttons = new JPanel(new FlowLayout(FlowLayout.TRAILING, 4, 2));
111 115
            buttons.add(this.jbuttonUpload);
112 116
            buttons.add(this.jbuttonDownload);
117
            if( this.jbuttonEditAsText!=null ) {
118
                buttons.add(this.jbuttonEditAsText);
119
            }
113 120
            this.contents.add(jtext, BorderLayout.CENTER);
114 121
            this.contents.add(buttons, BorderLayout.LINE_END);
115 122
            this.contents.setVisible(true);

Also available in: Unified diff