Révision 2224

tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/MediaPreferencesDialog.java (revision 2224)
4 4

  
5 5
import org.eclipse.jface.dialogs.Dialog;
6 6
import org.eclipse.swt.SWT;
7
import org.eclipse.swt.events.SelectionEvent;
8
import org.eclipse.swt.events.SelectionListener;
7 9
import org.eclipse.swt.graphics.Point;
8 10
import org.eclipse.swt.layout.GridData;
9 11
import org.eclipse.swt.layout.GridLayout;
12
import org.eclipse.swt.widgets.Button;
10 13
import org.eclipse.swt.widgets.Composite;
11 14
import org.eclipse.swt.widgets.Control;
15
import org.eclipse.swt.widgets.DirectoryDialog;
16
import org.eclipse.swt.widgets.FileDialog;
12 17
import org.eclipse.swt.widgets.Label;
13 18
import org.eclipse.swt.widgets.Shell;
14 19
import org.eclipse.swt.widgets.Text;
......
48 53
    protected Control createDialogArea(Composite parent) {
49 54
        Composite container = (Composite) super.createDialogArea(parent);
50 55
        Composite c = new Composite(container, SWT.NONE);
51
        c.setLayout(new GridLayout(2, true));
56
        c.setLayout(new GridLayout(3, false));
52 57
        
53 58
        CorpusCommandPreferences commandPreferences = corpus.getProject().getCommandPreferences("backtomedia");
54 59
        TXMPreferences alternative = BackToMediaPreferences.getInstance();
55 60
        
56 61
        for (String p : properties) {
57 62
        	new Label(c, SWT.NONE).setText(p);
58
        	Text t = new Text(c, SWT.BORDER);
59
        	t.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
63
        	final Text t = new Text(c, SWT.BORDER);
64
        	
65
        	GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1);
66
        	gd.minimumWidth = 200;
67
        	t.setLayoutData(gd);
60 68
        	t.setText(commandPreferences.get(p, alternative));
69
        	if (p.contains("directory")) {
70
        		t.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 1,1));
71
        		Button b = new Button(c,  SWT.PUSH);
72
        		b.setText("...");
73
        		b.addSelectionListener(new SelectionListener() {
74
					
75
					@Override
76
					public void widgetSelected(SelectionEvent e) {
77
						DirectoryDialog fd = new DirectoryDialog(MediaPreferencesDialog.this.getDialogArea().getShell(), SWT.OPEN);
78
						fd.setFilterPath(t.getText());
79
						String path = fd.open();
80
						if (path != null) {
81
							t.setText(path);
82
						}
83
					}
84
					
85
					@Override
86
					public void widgetDefaultSelected(SelectionEvent e) { }
87
				});
88
        	}
61 89
        	fields.put(p, t);
62 90
        }
63 91
        return container;
tmp/org.txm.backtomedia.rcp/build.properties (revision 2224)
7 7
               vlcj-2.4.1/platform-3.5.2.jar,\
8 8
               vlcj-2.4.1/vlcj-2.4.1.jar,\
9 9
               opal-0.9.5.2.jar,\
10
               OSGI-INF/
10
               OSGI-INF/,\
11
               OSGI-INF/l10n/bundle.properties
11 12
output..=bin/
12 13
source..=src/
13 14
qualifier=svn
tmp/org.txm.backtomedia.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 2224)
1 1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2
#Properties file for org.txm.backtomedia

2
#Properties file for org.txm.backtomedia
3 3

  
4 4
Bundle-Name = MediaPlayer
5 5

  
6 6
command.description = Ouvre un fichier m\u00E9dia dans un lecteur VLC int\u00E9gr\u00E9
7
command.label       = MediaPlayer
8
command.name        = Ouvrir un fichier m\u00E9dia...
9
command.name.0      = Jouer le m\u00E9dia
10
command.name.1      = Pr\u00E9f\u00E9r\u00E9nces MediaPlayer
7 11

  
8
command.label = MediaPlayer
9

  
10
command.name = Ouvrir un fichier m\u00E9dia...
11

  
12
command.name.0 = Jouer le m\u00E9dia
13

  
14 12
editor.name = Editeur M\u00E9diaPlayer
15 13

  
16 14
page.name = M\u00E9diaPlayer
tmp/org.txm.backtomedia.rcp/OSGI-INF/l10n/bundle.properties (revision 2224)
1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
1 2
#Properties file for org.txm.backtomedia
2
command.label = MediaPlayer
3

  
4
Bundle-Name = MediaPlayer
5

  
6
Bundle-Vendor = Textometrie.org
7

  
3 8
command.description = Open a media in an embedded VLC player
4
command.name = Open media...
5
command.name.0 = Play the media
6
editor.name = VLCPlayerEditor
9
command.label       = MediaPlayer
10
command.name        = Open media...
11
command.name.0      = Play the media
12
command.name.1      = MediaPlayer preferences
13

  
14
editor.name = MediaPlayer Editor
15

  
7 16
page.name = MediaPlayer
8
Bundle-Name = MediaPlayer
tmp/org.txm.backtomedia.rcp/plugin.xml (revision 2224)
63 63
      <command
64 64
            defaultHandler="org.txm.backtomedia.commands.function.MediaPreferences"
65 65
            id="org.txm.backtomedia.commands.function.MediaPreferences"
66
            name="Open media preferences">
66
            name="%command.name.1">
67 67
      </command>
68 68
   </extension>
69 69
   <extension
tmp/org.txm.backtomedia.rcp/META-INF/MANIFEST.MF (revision 2224)
10 10
 org.txm.backtomedia.editors.input,
11 11
 org.txm.backtomedia.editors.vlcplayer,
12 12
 org.txm.backtomedia.preferences
13
Bundle-Vendor: Textometrie.org
13
Bundle-Vendor: %Bundle-Vendor
14 14
Bundle-ClassPath: .,vlcj-2.4.1/jna-3.5.2.jar,vlcj-2.4.1/platform-3.5.2
15 15
 .jar,vlcj-2.4.1/vlcj-2.4.1.jar,opal-0.9.5.2.jar
16 16
Bundle-Version: 1.0.0.qualifier

Formats disponibles : Unified diff