use of org.jdom.Element in project intellij-community by JetBrains.
the class WorkingContextManager method saveContext.
public void saveContext(Element toElement) {
for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) {
try {
Element child = new Element(provider.getId());
provider.saveContext(child);
toElement.addContent(child);
} catch (WriteExternalException e) {
LOG.error(e);
}
}
}
use of org.jdom.Element in project intellij-community by JetBrains.
the class XDebuggerBreakpointsContextProvider method saveContext.
@Override
public void saveContext(Element toElement) throws WriteExternalException {
XBreakpointManagerImpl.BreakpointManagerState state = myBreakpointManager.getState();
Element serialize = XmlSerializer.serialize(state, new SerializationFilter() {
@Override
public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) {
return accessor.read(bean) != null;
}
});
toElement.addContent(serialize.removeContent());
}
use of org.jdom.Element in project intellij-community by JetBrains.
the class XDebuggerWatchesProvider method saveContext.
@Override
public void saveContext(Element toElement) throws WriteExternalException {
XDebuggerWatchesManager.WatchesManagerState state = myWatchesManager.getState();
Element serialize = XmlSerializer.serialize(state, new SerializationFilter() {
@Override
public boolean accepts(@NotNull Accessor accessor, @NotNull Object bean) {
return accessor.read(bean) != null;
}
});
toElement.addContent(serialize.removeContent());
}
use of org.jdom.Element in project intellij-community by JetBrains.
the class TaskManagerImpl method loadState.
public void loadState(Config config) {
XmlSerializerUtil.copyBean(config, myConfig);
myRepositories.clear();
Element element = config.servers;
List<TaskRepository> repositories = loadRepositories(element);
myRepositories.addAll(repositories);
myTasks.clear();
for (LocalTaskImpl task : config.tasks) {
if (task.getRepository() == null) {
// restore repository from url
String url = task.getIssueUrl();
if (url != null) {
for (TaskRepository repository : repositories) {
if (repository.getUrl() != null && url.startsWith(repository.getUrl())) {
task.setRepository(repository);
}
}
}
}
addTask(task);
}
}
use of org.jdom.Element in project intellij-community by JetBrains.
the class JiraLegacyApi method processRSS.
private List<Task> processRSS(@NotNull GetMethod method) throws Exception {
// Basic authorization should be enough
int code = myRepository.getHttpClient().executeMethod(method);
if (code != HttpStatus.SC_OK) {
throw new Exception(TaskBundle.message("failure.http.error", code, method.getStatusText()));
}
Element root = new SAXBuilder(false).build(method.getResponseBodyAsStream()).getRootElement();
Element channel = root.getChild("channel");
if (channel != null) {
List<Element> children = channel.getChildren("item");
LOG.debug("Total issues in JIRA RSS feed: " + children.size());
return ContainerUtil.map(children, element -> new JiraSoapTask(element, myRepository));
} else {
LOG.warn("JIRA channel not found");
}
return ContainerUtil.emptyList();
}
Aggregations