[151581] Enable folding menu item is checked although folding isn't enabled (in preference store)
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 c442ac7..2121d02 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 IBM Corporation and others.
+ * Copyright (c) 2006, 2007 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
@@ -92,7 +92,10 @@
setEnabled(isEnabled);
}
};
- fToggle.setChecked(true);
+
+ IPreferenceStore store = SSEUIPlugin.getDefault().getPreferenceStore();
+ boolean checked = store.getBoolean(IStructuredTextFoldingProvider.FOLDING_ENABLED);
+ fToggle.setChecked(checked);
fToggle.setActionDefinitionId(IFoldingCommandIds.FOLDING_TOGGLE);
editor.setAction("FoldingToggle", fToggle); //$NON-NLS-1$