OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 151 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 151 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 87... Line 87...
87
                image = new JImage(this.getClass().getResource("xls-icon.png"));
87
                image = new JImage(this.getClass().getResource("xls-icon.png"));
88
            } else if (type.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
88
            } else if (type.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) {
89
                image = new JImage(this.getClass().getResource("xlsx-icon.png"));
89
                image = new JImage(this.getClass().getResource("xlsx-icon.png"));
90
            } else if (type.equals(Attachment.MIMETYPE_FOLDER)) {
90
            } else if (type.equals(Attachment.MIMETYPE_FOLDER)) {
91
                image = new JImage(this.getClass().getResource("folder-icon.png"));
91
                image = new JImage(this.getClass().getResource("folder-icon.png"));
-
 
92
            } else if (type.equals(Attachment.MIMETYPE_URL) || type.equals("application/x-mswinurl")) {
-
 
93
                image = new JImage(this.getClass().getResource("url-icon.png"));
92
            } else {
94
            } else {
93
                image = new JImage(this.getClass().getResource("data-icon.png"));
95
                image = new JImage(this.getClass().getResource("data-icon.png"));
94
            }
96
            }
95
            image.setOpaque(true);
97
            image.setOpaque(true);
96
            image.setCenterImage(true);
98
            image.setCenterImage(true);
Line 366... Line 368...
366
                    p.add(new JLabel(attachment.getMimeType()), c);
368
                    p.add(new JLabel(attachment.getMimeType()), c);
367
                    c.gridy++;
369
                    c.gridy++;
368
                    // FileName
370
                    // FileName
369
                    c.gridx = 0;
371
                    c.gridx = 0;
370
                    c.weightx = 0;
372
                    c.weightx = 0;
-
 
373
                    if (attachment.getMimeType().equals(Attachment.MIMETYPE_URL)) {
-
 
374
                        p.add(new JLabel("URL : ", SwingConstants.RIGHT), c);
-
 
375
                    } else {
371
                    p.add(new JLabel("Fichier original : ", SwingConstants.RIGHT), c);
376
                        p.add(new JLabel("Fichier original : ", SwingConstants.RIGHT), c);
-
 
377
                    }
372
                    c.gridx++;
378
                    c.gridx++;
373
                    c.weightx = 1;
379
                    c.weightx = 1;
374
                    p.add(new JLabel(attachment.getFileName()), c);
380
                    p.add(new JLabel(attachment.getFileName()), c);
375
                    c.gridy++;
381
                    c.gridy++;
376
                    // Size
382
                    // Size
-
 
383
                    if (!attachment.getMimeType().equals(Attachment.MIMETYPE_URL)) {
377
                    c.gridx = 0;
384
                        c.gridx = 0;
378
                    c.weightx = 0;
385
                        c.weightx = 0;
379
                    p.add(new JLabel("Taille : ", SwingConstants.RIGHT), c);
386
                        p.add(new JLabel("Taille : ", SwingConstants.RIGHT), c);
380
                    c.gridx++;
387
                        c.gridx++;
381
                    c.weightx = 1;
388
                        c.weightx = 1;
382
                    p.add(new JLabel(attachment.getFileSize() + " octets"), c);
389
                        p.add(new JLabel(attachment.getFileSize() + " octets"), c);
383
 
-
 
-
 
390
                    }
384
                    // Spacer
391
                    // Spacer
385
                    c.gridx = 1;
392
                    c.gridx = 1;
386
                    c.gridy++;
393
                    c.gridy++;
387
                    c.weightx = 1;
394
                    c.weightx = 1;
388
                    JPanel spacer = new JPanel();
395
                    JPanel spacer = new JPanel();