private List getCatalogElements(int type) { List result = new ArrayList(); ICatalogElement[] elements = (ICatalogElement[]) catalogElements .toArray(new ICatalogElement[catalogElements.size()]); for (int i = 0; i < elements.length; i++) { ICatalogElement element = elements[i]; if (element.getType() == type) { result.add(element); } } return result; }
protected ICatalogEntry getEntry() { if (catalogEntry == null) { if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_ENTRY)) { catalogEntry = (ICatalogEntry) fCatalogElement; } else { if (catalog != null) { catalogEntry = (ICatalogEntry) catalog.createCatalogElement(ICatalogElement.TYPE_ENTRY); } } } return catalogEntry; }
protected INextCatalog getNextCatalog() { if (nextCatalog == null) { if ((fCatalogElement != null) && (fCatalogElement.getType() == ICatalogElement.TYPE_NEXT_CATALOG)) { nextCatalog = (INextCatalog) fCatalogElement; } else { if (catalog != null) { nextCatalog = (INextCatalog) catalog.createCatalogElement(ICatalogElement.TYPE_NEXT_CATALOG); } } } return nextCatalog; }
InternalResolver() { for (Iterator i = catalogElements.iterator(); i.hasNext();) { ICatalogElement catalogElement = (ICatalogElement) i.next(); if (catalogElement.getType() == ICatalogElement.TYPE_ENTRY) { ICatalogEntry entry = (ICatalogEntry) catalogElement; Map map = getEntryMap(entry.getEntryType()); map.put(entry.getKey(), entry); } } }
protected Composite createMainComponent(Composite composite) { if (fCatalogElement != null) // "edit" action { Composite composite1 = new Composite(composite, SWT.NONE); GridData data = new GridData(GridData.FILL_BOTH); composite1.setLayoutData(data); GridLayout layout = new GridLayout(); composite1.setLayout(layout); pageContainer = new PageBook(composite1, SWT.NONE); pageContainer.setLayoutData(new GridData(GridData.FILL_BOTH)); if (fCatalogElement.getType() == ICatalogElement.TYPE_ENTRY) { CatalogElementPage entryPage = new CatalogEntryPage(); entryPage.createControl(pageContainer); showPage(entryPage); } else if (fCatalogElement.getType() == ICatalogElement.TYPE_NEXT_CATALOG) { CatalogElementPage nextCatalogPage = new NextCatalogPage(); nextCatalogPage.createControl(pageContainer); showPage(nextCatalogPage); } return composite1; } return createMainComponentWithToolbar(composite); }