Author: mareshkau
Date: 2010-11-10 11:36:17 -0500 (Wed, 10 Nov 2010)
New Revision: 26421
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
Log:
https://jira.jboss.org/browse/JBIDE-7531
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java 2010-11-10
16:18:35 UTC (rev 26420)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/RotateEditorsHandler.java 2010-11-10
16:36:17 UTC (rev 26421)
@@ -81,12 +81,6 @@
}
/**
- * The constructor.
- */
- public RotateEditorsHandler() {
- }
-
- /**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
@@ -111,7 +105,13 @@
preferences.setValue(
IVpePreferencesPage.VISUAL_SOURCE_EDITORS_SPLITTING,
newOrientation);
-
+ IEditorReference[] openedEditors = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage()
+ .getEditorReferences();
+ for (IEditorReference openedEditor : openedEditors) {
+ IEditorPart editor = openedEditor.getEditor(true);
+ rotateEditor(editor, newOrientation);
+ }
Command command = event.getCommand();
ICommandService commandService = (ICommandService) PlatformUI
.getWorkbench().getService(ICommandService.class);
@@ -120,7 +120,6 @@
}
public void updateElement(UIElement element, Map parameters) {
- super.updateElement(element, parameters);
IPreferenceStore preferences = JspEditorPlugin.getDefault()
.getPreferenceStore();
String orientation = preferences
@@ -141,17 +140,6 @@
element.setTooltip(orientationName);
element.setText(orientationName);
- /*
- * Call <code>filContainer()</code> from VpeEditorPart to redraw
- * CustomSashForm with new layout.
- */
- IEditorReference[] openedEditors = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage()
- .getEditorReferences();
- for (IEditorReference openedEditor : openedEditors) {
- IEditorPart editor = openedEditor.getEditor(true);
- rotateEditor(editor, orientation);
- }
}
private void rotateEditor(IEditorPart editor, String orientation) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-10
16:18:35 UTC (rev 26420)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/ShowTextFormattingHandler.java 2010-11-10
16:36:17 UTC (rev 26421)
@@ -41,27 +41,13 @@
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- boolean oldToggleState = HandlerUtil.toggleCommandState(event
+ boolean toggleState = !HandlerUtil.toggleCommandState(event
.getCommand());
JspEditorPlugin
.getDefault()
.getPreferenceStore()
.setValue(IVpePreferencesPage.SHOW_TEXT_FORMATTING,
- !oldToggleState);
-
- Command command = event.getCommand();
- ICommandService commandService = (ICommandService) PlatformUI
- .getWorkbench().getService(ICommandService.class);
- commandService.refreshElements(command.getId(), null);
-
- return null;
- }
-
- public void updateElement(UIElement element, Map parameters) {
- super.updateElement(element, parameters);
- boolean toggleState = JspEditorPlugin.getDefault().getPreferenceStore()
- .getBoolean(IVpePreferencesPage.SHOW_TEXT_FORMATTING);
-
+ toggleState);
IEditorReference[] openedEditors = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage()
.getEditorReferences();
@@ -69,7 +55,7 @@
IEditorPart editor = openedEditor.getEditor(true);
toggleShowTextFormatting(editor, toggleState);
}
-
+ return null;
}
private void toggleShowTextFormatting(IEditorPart editor,