Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2007-03-30 19:39:31 +0000
committerChris Goldthorpe2007-03-30 19:39:31 +0000
commitc30f54be4d9691a19034a14eb80b4ce15c5dfee4 (patch)
tree2fd536f25da3552d4f66f6053547ddf3175cfff0 /org.eclipse.ui.cheatsheets/src/org
parente19560778a57d5ab26ba66e3e5f94a3e000faa89 (diff)
downloadeclipse.platform.ua-c30f54be4d9691a19034a14eb80b4ce15c5dfee4.tar.gz
eclipse.platform.ua-c30f54be4d9691a19034a14eb80b4ce15c5dfee4.tar.xz
eclipse.platform.ua-c30f54be4d9691a19034a14eb80b4ce15c5dfee4.zip
Bug 180273 - Cheatsheet categories not displayedv20070402
Diffstat (limited to 'org.eclipse.ui.cheatsheets/src/org')
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
index b12ce32ea..1f648febe 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java
@@ -481,13 +481,24 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends
// want to get the cheatsheets of the collection element
return new BaseWorkbenchContentProvider() {
public Object[] getChildren(Object o) {
+ Object[] cheatsheets;
if (o instanceof CheatSheetCollectionElement) {
- Object[] cheatsheets = ((CheatSheetCollectionElement) o)
+ cheatsheets = ((CheatSheetCollectionElement) o)
.getCheatSheets();
- if (cheatsheets.length > 0)
- return cheatsheets;
+ } else {
+ cheatsheets = new Object[0];
+ }
+ Object[] subCategories = super.getChildren(o);
+ if (cheatsheets.length == 0) {
+ return subCategories;
+ } else if (subCategories.length == 0) {
+ return cheatsheets;
+ } else {
+ Object[] result = new Object[cheatsheets.length + subCategories.length];
+ System.arraycopy(subCategories, 0, result, 0, subCategories.length);
+ System.arraycopy(cheatsheets, 0, result, subCategories.length, cheatsheets.length);
+ return result;
}
- return super.getChildren(o);
}
};
}

Back to the top