• Aucun résultat trouvé

Introduction Éclair à Éclipse

N/A
N/A
Protected

Academic year: 2022

Partager "Introduction Éclair à Éclipse"

Copied!
9
0
0

Texte intégral

(1)

Université Paris Sud

1. Structuration des données

La hiérarchie utilisée par Éclipse est la suivante :

– Au lancement de l’environnement de développement Éclipse, l’utilisateur doit choisir un répertoire de travail (ou Workspace) qui sera créé s’il n’existe pas.

– Au sein de ce Workspace (dans ce répertoire), l’utilisateur peut ensuite créer et modifier un (ou plusieurs) projets, dont le nom correspond à un sous répertoire du Workspace.

– Au sein projet (dans ce répertoire) l’utilisateur peut ensuite créer et modifier un (ou plusieurs) fichiers sources java correspondant à des classes (ou à des interfaces).

2. Création simple d’un application

Création d’un projet et de nouvelles classes

Supposons vouloir créer une application dont les sources ( *.java ) et les classes com- pilées ( *.class ) devront être dans le répertoire suivant : z:\TPsJava\BasesProcEuro.

On se conformera pour cela aux étapes qui suivent.

– Lancer Éclipse. Comme nom de Workspace enter z:\TPsJava et cliquer sur OK (figure 1)

Figure 1. Fenêtre de sélection de Workspace.

1

(2)

– Fermer la fenêtre Welcome to Eclipse. Sélectionner le menu File et le sous- menu New > Project... (figure 2)

Figure 2. Première fenêtre de création de projet.

Sélectionnez Java Project et cliquez sur Next.

– Dans la fenêtre New Java Project entrer BasesProcEuro (figure 3)

Figure 3. Deuxième fenêtre de création de projet.

(3)

Veillez à ce que soient sélectionnés Create project in workspace et Use project folder as root for sources and classes files

– Cliquez sur Finish dans la fenêtre qui apparaît (figure 4)

Figure 4. Troisième fenêtre de création de projet.

– Répondre Yes à la question posée (figure 5)

Figure 5. Troisième fenêtre de création de projet.

– Sélectionner le menu File et le sous-menu New > Class...

– Dans la fenêtre apparaît, entrer dans le champ Name le nom de la classe que vous

voulez créer ; ici, on a entré MaPremiereClasse. Ce nom est utilisé comme partie sans

l’extension du nom du fichier source java (ici MaPremiereClasse.java). On rappelle

que le nom d’un fichier source java doit obligatoirement correspondre au nom de

l’unique classe publique que peut contenir ce fichier (figure 6).

(4)

Figure 6. Fenêtre de création de classe.

Cocher la boîte public static void main(String[] args) dans le cas où votre fichier doit contenir une méthode main(). Vous pouvez décocher les autres boîtes. Cliquez sur Finish.

– Entrer du code java (figure 7).

Figure 7. Fenêtres en perspective java.

Compilation et exécution

Pour compiler et exécuter, Sélectionner le menu Run > Run as > Java application.

Répondre OK si l’on veut sauvegarder la version actuelle du fichier. Les erreurs apparaissent

dans la fenêtre du bas (figure 8) :

(5)

Figure 8. Erreurs (onglet Problems).

ici, une erreur sur le nom de la méthode a été faite. Remarquez que cette erreur a été détectée avant compilation par Eclipse qui a souligné de vaguelettes rouges la méthode fautive et qui a placé une petite ampoule avec une croix blanche sur fond rouge juste à gauche de la ligne erronnée. Si l’on déplace le pointeur de la souris au-dessus de l’ampoule, un message explicatif apparaît (figure 9)

Figure 9. Erreurs (menu contextuel).

Exécution avec paramètres sur la ligne de commandes

Pour entrer des paramètres sur la ligne de commande (paramètres de la méthode

main(String args[]), par exemple le premier paramètre sera accessible dans le pro-

gramme sous args[0]), sélectionner l’item Run... du menu Run et sélectionner l’onglet

Arguments (figure 10)

(6)

Figure 10. Fenêtre d’arguments de la méthode main().

puis entrer les arguments dans le champ Program arguments (ici leSoleilAussi), puis cliquez sur Run (figure 11)

Figure 11. Fenêtre d’arguments de la méthode main().

3. Création simple d’une applet

– Créer un projet ainsi que les classes comme réalisé dans la section précédente.

– Pour compiler et exécuter, Sélectionner le menu Run > Run as > Java applet.

(7)

4. Raccoucis clavier

Les raccourcis clavier suivants sont tirés de :

http ://eclipse-tools.sourceforge.net/shortcuts.html

(8)

Emacs configuration

EditContent Assist Alt+/ In Dialogs and Windows

Context Information Alt+? In Windows

Context Information Shift+Alt+? In Windows Context Information Shift+Ctrl+Space In Windows

Copy Alt+W In Dialogs and Windows

Copy Ctrl+C In Dialogs and Windows

Copy Ctrl+Insert In Dialogs and Windows

Copy Esc W In Dialogs and Windows

Cut Ctrl+W In Dialogs and Windows

Cut Ctrl+X In Dialogs and Windows

Cut Shift+Del In Dialogs and Windows

Delete Delete In Windows

Find Previous Shift+Ctrl+K Editing Text

Find and Replace Alt+R In Windows

Find and Replace Esc R In Windows

Incremental Find Ctrl+J Editing Text

Incremental Find Ctrl+S Editing Text

Incremental Find Reverse Ctrl+R Editing Text Incremental Find Reverse Shift+Ctrl+J Editing Text

Paste Ctrl+Y In Dialogs and Windows

Paste Shift+Ins In Dialogs and Windows

Quick Diff Toggle Shift+Ctrl+Q Editing Text

Quick Fix Ctrl+1 In Windows

Redo Ctrl+X R In Windows

Redo F10 In Windows

Redo Shift+Ctrl++ In Windows

Restore Last Selection Shift+Alt+Down Editing Java Source

Select All Ctrl+X H In Dialogs and Windows

Select Enclosing Element Shift+Alt+Up Editing Java Source Select Next Element Shift+Alt+Right Editing Java Source Select Previous Element Shift+Alt+Left Editing Java Source Show Tooltip Description F2 Editing Java Source Toggle Insert Mode Shift+Ctrl+Insert Editing Text

Undo Ctrl+X U In Windows

Undo F9 In Windows

Undo Shift+Ctrl+­ In Windows

© 2005 Carsten Ullrich.

Creative Commons Attribution­ShareAlike 2.5 License http://creativecommons.org/licenses/by­sa/2.5/

Close Ctrl+X K In Windows

Close All Ctrl+X Ctrl+C In Windows

Close All Shift+Ctrl+F4 In Windows

Close All Shift+Ctrl+W In Windows

New menu Shift+Alt+N In Windows

Print Alt+F9 In Windows

Print Esc F9 In Windows

Properties Alt+Enter In Windows

Refresh F5 In Windows

Rename F2 In Windows

Save Ctrl+X Ctrl+S In Windows

Save All Ctrl+X S In Windows

Save All Shift+Ctrl+S In Windows

Navigate

Backward History Alt+Left In Windows

Forward History Alt+Right In Windows

Go to Line Ctrl+L Editing Text

Go to Line Ctrl+X G Editing Text

Go to Matching Bracket Shift+Ctrl+P Editing Java Source Go to Next Member Shift+Ctrl+Down Editing Java Source Go to Previous Member Shift+Ctrl+Up Editing Java Source

Last Edit Location Ctrl+Q In Windows

Next Ctrl+. In Windows

Open Call Hierarchy Ctrl+Alt+H In Windows

Open Declaration F3 In Windows

Open External Javadoc Shift+F2 In Windows

Open Resource Shift+Ctrl+R In Windows

Open Structure Ctrl+F3 Editing Java Source

Open Type Shift+Ctrl+T In Windows

Open Type Hierarchy F4 In Windows

Open Type in Hierarchy Shift+Ctrl+H In Windows

Previous Ctrl+ In Windows

Quick Hierarchy Ctrl+T Editing Java Source

Quick Outline Ctrl+O Editing Java Source

Show In menu Shift+Alt+W In Windows

Refactor ­ Java

Change Method Signature Shift+Alt+C In Windows Convert Local Variable to Field Shift+Alt+F Editing Java Source Extract Local Variable Shift+Alt+L In Windows

Extract Method Shift+Alt+M In Windows

Inline Shift+Alt+I In Windows

Move ­ Refactoring  Shift+Alt+V In Windows Redo ­ Refactoring  Shift+Alt+Y In Windows Rename ­ Refactoring  Shift+Alt+R In Windows Show Refactor Quick Menu Shift+Alt+T In Windows

Undo ­ Refactoring Shift+Alt+Z In Windows

Debug Eclipse Application Shift+Alt+D E In Windows Debug JUnit Plug­in Test Shift+Alt+D P In Windows

Debug JUnit Test Shift+Alt+D T In Windows

Debug Java Applet Shift+Alt+D A In Windows Debug Java Application Shift+Alt+D J In Windows

Debug Last Launched F11 In Windows

Debug SWT Application Shift+Alt+D S In Windows

Display Shift+Ctrl+D In Dialogs&Windows

Display Shift+Ctrl+V In Dialogs&Windows

Execute Ctrl+U In Windows

Inspect Shift+Ctrl+I In Dialogs&Windows

Resume F8 Debugging

Run Ant Build Shift+Alt+X Q In Windows

Run Eclipse Application Shift+Alt+X E In Windows Run JUnit Plug­in Test Shift+Alt+X P In Windows

Run JUnit Test Shift+Alt+X T In Windows

Run Java Applet Shift+Alt+X A In Windows

Run Java Application Shift+Alt+X J In Windows

Run Last Launched Ctrl+F11 In Windows

Run SWT Application Shift+Alt+X S In Windows

Step Into F5 Debugging

Step Into Selection Ctrl+F5 Debugging

Step Over F6 Debugging

Step Return F7 Debugging

Toggle Line Breakpoint Shift+Ctrl+B In Windows

Toggle Step Filters Shift+F5 In Windows

Search

Open Search Dialog Ctrl+H In Windows

References in Workspace Shift+Ctrl+G In Windows Show Occurrences in File Quick Menu Shift+Ctrl+U In Windows

(9)

Add Import Shift+Ctrl+M Editing Java Source Add Javadoc Comment Shift+Alt+J In Windows

Format Esc Ctrl+F Editing Java Source

Format Shift+Ctrl+F Editing Ant Buildfiles

Indent Line Ctrl+I Editing Java Source

Open External Documentation Shift+F2 Editing Ant Buildfiles

Organize Imports Shift+Ctrl+O In Windows

Quick Assist ­ Assign to field Ctrl+2 F Editing Java Source Quick Assist ­ Assign to local variable Ctrl+2 L Editing Java Source Quick Assist ­ Rename in file Ctrl+2 R Editing Java Source Remove Block Comment Shift+Ctrl+\ Editing Java Source Remove Occurrence Annotations Shift+Alt+U Editing Java Source Rename In File Shift+Alt+R Editing Ant Buildfiles Show Source Quick Menu Shift+Alt+S In Windows Show Tooltip Description F2 Editing Ant Buildfiles Toggle Ant Mark Occurrences Shift+Alt+O Editing Ant Buildfiles

Toggle Comment Ctrl+/ Editing Java Source

Toggle Comment Ctrl+7 Editing Java Source

Toggle Comment Esc Ctrl+C Editing Java Source

Toggle Mark Occurrences Shift+Alt+O Editing Java Source

Text Editing

Clear Mark Ctrl+G Editing Text

Collapse Ctrl+Numpad_SubtractEditing Text

Copy Lines Ctrl+Alt+Down Editing Text

Cut to Beginning of Line Alt+0 Ctrl+K Editing Text Cut to Beginning of Line Esc 0 Ctrl+K Editing Text

Cut to End of Line Ctrl+K Editing Text

Delete Next Ctrl+D Editing Text

Delete Next Word Alt+D Editing Text

Delete Next Word Ctrl+Delete Editing Text

Delete Next Word Esc D Editing Text

Delete Previous Word Alt+Backspace Editing Text Delete Previous Word Ctrl+Backspace Editing Text Delete Previous Word Esc Backspace Editing Text Delete to End of Line Shift+Ctrl+Delete Editing Text

Duplicate Lines Ctrl+Alt+Up Editing Text

Expand Ctrl+Numpad_Add Editing Text

Expand All Ctrl+Numpad_Multiply Editing Text Insert Line Above Current Line Shift+Ctrl+Enter Editing Text Insert Line Below Current Line Shift+Enter Editing Text

Line Down Ctrl+N Editing Text

Line End Ctrl+E Editing Text

Line Start Ctrl+A Editing Text

Line Up Ctrl+P Editing Text

Move Lines Down Alt+Down Editing Text

Move Lines Up Alt+Up Editing Text

Next Column Ctrl+F Editing Text

Next Word Alt+F Editing Text

Next Word Ctrl+Right Editing Text

Next Word Esc F Editing Text

Previous Column Ctrl+B Editing Text

Previous Word Alt+B Editing Text

Previous Word Ctrl+Left Editing Text

Previous Word Esc B Editing Text

Scroll Line Down Ctrl+Down Editing Text

Scroll Line Down Ctrl+Z Editing Text

Scroll Line Up Alt+Z Editing Text

Scroll Line Up Ctrl+Up Editing Text

Scroll Line Up Esc Z Editing Text

Select Next Word Shift+Ctrl+Right Editing Text Select Previous Word Shift+Ctrl+Left Editing Text

Set Mark Ctrl+2 Editing Text

Set Mark Ctrl+Space Editing Text

Swap Mark Ctrl+X Ctrl+X Editing Text

Text End Alt+> Editing Text

Text End Ctrl+X ] Editing Text

Text End Esc > Editing Text

Text End Esc Shift+> Editing Text

Text End Shift+Alt+> Editing Text

Text Start Alt+< Editing Text

Text Start Ctrl+X [ Editing Text

Text Start Esc < Editing Text

Text Start Esc Shift+< Editing Text

Text Start Shift+Alt+< Editing Text

To Lower Case Shift+Ctrl+Y Editing Text

To Upper Case Shift+Ctrl+X Editing Text

Toggle Folding Ctrl+Numpad_Divide Editing Text

Toggle Overwrite Insert Editing Text

Cheat Sheets Shift+Alt+Q H In Windows

Console Shift+Alt+Q C In Windows

Java Declaration Shift+Alt+Q D In Windows

Java Package Explorer Shift+Alt+Q P In Windows Java Type Hierarchy Shift+Alt+Q T In Windows

Javadoc Shift+Alt+Q J In Windows

Search Shift+Alt+Q S In Windows

Show View (View: Outline) Shift+Alt+Q O In Windows Show View (View: Problems) Shift+Alt+Q X In Windows

Synchronize Shift+Alt+Q Y In Windows

Variables Shift+Alt+Q V In Windows

Window

Activate Editor F12 In Windows

Maximize Active View or Editor Ctrl+M In Windows

Next Editor Ctrl+F6 In Windows

Next Perspective Ctrl+F8 In Windows

Next View Ctrl+F7 In Windows

Open Editor Drop Down Ctrl+X B In Windows

Previous Editor Shift+Ctrl+F6 In Windows

Previous Perspective Shift+Ctrl+F8 In Windows

Previous View Shift+Ctrl+F7 In Windows

Show Key Assist Shift+Ctrl+L In Dialogs&Windows Show Ruler Context Menu Ctrl+F10 Editing Text

Show System Menu Alt+­ In Windows

Show View Menu Ctrl+F10 In Windows

Switch to Editor Ctrl+X Ctrl+B In Windows

Switch to Editor Esc Ctrl+E In Windows

Références

Documents relatifs

endorses the arrangements proposed by the Administrative Committee on Co-ordination (paragraph 104 of 25th Report of ACC - Annex III) for joint consideration at the secretariat

Besides, monetary wages are also highly related to the academic resume and the individual scientific production (see for instance diamond swidler) In turn, as this scientific

Voici la solution pour les renvoyer à droite et retrouver le bouton &#34;menu&#34; à gauche!. Dans un terminal &#34;utilisateur&#34;,

This research aims to observe, detect and adapt co- variate shift on deep learning models using high-dimensional word embeddings, derived from a corpus of legal queries.. We

En astronomie, le décalage vers le rouge (ou redshift) est une augmentation de la longueur d'onde de la lumière causée par le mouvement de la source lumineuse qui

In this paper, we aim to introduce a basic development approach to produce MAS refactoring tools Then, we imple- ment a refactoring tool called as ReSeagent on Seagent MAS

Viele Versicherungsleute begreifen denn auch, dass es bei der Frage der Revision nicht um ein Gesetz der Versicherer, sondern um ein staatliches Gesetz geht, das alle

56 Um dies zu garantieren, müsste das Gesetz zum Beispiel auch verlangen, dass die allgemeinen Versiche- rungsbedingungen klar abgefasst, leicht lesbar, übersichtlich strukturiert