private void populateModel() {
IServerWorkingCopy workingCopy = getServerWorkingCopy();
if (model != null && workingCopy != null) {
// workCopy will be instance of ServerDelegate classs.
// We need to get the params, so IFuseESBRuntime will be enough.
IKarafServerDelegate karafServerWorkingCopy = (IKarafServerDelegate) workingCopy.loadAdapter(IKarafServerDelegate.class, new NullProgressMonitor());
if (karafServerWorkingCopy != null) {
model.setUserName(karafServerWorkingCopy.getUserName());
model.setPassword(karafServerWorkingCopy.getPassword());
}
boolean readFromConfFile = false;
IRuntime runtime = getRuntimeWorkingCopy();
if (runtime != null){
IKarafRuntime karafRuntime = (IKarafRuntime)runtime.loadAdapter(IKarafRuntime.class, null);
if (karafRuntime != null ) {
if("".equals(model.getKarafInstallDir()) || model.getKarafInstallDir() == null){
model.setKarafInstallDir(karafRuntime.getLocation().toOSString());
}
}
}
if (!readFromConfFile && karafServerWorkingCopy != null) {
model.setPortNumber(karafServerWorkingCopy.getPortNumber());
}
}
}