info.name = repository.getName(); info.description = repository.getDescription(); info.location = repository.getLocation();
info.name = repository.getName(); info.description = repository.getDescription(); info.location = repository.getLocation();
String name = ((IRepository<?>) obj).getName(); if (name != null && name.length() > 0) { return name;
public String getColumnText(Object element, int columnIndex) { switch (columnIndex) { case COL_NAME : if (element instanceof IRepositoryElement<?>) { String name = ((IRepositoryElement<?>) element).getName(); if (name != null) { return name; } } if (element instanceof IRepository<?>) { String name = ((IRepository<?>) element).getName(); if (name != null) { return name; } } return ""; //$NON-NLS-1$ case COL_LOCATION : if (element instanceof IRepository<?>) { return TextProcessor.process(URIUtil.toUnencodedString(((IRepository<?>) element).getLocation())); } if (element instanceof IRepositoryElement<?>) { return TextProcessor.process(URIUtil.toUnencodedString(((IRepositoryElement<?>) element).getLocation())); } break; case COL_ENABLEMENT : if (element instanceof MetadataRepositoryElement) return ((MetadataRepositoryElement) element).isEnabled() ? ProvUIMessages.RepositoryDetailsLabelProvider_Enabled : ProvUIMessages.RepositoryDetailsLabelProvider_Disabled; } return null; }
private void remember(IRepository<T> repository, String suffix) { boolean changed = false; Preferences node = getPreferences(); // Ensure we retrieved preferences if (node == null) return; node = node.node(getKey(repository.getLocation())); try { changed |= putValue(node, KEY_URI, repository.getLocation().toString()); changed |= putValue(node, KEY_URL, null); changed |= putValue(node, KEY_DESCRIPTION, repository.getDescription()); changed |= putValue(node, KEY_NAME, repository.getName()); changed |= putValue(node, KEY_PROVIDER, repository.getProvider()); changed |= putValue(node, KEY_TYPE, repository.getType()); changed |= putValue(node, KEY_VERSION, repository.getVersion()); //allow repository manager to define system property if it is undefined in the repository itself String value = repository.getProperties().get(IRepository.PROP_SYSTEM); if (value != null) changed |= putValue(node, KEY_SYSTEM, value); changed |= putValue(node, KEY_SUFFIX, suffix); if (changed) saveToPreferences(); } catch (IllegalStateException e) { //the repository was removed concurrently, so we don't need to save it } }
private void remember(IRepository<T> repository, String suffix) { boolean changed = false; Preferences node = getPreferences(); // Ensure we retrieved preferences if (node == null) return; node = node.node(getKey(repository.getLocation())); try { changed |= putValue(node, KEY_URI, repository.getLocation().toString()); changed |= putValue(node, KEY_URL, null); changed |= putValue(node, KEY_DESCRIPTION, repository.getDescription()); changed |= putValue(node, KEY_NAME, repository.getName()); changed |= putValue(node, KEY_PROVIDER, repository.getProvider()); changed |= putValue(node, KEY_TYPE, repository.getType()); changed |= putValue(node, KEY_VERSION, repository.getVersion()); //allow repository manager to define system property if it is undefined in the repository itself String value = repository.getProperties().get(IRepository.PROP_SYSTEM); if (value != null) changed |= putValue(node, KEY_SYSTEM, value); changed |= putValue(node, KEY_SUFFIX, suffix); if (changed) saveToPreferences(); } catch (IllegalStateException e) { //the repository was removed concurrently, so we don't need to save it } }