IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SWT/JFace Java Discussion :

ouverture d une Dialog


Sujet :

SWT/JFace Java

  1. #1
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut ouverture d une Dialog
    Hello,

    J ai un petit soucie lors de l ouverture de mon dialog, j obtiens une exception :

    argument cannot be null juste après la méthode configureShell

    Il semble que la méthode createClientArea ne soit jamais appeller

    voici le code de ma classe

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
     
    public class CreateImageDialog extends Dialog{
     
    	/** The title of the dialog.*/
    	private String title;
     
    	/** The folder text. */
    	private static final String FOLDER_TITLE = "Folder : ";
     
    	/** The file name text. */
    	private static final String FILENAME_TITLE = "File name : ";
     
    	/** The image format text. */
    	private static final String IMAGE_FORMAT_TITLE = "Image format : ";
        /**
         * Constructor
         * 
         * @param parent
         *                  The parent window
         * @param title
         *                  The title of the dialog
         * @param style
         *                  The style of the dialog
         */
    	public CreateImageDialog(Shell parent, String title){
        	super(parent);
        }
     
    	/**
             * Configures the shell.
             * 
             * @param shell
             *              The shell to configure
             */
    	@Override
    	protected void configureShell(Shell shell) {
    		super.configureShell(shell);
    		shell.setText(title);
    	}
     
    	  /**
               * Creates and returns the contents of the upper part of this dialog.
               * This implementation creates a labeled text field for the URI(s) and buttons for browsing the
               * file system and workspace. These buttons are configured (selection listeners are added) by calling
               * {@link #prepareBrowseFileSystemButton} and {@link #prepareBrowseWorkspaceButton}, respectively.
               */
    	  @Override
    	 protected Control createDialogArea(Composite parent) {
    	    Composite composite = (Composite)super.createDialogArea(parent);
    	    Label labelFolder = new Label(composite,SWT.NONE);	    
    	    labelFolder.setText(FOLDER_TITLE);
    	    labelFolder.setBounds(0,0,45,20);
    	    Text inputFolder = new Text(composite, SWT.SINGLE);
    	    inputFolder.setBounds(50,0,120,20);
    	    return composite;
    	 }
     
     
    }
    et l appelle a cette classe :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    	/**
             * Runs the action. This creates the image file.
             */
    	public void run() {
    		CreateImageDialog dialog = new CreateImageDialog(Display.getCurrent().getActiveShell(),"Save As Image File");
    		dialog.open();
    		// Find the Figure to draw as an image
    		GraphicalViewer viewer = (GraphicalViewer) workbenchPart.getAdapter(GraphicalViewer.class);
    		ScalableRootEditPart editPart = (ScalableRootEditPart) viewer.getContents().getRoot();
    ...
    Quelqu un voit il de quoi ca peut venir ?

    merci

  2. #2
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    c était tout betement title qui n a pas été affecté

    sorry du post

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Lenteur d'ouverture d'une Dialog
    Par kkt8 dans le forum SWT/JFace
    Réponses: 8
    Dernier message: 06/06/2012, 11h12
  2. Erreur lors de l'ouverture d'une boite de dialog
    Par kitue dans le forum C++Builder
    Réponses: 5
    Dernier message: 12/11/2009, 15h51
  3. [Dojo] Executer un Dialog Box à l'ouverture d'une page
    Par khattat dans le forum Bibliothèques & Frameworks
    Réponses: 8
    Dernier message: 27/03/2009, 18h02
  4. Pop-up d'une dialog box a partir d'un bouton
    Par bobbyjack dans le forum MFC
    Réponses: 21
    Dernier message: 13/09/2005, 15h32
  5. ouverture d'une form en fondu transparent
    Par nicholz dans le forum Composants VCL
    Réponses: 9
    Dernier message: 08/01/2003, 11h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo