This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Custom code
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 04, 2011
07:40 AM
Custom code
Hi
I wrote one custom code to validate one existing directory.It will be like below.
import com.zerog.ia.api.pub.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
/**
*
* @author nkhuntia
*/
public class DirectoryValidation extends CustomCodePanel implements ActionListener {
private boolean inited = false;
private JLabel label, label1, label2, label3;
JRadioButton yesButton;
JRadioButton noButton;
GUIAccess gui;
boolean approve = false;
//@Override
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy)
{
String def = customCodePanelProxy.substitute("$USER_INSTALL_DIR$");
label= new JLabel("Confirm directory removal.");
label1 = new JLabel("The directory " + def + " and all its contents will be deleted.");
label2 = new JLabel("NOTE: This step will not delete the Repository.");
label3 = new JLabel("Are you sure you want to continue?");
// Use a boolean flag here to prevent duplicate GUI elements.
if (inited == true)
return true;
inited = true;
setLayout (new GridLayout(10, 1, 5, 3));
label.setPreferredSize(new Dimension(15, 20));
add(label);
add(new Label());
add(label1);
add(new Label());
add(label2);
add(label3);
ButtonGroup group = new ButtonGroup();
yesButton = new JRadioButton("Approve" , false);
noButton = new JRadioButton("DisApprove" , true);
add(new Label());
add(yesButton);
add(noButton);
group.add(yesButton);
group.add(noButton);
return inited;
}
So here I am getting some issue....
SO once this is getting initialized I am not able to reinitialized the "def" variable.
If I removed the return "init" variable then while I am going back and returning back whole things getting messed up. So could u plz tell me how to resolve this issue.
Thanks
Nihar
I wrote one custom code to validate one existing directory.It will be like below.
import com.zerog.ia.api.pub.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
/**
*
* @author nkhuntia
*/
public class DirectoryValidation extends CustomCodePanel implements ActionListener {
private boolean inited = false;
private JLabel label, label1, label2, label3;
JRadioButton yesButton;
JRadioButton noButton;
GUIAccess gui;
boolean approve = false;
//@Override
public boolean setupUI(CustomCodePanelProxy customCodePanelProxy)
{
String def = customCodePanelProxy.substitute("$USER_INSTALL_DIR$");
label= new JLabel("Confirm directory removal.");
label1 = new JLabel("The directory " + def + " and all its contents will be deleted.");
label2 = new JLabel("NOTE: This step will not delete the Repository.");
label3 = new JLabel("Are you sure you want to continue?");
// Use a boolean flag here to prevent duplicate GUI elements.
if (inited == true)
return true;
inited = true;
setLayout (new GridLayout(10, 1, 5, 3));
label.setPreferredSize(new Dimension(15, 20));
add(label);
add(new Label());
add(label1);
add(new Label());
add(label2);
add(label3);
ButtonGroup group = new ButtonGroup();
yesButton = new JRadioButton("Approve" , false);
noButton = new JRadioButton("DisApprove" , true);
add(new Label());
add(yesButton);
add(noButton);
group.add(yesButton);
group.add(noButton);
return inited;
}
So here I am getting some issue....
SO once this is getting initialized I am not able to reinitialized the "def" variable.
If I removed the return "init" variable then while I am going back and returning back whole things getting messed up. So could u plz tell me how to resolve this issue.
Thanks
Nihar
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 04, 2011
10:19 AM
So basically you want to remove a folder based on a certain condition? Maybe it's easier to do it with native IA methods?