JTree buildConfig_tree = new JTree();
public void openFile(String configFile) throws IOException, InvalidResourceException {
try {
if (configFile == null) {
Message msg = new Message("No structure is selected for editing.",IMessage.ERROR,null,null);
Ajde.getDefault().getMessageHandler().handleMessage(msg);
return;
}
// this.configFile = configFile;
// sourcePath = new File(new File(configFile).getParent());
jbInit();
jLabel1.setText(" Build configuration: " + configFile);
model = Ajde.getDefault().getBuildConfigManager().buildModel(configFile);
root = buildTree(model.getRoot());
buildConfig_tree.setModel(new DefaultTreeModel(root));
buildConfig_tree.addMouseListener(new ConfigFileMouseAdapter(buildConfig_tree));
buildConfig_tree.setCellRenderer(new ConfigTreeCellRenderer());
for (int j = 0; j < buildConfig_tree.getRowCount(); j++) {
buildConfig_tree.expandPath(buildConfig_tree.getPathForRow(j));
}
} catch(Exception e) {
Message msg = new Message("Could not open file.",IMessage.ERROR,e,null);
Ajde.getDefault().getMessageHandler().handleMessage(msg);
}
}