public void refreshModuleList() { if (!pageReady) { new UIJob(I18n.get("job")) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { refreshModuleList(); return Status.OK_STATUS; } }.schedule(); return; } modulesTable.removeAll(); for (ImportedModule module : parent.getConfiguration().getModules()) { TableItem item = new TableItem(modulesTable, NONE); item.setText(module.toString()); System.out.println(module.toString()); /* * TODO: populate table with module names */ } if (parent.getConfiguration().getModules().length > 0) { setPageComplete(true); } }
public void parsePath(File directory) { parent.getConfiguration().clearModules(); apps.clear(); lookForAppFolder(directory); if (apps.size() == 0) { new UIJob(I18n.get("ejjoj")) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { setMessage(I18n.get("no_app_folders")); return Status.OK_STATUS; } }.schedule(); } else if (apps.size() > 1) { new UIJob(I18n.get("ejjoj")) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { setErrorMessage(I18n.get("multiple_app_folders")); return Status.OK_STATUS; } }.schedule(); } else { File app = apps.get(0); StringBuilder path = new StringBuilder(app.getAbsolutePath()); if (path.charAt(path.length() - 1) != '/') { path.append('/'); } path.append(FolderHelper.ETC_FOLDER); path.append('/'); path.append(FolderHelper.MODULES_FOLDER); System.out.println(path.toString()); File modules = new File(path.toString()); if (modules.isDirectory()) { File[] moduleList = modules.listFiles(); if (moduleList != null) { for (File module : moduleList) { ImportedModule[] imported = ImportedModule.parseXmlFile(module, app); for (ImportedModule impModule : imported) { parent.getConfiguration().addModule(impModule); } } } } new UIJob(I18n.get("ejjoj")) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { setErrorMessage(null); setMessage(null); return Status.OK_STATUS; } }.schedule(); } new UIJob(I18n.get("refresh")) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { refreshModuleList(); return Status.OK_STATUS; } }.schedule(); }