if (Preferences.getBooleanPref("verifier")) {
treeNode.appendChild(analysis);
}
scenarios.addListener(new TreeNodeListenerAdapter() {
public void onExpand(Node node) {
RepositoryServiceFactory.getService().listPackages(new GenericCallback<PackageConfigData[]>() {
public void onSuccess(PackageConfigData[] conf) {
for (int i = 0; i < conf.length; i++) {
final PackageConfigData c = conf[i];
TreeNode pkg = new TreeNode();
pkg.setText(c.name);
pkg.setIcon("images/package.gif"); //NON-NLS
scenarios.appendChild(pkg);
pkg.addListener(new TreeNodeListenerAdapter() {
public void onClick(Node node, EventObject e) {
if (!centerPanel.showIfOpen("scenarios" + c.uuid)) { //NON-NLS
String m = Format.format(constants.ScenariosForPackage(), c.name);
centerPanel.addTab(m, true, new ScenarioPackageView(
c.uuid, c.name, edit, centerPanel ), "scenarios" + c.uuid); //NON-NLS
}
}
});
}
scenarios.removeChild(scenarios.getFirstChild());
}
});
}
public void onCollapse(Node node) {
Node[] cs = node.getChildNodes();
for (int i = 0; i < cs.length; i++) {
node.removeChild(cs[i]);
}
node.appendChild(new TreeNode(constants.PleaseWaitDotDotDot()));
}
});
analysis.addListener(new TreeNodeListenerAdapter() {
public void onExpand(Node node) {
RepositoryServiceFactory.getService().listPackages(new GenericCallback<PackageConfigData[]>() {
public void onSuccess(PackageConfigData[] conf) {
for (int i = 0; i < conf.length; i++) {
final PackageConfigData c = conf[i];
TreeNode pkg = new TreeNode();
pkg.setText(c.name);
pkg.setIcon("images/package.gif"); //NON-NLS
analysis.appendChild(pkg);
pkg.addListener(new TreeNodeListenerAdapter() {
public void onClick(Node node, EventObject e) {
if (!centerPanel.showIfOpen("analysis" + c.uuid)) { //NON-NLS
String m = Format.format(constants.AnalysisForPackage(), c.name);
centerPanel.addTab(m, true, new AnalysisView(c.uuid, c.name), "analysis" + c.uuid); //NON-NLS
}