Author: dmaliarevich
Date: 2009-09-17 02:20:40 -0400 (Thu, 17 Sep 2009)
New Revision: 17629
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4671, JUnit for JBIDE-3127 was fixed.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-09-16
23:44:43 UTC (rev 17628)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2009-09-17
06:20:40 UTC (rev 17629)
@@ -598,34 +598,19 @@
final ControlListener visualContentControlListener = new ControlListener() {
public void controlMoved(ControlEvent event) {
-
+
}
public void controlResized(ControlEvent event) {
- Point point = visualContent.getSize();
- if (point.x == 0 || point.y == 0) {
- VpeController controller = getController();
- if (controller != null)
- controller.setVisualEditorVisible(false);
- } else {
- VpeController controller = getController();
- if (controller != null
- && !controller.isVisualEditorVisible()) {
- controller.setVisualEditorVisible(true);
- if (!controller.isSynced())
- controller.visualRefresh();
- }
- }
+ updateVisualEditorVisibility();
}
};
visualContent.addControlListener(visualContentControlListener);
visualContent.addDisposeListener(new DisposeListener() {
-
public void widgetDisposed(DisposeEvent e) {
visualContent.removeControlListener(visualContentControlListener);
visualContent.removeDisposeListener(this);
}
-
});
// createVisualEditor();
@@ -833,7 +818,7 @@
* Reset the container.
*/
container = newContainer;
-
+
/*
* Set up new sash weights
*/
@@ -1132,15 +1117,55 @@
}
public void maximizeSource() {
- if (container != null)
- container.maxDown();
+ if (container != null) {
+ if (CustomSashForm.isSourceEditorFirst()) {
+ container.maxDown();
+ } else {
+ container.maxUp();
+ }
+ /*
+ * In JUnit for JBIDE-3127 on manual maximizing
+ * SashForm control listener isn't fired up
+ * do it here.
+ */
+ updateVisualEditorVisibility();
+ }
}
public void maximizeVisual() {
- if (container != null)
- container.maxUp();
+ if (container != null) {
+ if (CustomSashForm.isSourceEditorFirst()) {
+ container.maxUp();
+ } else {
+ container.maxDown();
+ }
+ /*
+ * In JUnit for JBIDE-3127 on manual maximizing
+ * SashForm control listener isn't fired up
+ * do it here.
+ */
+ updateVisualEditorVisibility();
+ }
}
+ protected void updateVisualEditorVisibility() {
+ Point point = visualContent.getSize();
+ if (point.x == 0 || point.y == 0) {
+ VpeController controller = getController();
+ if (controller != null)
+ controller.setVisualEditorVisible(false);
+ } else {
+ VpeController controller = getController();
+ if (controller != null
+ && !controller.isVisualEditorVisible()) {
+ controller.setVisualEditorVisible(true);
+ if (!controller.isSynced()) {
+ controller.visualRefresh();
+ }
+ }
+ }
+ }
+
/*
* Updates current VpeEditorPart after
* OK/Apply button on "Visual Page Editor" preference page