public int compare(Object a, Object b) { return PropertySheetSorter.this.compareCategories( ((PropertySheetCategory) a).getCategoryName(), ((PropertySheetCategory) b).getCategoryName()); } });
@Override public int compare(Object a, Object b) { return PropertySheetSorter.this.compareCategories( ((PropertySheetCategory) a).getCategoryName(), ((PropertySheetCategory) b).getCategoryName()); } });
/** * Sorts the given categories in-place, modifying the given array. * * @param categories * the categories to sort */ void sort(PropertySheetCategory[] categories) { Arrays.sort(categories, (a, b) -> PropertySheetSorter.this.compareCategories(a.getCategoryName(), b.getCategoryName())); } }
/** * Returns the child entries of the given entry * @param entry The entry to search * * @return the children of the given entry (element type * <code>IPropertySheetEntry</code>) */ private List getChildren(IPropertySheetEntry entry) { // if the entry is the root and we are showing categories, and we have // more than the // defualt category, return the categories if (entry == rootEntry && isShowingCategories) { if (categories.length > 1 || (categories.length == 1 && !categories[0] .getCategoryName().equals( MISCELLANEOUS_CATEGORY_NAME))) { return Arrays.asList(categories); } } // return the sorted & filtered child entries return getSortedEntries(getFilteredEntries(entry.getChildEntries())); }
/** * Returns the child entries of the given entry * @param entry The entry to search * * @return the children of the given entry (element type * <code>IPropertySheetEntry</code>) */ private List<?> getChildren(IPropertySheetEntry entry) { // if the entry is the root and we are showing categories, and we have // more than the // defualt category, return the categories if (entry == rootEntry && isShowingCategories) { if (categories.length > 1 || (categories.length == 1 && !categories[0] .getCategoryName().equals( MISCELLANEOUS_CATEGORY_NAME))) { return Arrays.asList(categories); } } // return the sorted & filtered child entries return getSortedEntries(getFilteredEntries(entry.getChildEntries())); }
/** * Returns the child entries of the given entry * @param entry The entry to search * * @return the children of the given entry (element type * <code>IPropertySheetEntry</code>) */ private List getChildren(IPropertySheetEntry entry) { // if the entry is the root and we are showing categories, and we have // more than the // defualt category, return the categories if (entry == rootEntry && isShowingCategories) { if (categories.length > 1 || (categories.length == 1 && !categories[0] .getCategoryName().equals( MISCELLANEOUS_CATEGORY_NAME))) { return Arrays.asList(categories); } } // return the sorted & filtered child entries return getSortedEntries(getFilteredEntries(entry.getChildEntries())); }
for (int i = 0; i < categories.length; i++) { categories[i].removeAllEntries(); categoryCache.put(categories[i].getCategoryName(), categories[i]);
for (PropertySheetCategory categorie : categories) { categorie.removeAllEntries(); categoryCache.put(categorie.getCategoryName(), categorie);
for (PropertySheetCategory categorie : categories) { categorie.removeAllEntries(); categoryCache.put(categorie.getCategoryName(), categorie);
/** * Update the category (but not its parent or children). * * @param category * the category to update * @param item * the tree item for the given entry */ private void updateCategory(PropertySheetCategory category, TreeItem item) { // ensure that backpointer is correct item.setData(category); // Update the map accordingly entryToItemMap.put(category, item); // Update the name and value columns item.setText(0, category.getCategoryName()); item.setText(1, ""); //$NON-NLS-1$ // update the "+" icon if (category.getAutoExpand()) { // we auto expand categories when they first appear createChildren(item); item.setExpanded(true); category.setAutoExpand(false); } else { // we do not want to auto expand categories if the user has // collpased them updatePlus(category, item); } }
/** * Update the category (but not its parent or children). * * @param category * the category to update * @param item * the tree item for the given entry */ private void updateCategory(PropertySheetCategory category, TreeItem item) { // ensure that backpointer is correct item.setData(category); // Update the map accordingly entryToItemMap.put(category, item); // Update the name and value columns item.setText(0, category.getCategoryName()); item.setText(1, ""); //$NON-NLS-1$ // update the "+" icon if (category.getAutoExpand()) { // we auto expand categories when they first appear createChildren(item); item.setExpanded(true); category.setAutoExpand(false); } else { // we do not want to auto expand categories if the user has // collpased them updatePlus(category, item); } }
/** * Update the category (but not its parent or children). * * @param category * the category to update * @param item * the tree item for the given entry */ private void updateCategory(PropertySheetCategory category, TreeItem item) { // ensure that backpointer is correct item.setData(category); // Update the map accordingly entryToItemMap.put(category, item); // Update the name and value columns item.setText(0, category.getCategoryName()); item.setText(1, ""); //$NON-NLS-1$ // update the "+" icon if (category.getAutoExpand()) { // we auto expand categories when they first appear createChildren(item); item.setExpanded(true); category.setAutoExpand(false); } else { // we do not want to auto expand categories if the user has // collpased them updatePlus(category, item); } }
/** * Update the status line based on the data of item. * @param item */ protected void updateStatusLine(Widget item) { setMessage(null); setErrorMessage(null); // Update the status line if (item != null) { if (item.getData() instanceof PropertySheetEntry) { PropertySheetEntry psEntry = (PropertySheetEntry) item.getData(); // For entries, show the description if any, else show the label String desc = psEntry.getDescription(); if (desc != null && desc.length() > 0) { setMessage(psEntry.getDescription()); } else { setMessage(psEntry.getDisplayName()); } } else if (item.getData() instanceof PropertySheetCategory) { PropertySheetCategory psCat = (PropertySheetCategory) item.getData(); setMessage(psCat.getCategoryName()); } } }
/** * Update the status line based on the data of item. * @param item */ protected void updateStatusLine(Widget item) { setMessage(null); setErrorMessage(null); // Update the status line if (item != null) { if (item.getData() instanceof PropertySheetEntry) { PropertySheetEntry psEntry = (PropertySheetEntry) item.getData(); // For entries, show the description if any, else show the label String desc = psEntry.getDescription(); if (desc != null && desc.length() > 0) { setMessage(psEntry.getDescription()); } else { setMessage(psEntry.getDisplayName()); } } else if (item.getData() instanceof PropertySheetCategory) { PropertySheetCategory psCat = (PropertySheetCategory) item.getData(); setMessage(psCat.getCategoryName()); } } }
/** * Update the status line based on the data of item. * @param item */ protected void updateStatusLine(Widget item) { setMessage(null); setErrorMessage(null); // Update the status line if (item != null) { if (item.getData() instanceof PropertySheetEntry) { PropertySheetEntry psEntry = (PropertySheetEntry) item.getData(); // For entries, show the description if any, else show the label String desc = psEntry.getDescription(); if (desc != null && desc.length() > 0) { setMessage(psEntry.getDescription()); } else { setMessage(psEntry.getDisplayName()); } } else if (item.getData() instanceof PropertySheetCategory) { PropertySheetCategory psCat = (PropertySheetCategory) item.getData(); setMessage(psCat.getCategoryName()); } } }