Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) 2014 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany.
   * All rights reserved. This program and the accompanying materials
   * are made available under the terms of the Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)
   * which accompanies this distribution, and is available at http://creativecommons.org/licenses/by-nd/4.0/
   *
   * Contributors:
   *      Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany - RMI Client, FileChooser and WebDAV
   */
 package de.ipk_gatersleben.bit.bi.edal.rmi.client.gui.editor;
 
 import java.util.List;
 
 
The EdalLanguageDialog can be used to edit EdalLanguage, which implements the MetadataeditDialog class, we can use it with a couple of lines of code:

 EdalLanguageDialog languageDialog = new EdalLanguageDialog(language);
 languageDialog.showOpenDialog();
 

Author(s):
Jinbo Chen
Version:
1.0
 
 public class EdalLanguageDialog extends MetaDataEditDialog {
 	private static final long serialVersionUID = 1L;
 	private JLabel languagelabel;
 	private EdalLanguage language;
 	private Locale[] availableLocales;
 
 	public EdalLanguageDialog(EdalLanguage languageString title) {
 		super();
 		this. = language;
 		setTitle(title);
 		JPanel contents = (JPanelgetContentPane();
 		contents.setLayout(new BorderLayout());
 
 		final JPanel editPane = new JPanel();
 		final GridBagLayout gridbag = new GridBagLayout();
 		editPane.setLayout(gridbag);
 
 
 		 = new JLabel("Language:");
 		c.fill = .;
 		c.gridx = 0;
 		c.gridy = 0;
 		c.gridheight = 1;
 		c.gridwidth = 1;
 		c.weightx = 0;
 		editPane.add();
 
 		List<Stringlanguagelist = new ArrayList<String>();
 		List<Stringdisplaylanguagelist = new ArrayList<String>();
 		for (Locale locale : ) {
 			languagelist.add(locale.getLanguage());
 			displaylanguagelist.add(locale.getDisplayName());
 		}
 
 		final String languagelabels[] = displaylanguagelist
 				.toArray(new String[0]);
 		final DefaultComboBoxModel<Stringlanguagemodel = new DefaultComboBoxModel<String>(
 				languagelabels);
 		 = new JComboBox<String>(languagemodel);
 
 		c.fill = .;
 		c.gridx = 1;
 		c.gridy = 0;
 		c.gridheight = 1;
 		c.gridwidth = 2;
 		c.weightx = 1.0;
 		editPane.add();
 
 		contents.add(editPane.);
 
		this.setMinimumSize(new Dimension(280, (int) (280 * 0.618)));
	}
	public void initdata() {
		if ( != null) {
			for (int i = 0; i < .i++) {
					break;
				}
			}
		}
	}

Returns the EdalLanguage inputted by user.

Returns:
the EdalLanguage inputted by user.
		return new EdalLanguage(
	}
New to GrepCode? Check out our FAQ X