Author: mareshkau
Date: 2008-11-10 08:13:25 -0500 (Mon, 10 Nov 2008)
New Revision: 11634
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
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/xpl/CustomSashForm.java
Log:
JBIDE-2337 adjustment, JBIDE-3127
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-10
12:46:00 UTC (rev 11633)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-10
13:13:25 UTC (rev 11634)
@@ -481,12 +481,10 @@
public void notifyChanged(final INodeNotifier notifier,
final int eventType, final Object feature, final Object oldValue,
final Object newValue, final int pos) {
-
if (!visualEditorVisible) {
- synced = false;
+ setSynced(false);
return;
}
-
// start job when we modify file in ui thread, without this code
// changes will be applied with 1 second delay
Display display = null;
@@ -1676,8 +1674,9 @@
}
public void visualRefresh() {
+
if (!visualEditorVisible) {
- synced = false;
+ setSynced(false);
return;
}
if (uiJob != null && uiJob.getState() != Job.NONE) {
@@ -1703,7 +1702,7 @@
IProgressMonitor.UNKNOWN);
visualRefreshImpl();
monitor.done();
- synced=true;
+ setSynced(true);
} catch (VpeDisposeException exc) {
// just ignore this exception
} catch (NullPointerException ex) {
@@ -3239,19 +3238,6 @@
this.synced = synced;
}
- public void rebuildDom() {
- if (visualBuilder == null)
- return;
- IDOMModel sourceModel = (IDOMModel) getModel();
- if (sourceModel != null) {
- IDOMDocument sourceDocument = sourceModel.getDocument();
- visualBuilder.rebuildDom(sourceDocument);
- } else {
- visualBuilder.rebuildDom(null);
- }
- synced = true;
- }
-
/**
* @return the progressMonitor
*/
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 2008-11-10
12:46:00 UTC (rev 11633)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2008-11-10
13:13:25 UTC (rev 11634)
@@ -548,7 +548,7 @@
&& !controller.isVisualEditorVisible()) {
controller.setVisualEditorVisible(true);
if (!controller.isSynced())
- controller.rebuildDom();
+ controller.visualRefresh();
}
}
}
@@ -772,12 +772,14 @@
}
}
+ @Override
public void setFocus() {
if (activeEditor != null) {
activeEditor.setFocus();
}
}
+ @Override
public void dispose() {
if (optionsObject != null) {
optionsObject.getModel().removeModelTreeListener(listener);
@@ -881,6 +883,7 @@
public void partOpened(IWorkbenchPart part) {
}
+ @Override
public void shellActivated(ShellEvent e) {
e.widget.getDisplay().asyncExec(new Runnable() {
public void run() {
@@ -898,9 +901,8 @@
try {
if (sourceEditor != null) {
if (visualEditor != null)
- //added by estherbin
//fix
http://jira.jboss.com/jira/browse/JBIDE-2337
- if ((visualEditor.getController() != null) && !container.isHidden()) {
+ if ((visualEditor.getController() != null) &&
(visualEditor.getController().isVisualEditorVisible())) {
visualEditor.getController().refreshTemplates();
}
sourceEditor.safelySanityCheckState(getEditorInput());
@@ -916,7 +918,7 @@
IContextService contextService = (IContextService) workbench
.getAdapter(IContextService.class);
fContextActivation = contextService
- .activateContext(VPE_EDITOR_CONTEXT); //$NON-NLS-1$
+ .activateContext(VPE_EDITOR_CONTEXT);
IHandlerService handlerService = (IHandlerService) workbench
.getService(IHandlerService.class);
if (handlerService != null) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java 2008-11-10
12:46:00 UTC (rev 11633)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java 2008-11-10
13:13:25 UTC (rev 11634)
@@ -45,13 +45,7 @@
public static final String copyright = "(c) Copyright IBM Corporation 2002.";
//$NON-NLS-1$
- //added by estherbin
- //fix
http://jira.jboss.com/jira/browse/JBIDE-2337
/**
- * Determine is hidden or not.
- */
- private boolean isHidden = false;
- /**
* Custom style bits. They set whether max to one side of the other
* is not permitted. For example, if NO_MAX_UP, then there will be only
* one arrow. When not maxed, it will point down (and will do a max down),
@@ -229,6 +223,7 @@
/**
* @see org.eclipse.swt.widgets.Composite#layout(boolean)
*/
+ @Override
public void layout(boolean changed) {
super.layout(changed);
@@ -375,6 +370,7 @@
/**
* @see org.eclipse.swt.events.MouseTrackAdapter#mouseExit(MouseEvent)
*/
+ @Override
public void mouseExit(MouseEvent e) {
if (currentSashInfo.cursorOver != NO_ARROW) {
// Undo the cursor.
@@ -391,6 +387,7 @@
/**
* @see org.eclipse.swt.events.MouseAdapter#mouseDown(MouseEvent)
*/
+ @Override
public void mouseDown(MouseEvent e) {
inMouseClick = true;
// If we're within a button, then redraw to wipe out stipple and get button push
effect.
@@ -412,6 +409,7 @@
/**
* @see org.eclipse.swt.events.MouseListener#mouseDown(MouseEvent)
*/
+ @Override
public void mouseUp(MouseEvent e) {
// See if within one of the arrows.
inMouseClick = false; // No longer in down click
@@ -511,9 +509,7 @@
drawArrows[1] = DOWN_ARROW;
currentSashInfo.sashBorderLeft = false;
currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
- //added by estherbin
- //fix
http://jira.jboss.com/jira/browse/JBIDE-2337
- this.isHidden = true;
+
} else if (weights[1] == 0 || (currentSashInfo.weight != NO_WEIGHT &&
sashBounds.y+sashBounds.height >= clientArea.height-DRAG_MINIMUM)) {
// Slammed to the bottom
addArrows[0] = UP_ARROW;
@@ -522,9 +518,6 @@
drawArrows[1] = UP_MAX_ARROW;
currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
currentSashInfo.sashBorderRight = false;
- //added by estherbin
- //fix
http://jira.jboss.com/jira/browse/JBIDE-2337
- this.isHidden = true;
} else {
// Not slammed
addArrows[0] = UP_MAX_ARROW;
@@ -534,9 +527,6 @@
currentSashInfo.weight = NO_WEIGHT; // Since we are in the middle, there is no
weight. We've could of been dragged here.
currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
- //added by estherbin
- //fix
http://jira.jboss.com/jira/browse/JBIDE-2337
- this.isHidden=false;
}
}
getNewSashArray(currentSashInfo, addArrows, drawArrows);
@@ -666,17 +656,6 @@
y+=tSize;
}
}
- //added by estherbin
- //fix
http://jira.jboss.com/jira/browse/JBIDE-2337
- /**
- * Determine is hidden or not.
- * @return <code>true</code> if hidden otherwise
<code>false</code>
- */
-
- public boolean isHidden(){
- return this.isHidden;
- }
-
protected void drawSashBorder(GC gc, Sash sash, boolean leftBorder) {
gc.setForeground(borderColor);
if (getOrientation() == SWT.VERTICAL) {