in modules/tool/axis2-idea-plugin/src/main/java/org/apache/axis2/tools/java2wsdl/MiddlePanel.java [83:243]
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)));
btnFolder=new JButton("Add Folder");
btnJar=new JButton("Add Jar");
btnRemove=new JButton("Remove");
btnTest=new JButton("Test Class Loading");
txtClass =new JTextField();
lblTest= new JLabel();
listModel =new DefaultListModel();
listPathDisply =new JList(listModel);
listPathDisply.setAutoscrolls(true);
listPathDisply.setOpaque(false);
listPathDisply.setBorder(BorderFactory.createBevelBorder(1) );
listPathDisply.setFocusable(false);
setBackButtonEnabled(true);
setNextButtonEnabled(false);
setFinishButtonEnabled(false);
setPageComplete(false);
this.setLayout(new GridBagLayout());
this.add(new JLabel("Fully Qualified Class Name :")
, new GridBagConstraints(0, 0, 1, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0,10), 0, 0));
this.add(txtClass
, new GridBagConstraints(1, 0, GridBagConstraints.REMAINDER, 1, 1.0, 0.0
, GridBagConstraints.CENTER , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 0, 10), 0, 0));
this.add(new JLabel("java class path Entries.select either folders or jar files ")
, new GridBagConstraints(0, 1, GridBagConstraints.REMAINDER, 1,0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 0,10), 0, 0));
this.add(btnFolder
, new GridBagConstraints(0, 2, 1, 1, 0.1, 0.0
, GridBagConstraints.CENTER , GridBagConstraints.HORIZONTAL
, new Insets(5,10, 1,1), 0, 0));
btnFolder.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DirChooser .setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = DirChooser.showOpenDialog(btnFolder );
if (returnVal == JFileChooser.APPROVE_OPTION) {
DirChooser.setFileSelectionMode(JFileChooser .FILES_ONLY );
File newfile = DirChooser.getSelectedFile();
listModel.addElement(newfile.getAbsolutePath() );
setDefaultPathAndName(newfile );
updateStatusTextField( false,"");
}
update();
}
});
this.add(btnJar
, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0
, GridBagConstraints.CENTER , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 1,1), 0, 0));
btnJar.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooser.setFileFilter(new JarFileFilter() );
int returnVal= FileChooser.showOpenDialog(btnJar);
if(returnVal == JFileChooser .APPROVE_OPTION ){
File file = FileChooser.getSelectedFile();
listModel.addElement(file.getAbsolutePath() );
setDefaultPathAndName(file );
updateStatusTextField( false,"");
}
update();
}
});
this.add(btnRemove
, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0
, GridBagConstraints.CENTER , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 1,10), 0, 0));
btnRemove.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
handleRemove();
update();
}
});
this.add(new JScrollPane(listPathDisply)
, new GridBagConstraints(0, 3, GridBagConstraints.REMAINDER, 1, 0.1, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 1,10), 0, 0));
this.add(btnTest
, new GridBagConstraints(0, 4, 1, 1, 0.1, 0.0
, GridBagConstraints.CENTER , GridBagConstraints.HORIZONTAL
, new Insets(5, 10, 1,1), 0, 0));
btnTest.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(!testLoading()){
setBackButtonEnabled(true);
setNextButtonEnabled(false);
setFinishButtonEnabled(false);
}else {
setBackButtonEnabled(true);
setNextButtonEnabled(true);
setFinishButtonEnabled(false);
wsdlgenBean.setClassPathList(getClassPathlist());
wsdlgenBean.setClassName(txtClass.getText().trim() );
setPageComplete(true);
}
update();
}
});
this.add(lblTest
, new GridBagConstraints(1, 4, GridBagConstraints.REMAINDER, 1, 1.0, 0.0
, GridBagConstraints.CENTER , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 1,10), 0, 0));
this.add(new JSeparator()
, new GridBagConstraints(0, 5, GridBagConstraints.REMAINDER, 1, 0.0, 0.0
, GridBagConstraints.WEST , GridBagConstraints.HORIZONTAL
, new Insets(5, 1, 1,1), 0, 0));
this.add(btnHint,
new GridBagConstraints(0, 6, 1, 1, 0.1,0.0
, GridBagConstraints.WEST , GridBagConstraints.NONE
, new Insets(5, 10, 0, 10), 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();
}
});
this.add(txaHint
, new GridBagConstraints(0, 7, GridBagConstraints.REMAINDER, 1, 0.1,1.0
, GridBagConstraints.CENTER , GridBagConstraints.BOTH
, new Insets(5, 10, 10, 10), 0, 0));
}