in modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/idea/WSDL2JavaOutputPanel.java [89:340]
private void init(){
txaHint =new JTextArea();
txaHint.setBorder(null);
txaHint.setFocusable(false);
txaHint.setLineWrap(true);
txaHint.setWrapStyleWord(true);
txaHint.setOpaque(false);
btnHint =new JButton("Hint >>");
btnHint.setBorder(new EmptyBorder(new Insets(0,0,0,0)));
lblMessage = new JLabel();
lblMessage.setOpaque(true);
lblMessage.setBackground(Color.white);
btnBrowseAxisHome =new JButton("Browse..");
btnBrowseOutput =new JButton("Browse..");
btnCheckLib =new JButton("Check Libs..");
cmbCurrentProject =new JComboBox();
cmbCurrentProject.setEnabled(false);
cmbModuleSrc=new JComboBox();
cmbModuleSrc.setEnabled(false);
txtoutput=new JTextField();
txtaxisHome =new JTextField("Unpacked Axis2 binary home Or Axis2 source location");
txtjarFileName =new JTextField();
txtaTilte =new JTextArea(title);
txtaTilte.setBorder(null);
txtaTilte.setFocusable(false);
txtaTilte.setLineWrap(true);
txtaTilte.setWrapStyleWord(true);
txtaTilte.setOpaque(false);
lblAsixHome=new JLabel("Axis2 Home");
lblAsixHome.setEnabled(false);
lblJarFileName = new JLabel("Jar File Name");
lblJarFileName.setEnabled(false);
lblDirectory= new JLabel("Select the Directory");
lblModule = new JLabel("Select the Module");
lbloutput =new JLabel("Out put path");
chbAddAxisCodegenJar =new JCheckBox("Add the Axis2 Codegen jars to the codegen resulted project");
chbAddAxisLib =new JCheckBox(" Add Axis2 libraries to the codegen result project ");
chbCreateJar=new JCheckBox(" Create a jar file of codegen result project and add to resulted project lib folder(Default :CodegenResults.jar)");
radCurrentProject =new JRadioButton("Browse and select a project on current idea workspace",false);
radCustomLocation =new JRadioButton("Browse and select location on local file system",true);
ButtonGroup buttonGroup= new ButtonGroup();
buttonGroup.add(radCurrentProject );
buttonGroup.add(radCustomLocation);
codegenBean.setProject(project);
setNextButtonEnabled(false);
this.setLayout(new GridBagLayout() );
this.add(txtaTilte
, new GridBagConstraints(0, 0, GridBagConstraints.REMAINDER , 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 0,10), 0, 0));
this.add(radCurrentProject
, new GridBagConstraints(0, 1, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0,10), 0, 0));
radCurrentProject.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
cmbCurrentProject.setEnabled(true);
cmbModuleSrc.setEnabled(true);
txtoutput.setEnabled(false);
btnBrowseOutput.setEnabled(false);
loadCmbCurrentProject();
loadcmbModuleSrcProject();
setFinishButtonEnabled(true);
update();
}
});
this.add(lblModule
, new GridBagConstraints(0, 2, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0, 0), 0, 0));
this.add(cmbCurrentProject
, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 0, 0,0), 0, 0));
cmbCurrentProject.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
loadcmbModuleSrcProject();
update();
}
});
this.add(lblDirectory
, new GridBagConstraints(0, 3, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0, 0), 0, 0));
this.add(cmbModuleSrc
, new GridBagConstraints(1, 3, 1, 1, 1.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 0, 0,0), 0, 0));
cmbModuleSrc.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
update();
}
});
this.add(radCustomLocation
, new GridBagConstraints(0, 4, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 0,10), 0, 0));
radCustomLocation.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
cmbCurrentProject.setEnabled(false);
cmbModuleSrc.setEnabled(false);
txtoutput.setEnabled(true);
btnBrowseOutput.setEnabled(true);
setEnabledForCustomProject();
update();
}
});
this.add(lbloutput
, new GridBagConstraints(0, 5, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0,0), 0, 0));
this.add(txtoutput
, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 0, 0,0), 0, 0));
this.add(btnBrowseOutput
, new GridBagConstraints(2, 5, 1, 1, 0.1, 0.0
, GridBagConstraints.EAST , GridBagConstraints.NONE
, new Insets(5, 0, 0,10), 0, 0));
btnBrowseOutput .addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DirChooser .setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = DirChooser.showOpenDialog(btnBrowseOutput );
if (returnVal == JFileChooser.APPROVE_OPTION) {
DirChooser.setFileSelectionMode(JFileChooser .FILES_ONLY );
File newfile = DirChooser.getSelectedFile();
txtoutput.setText(newfile.getAbsolutePath() );
}
setFinishButtonEnabled(true);
update();
}
});
this.add(chbAddAxisCodegenJar
, new GridBagConstraints(0, 6, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 0,10), 0, 0));
chbAddAxisCodegenJar.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
update();
}
});
this.add(new JSeparator()
, new GridBagConstraints(0, 7, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 0,1), 0, 0));
this.add(chbAddAxisLib
, new GridBagConstraints(0, 8, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 0,10), 0, 0));
chbAddAxisLib .addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
setEnabledForAddAxisLib();
handleLoadLibsBrowse();
update();
}
});
this.add(lblAsixHome
, new GridBagConstraints(0, 9, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0,10), 0, 0));
this.add(txtaxisHome
, new GridBagConstraints(1, 9, 1, 1, 1.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 0, 0,0), 0, 0));
this.add(btnBrowseAxisHome
, new GridBagConstraints(2, 9, 1, 1, 0.1, 0.0
, GridBagConstraints.EAST , GridBagConstraints.NONE
, new Insets(5, 0, 0,10), 0, 0));
btnBrowseAxisHome .addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DirChooser .setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = DirChooser.showOpenDialog(btnBrowseAxisHome );
if (returnVal == JFileChooser.APPROVE_OPTION) {
DirChooser.setFileSelectionMode(JFileChooser .FILES_ONLY );
File newfile = DirChooser.getSelectedFile();
txtaxisHome .setText(newfile.getAbsolutePath() );
}
update();
}
});
this.add(btnCheckLib
, new GridBagConstraints(0, 10, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0,10), 0, 0));
btnCheckLib .addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
handleLoadLibsBrowse();
update();
}
});
this.add(lblMessage
, new GridBagConstraints(1, 10, 1, 1, 1.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 0, 0,0), 0, 0));
this.add(new JSeparator()
, new GridBagConstraints(0, 11, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 0,1), 0, 0));
this.add(chbCreateJar
, new GridBagConstraints(0, 12, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 0,10), 0, 0));
chbCreateJar.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
update();
}
});
this.add(lblJarFileName
, new GridBagConstraints(0, 13, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0,10), 0, 0));
this.add(txtjarFileName
, new GridBagConstraints(1, 13,1, 1, 1.0, 0.0
, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL
, new Insets(5, 0, 0,0), 0, 0));
this.add(new JSeparator()
, new GridBagConstraints(0, 14, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 0,1), 0, 0));
// hint button
this.add(btnHint,
new GridBagConstraints(0,15, 1, 1, 0.1,0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 20, 0,0), 0, 0));
btnHint.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(flag){
btnHint.setText("Hint >>");
txaHint.setText("");
flag=false;
}else{
btnHint.setText("Hint <<");
txaHint.setText(hint);
flag=true;
}
update();
}
});
// hint lable
this.add(txaHint,
new GridBagConstraints(0, 16, GridBagConstraints.REMAINDER, 1, 0.1, 1.0
, GridBagConstraints.NORTHWEST , GridBagConstraints.BOTH
, new Insets(10, 20, 0,0), 0, 0));
update();
}