core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/discovery/ui/view/DiscoveryView.java
equal
deleted
inserted
replaced
7 import java.io.InputStream; |
7 import java.io.InputStream; |
8 import java.net.URI; |
8 import java.net.URI; |
9 import java.net.URISyntaxException; |
9 import java.net.URISyntaxException; |
10 import java.net.URL; |
10 import java.net.URL; |
11 import java.text.MessageFormat; |
11 import java.text.MessageFormat; |
|
12 import java.util.ArrayList; |
12 import java.util.Collection; |
13 import java.util.Collection; |
13 import java.util.HashSet; |
14 import java.util.HashSet; |
14 import java.util.List; |
15 import java.util.List; |
15 import java.util.Properties; |
16 import java.util.Properties; |
16 import java.util.Set; |
17 import java.util.Set; |
168 viewer.setSelection(getAllItemsSelection()); |
169 viewer.setSelection(getAllItemsSelection()); |
169 viewer.refresh(); |
170 viewer.refresh(); |
170 } |
171 } |
171 |
172 |
172 private IStructuredSelection getAllItemsSelection() { |
173 private IStructuredSelection getAllItemsSelection() { |
173 List<CatalogItem> catalogItems = viewer.getCatalog().getItems(); |
174 List<CatalogItem> catalogItems = new ArrayList<CatalogItem>(); |
|
175 for (CatalogItem catalogItem : viewer.getCatalog().getItems()) { |
|
176 if (!catalogItem.isInstalled()) |
|
177 catalogItems.add(catalogItem); |
|
178 } |
174 return new StructuredSelection(catalogItems); |
179 return new StructuredSelection(catalogItems); |
175 } |
180 } |
176 |
181 |
177 protected boolean updateSelection(IStructuredSelection selection) { |
182 protected boolean updateSelection(IStructuredSelection selection) { |
178 return !getAllItemsSelection().equals(selection); |
183 return !getAllItemsSelection().equals(selection); |