[315030] Code Folding keyboard shortcuts are not working
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
index 7291cef..0422235 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/FoldingActionGroup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,8 +39,10 @@
private ProjectionViewer fViewer;
private final PreferenceAction fToggle;
+ private final TextOperationAction fExpand;
private final TextOperationAction fExpandAll;
private final IProjectionListener fProjectionListener;
+ private final TextOperationAction fCollapse;
private final TextOperationAction fCollapseAll;
@@ -57,7 +59,9 @@
public FoldingActionGroup(final ITextEditor editor, ITextViewer viewer) {
if (!(viewer instanceof ProjectionViewer)) {
fToggle = null;
+ fExpand = null;
fExpandAll = null;
+ fCollapse = null;
fCollapseAll = null;
fProjectionListener = null;
return;
@@ -99,10 +103,18 @@
fToggle.setActionDefinitionId(IFoldingCommandIds.FOLDING_TOGGLE);
editor.setAction("FoldingToggle", fToggle); //$NON-NLS-1$
+ fExpand = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_Expand_", editor, ProjectionViewer.EXPAND, true); //$NON-NLS-1$
+ fExpand.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND);
+ editor.setAction("FoldingExpand", fExpand); //$NON-NLS-1$
+
fExpandAll = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_ExpandAll_", editor, ProjectionViewer.EXPAND_ALL, true); //$NON-NLS-1$
fExpandAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_EXPAND_ALL);
editor.setAction("FoldingExpandAll", fExpandAll); //$NON-NLS-1$
+ fCollapse = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_Collapse_", editor, ProjectionViewer.COLLAPSE, true); //$NON-NLS-1$
+ fCollapse.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE);
+ editor.setAction("FoldingCollapse", fCollapse); //$NON-NLS-1$
+
fCollapseAll = new TextOperationAction(SSEUIMessages.getResourceBundle(), "Projection_CollapseAll_", editor, ProjectionViewer.COLLAPSE_ALL, true); //$NON-NLS-1$
fCollapseAll.setActionDefinitionId(IFoldingCommandIds.FOLDING_COLLAPSE_ALL);
editor.setAction("FoldingCollapseAll", fCollapseAll); //$NON-NLS-1$
@@ -139,7 +151,9 @@
if (isEnabled()) {
fToggle.update();
fToggle.setChecked(fViewer.isProjectionMode());
+ fExpand.update();
fExpandAll.update();
+ fCollapse.update();
fCollapseAll.update();
}
}
@@ -154,7 +168,9 @@
if (isEnabled()) {
update();
manager.add(fToggle);
+ manager.add(fExpand);
manager.add(fExpandAll);
+ manager.add(fCollapse);
manager.add(fCollapseAll);
}
}
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
index 352a3ca..6d5087e 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/SSEUIPluginResources.properties
@@ -366,10 +366,18 @@
Projection_ExpandAll_tooltip= Expands All Collapsed Regions
Projection_ExpandAll_description= Expands any collapsed regions in the current editor
Projection_ExpandAll_image=
+Projection_Expand_label=&Expand
+Projection_Expand_tooltip=Expands the current region
+Projection_Expand_description=Expands the current region in the editor
+Projection_Expand_image=
Projection_CollapseAll_label= Collapse A&ll
Projection_CollapseAll_tooltip= Collapses All Expanded Regions
Projection_CollapseAll_description= Collapse any expanded regions in the current editor
Projection_CollapseAll_image=
+Projection_Collapse_label=&Collapse
+Projection_Collapse_tooltip=Collapses the current region
+Projection_Collapse_description=Collapses the current region in the editor
+Projection_Collapse_image=
## These are copied from org.eclipse.ui.texteditor.EditorMessages.properties
## They are needed temporarily until CMVC defect 203158 / Bugzilla defect 20054 is fixed