Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis D'Entremont2006-04-07 18:54:29 +0000
committerCurtis D'Entremont2006-04-07 18:54:29 +0000
commita60a76cfcc2edda701512d4d4abaa800cc9df302 (patch)
treeb3d8863eec69f09a216e7f25cef815bd2cc092e6
parent38b650ae10a9698aa51f86b25b6a5b0f57ee828e (diff)
downloadeclipse.platform.ua-a60a76cfcc2edda701512d4d4abaa800cc9df302.tar.gz
eclipse.platform.ua-a60a76cfcc2edda701512d4d4abaa800cc9df302.tar.xz
eclipse.platform.ua-a60a76cfcc2edda701512d4d4abaa800cc9df302.zip
127592 [CheatSheet] Task editor doesn't show initially on mac
-rw-r--r--org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java30
1 files changed, 21 insertions, 9 deletions
diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java
index bf4251a69..045ba997b 100644
--- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java
+++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/views/CompositeCheatSheetPage.java
@@ -179,6 +179,19 @@ public class CompositeCheatSheetPage extends Page implements ISelectionChangedLi
mform.getForm().setText(model.getName());
String explorerId = model.getTaskExplorerId();
setCurrentExplorerFromId(explorerId);
+ String selectedTaskId = (String) layout.get(ICompositeCheatsheetTags.SELECTED_TASK);
+ ICompositeCheatSheetTask selectedTask= null;
+ if (selectedTaskId != null) {
+ selectedTask = model.getDependencies().getTask(selectedTaskId);
+ if (selectedTask != null) {
+ currentExplorer.setSelection(new StructuredSelection(selectedTask), true);
+ }
+ }
+ if (selectedTask != null) {
+ updateSelectedTask(selectedTask);
+ } else {
+ updateSelectedTask(model.getRootTask());
+ }
model.addObserver(new Observer() {
public void update(Observable o, Object arg) {
ICompositeCheatSheetTask task = (ICompositeCheatSheetTask)arg;
@@ -187,14 +200,6 @@ public class CompositeCheatSheetPage extends Page implements ISelectionChangedLi
updateTask(task);
}
});
- String selectedTaskId = (String) layout.get(ICompositeCheatsheetTags.SELECTED_TASK);
- if (selectedTaskId != null) {
- AbstractTask selectedTask =
- model.getDependencies().getTask(selectedTaskId);
- if (selectedTask != null) {
- currentExplorer.setSelection(new StructuredSelection(selectedTask), true);
- }
- }
}
private void setCurrentExplorerFromId(String explorerId) {
@@ -260,7 +265,14 @@ public class CompositeCheatSheetPage extends Page implements ISelectionChangedLi
}
private void updateForSelection(ISelection selection) {
- selectedTask = (ICompositeCheatSheetTask)((IStructuredSelection)selection).getFirstElement();
+ Object selectedElement = ((IStructuredSelection)selection).getFirstElement();
+ if (selectedElement instanceof ICompositeCheatSheetTask) {
+ updateSelectedTask((ICompositeCheatSheetTask)selectedElement);
+ }
+ }
+
+ private void updateSelectedTask(ICompositeCheatSheetTask task) {
+ selectedTask = task;
updateTask(selectedTask);
}

Back to the top