Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritrimble2010-11-17 19:20:12 -0500
committeritrimble2010-11-17 19:20:12 -0500
commita413109d677e0fc8172f949226a12388bd7f4876 (patch)
treeea14d2e1d5f76fdfa5b506dec804822d1e9c6a6b
parent974fd32145e8fea1e2202c307892f21d3c6980b4 (diff)
downloadwebtools.jsf-a413109d677e0fc8172f949226a12388bd7f4876.tar.gz
webtools.jsf-a413109d677e0fc8172f949226a12388bd7f4876.tar.xz
webtools.jsf-a413109d677e0fc8172f949226a12388bd7f4876.zip
Bug 330412 - [WPE] Drag 'n' Drop of tag from palette doesn't notify team system of edit
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java20
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java2
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java20
4 files changed, 44 insertions, 0 deletions
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java
index e19bb0a09..6b521e498 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/CreateItemCommand.java
@@ -63,6 +63,8 @@ public class CreateItemCommand extends DesignerCommand implements ICustomizableC
getModel(), this._position, this._customizationData);
if (element != null)
{
+ //Bug 330412 - [WPE] Drag 'n' Drop of tag from palette doesn't notify team system of edit
+ notifyTeamFrameworkOfEdit();
formatNode(element);
}
this._ele = element;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java
index 10d6c60ac..8ff76d7da 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/DesignerCommand.java
@@ -11,6 +11,9 @@
*******************************************************************************/
package org.eclipse.jst.pagedesigner.commands;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
@@ -28,6 +31,7 @@ import org.eclipse.jst.pagedesigner.dom.EditValidateUtil;
import org.eclipse.jst.pagedesigner.dom.IDOMPosition;
import org.eclipse.jst.pagedesigner.parts.ElementEditPart;
import org.eclipse.jst.pagedesigner.utils.SelectionHelper;
+import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
import org.eclipse.jst.pagedesigner.viewer.DesignPosition;
import org.eclipse.jst.pagedesigner.viewer.DesignRange;
import org.eclipse.jst.pagedesigner.viewer.IHTMLGraphicalViewer;
@@ -332,6 +336,22 @@ public abstract class DesignerCommand extends Command {
}
/**
+ * Notifies the team framework of an edit to the model's underlying file.
+ */
+ public void notifyTeamFrameworkOfEdit() {
+ IFile file = StructuredModelUtil.getFileFor(_model);
+ if (file != null) {
+ IWorkspace workspace = file.getWorkspace();
+ if (workspace != null) {
+ IStatus status = workspace.validateEdit(new IFile[]{file}, null);
+ if (!status.isOK()) {
+ _log.info(status.getMessage());
+ }
+ }
+ }
+ }
+
+ /**
* Re-executes the Command. This method should only be called after
* <code>undo()</code> has been called.
*/
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java
index 7438282d0..41fe7f104 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/PaletteDropInsertCommand.java
@@ -97,6 +97,8 @@ public class PaletteDropInsertCommand extends SourceViewerCommand implements ICu
_creationProvider, getModel()
, position, getCustomizationData());
if (element != null) {
+ //Bug 330412 - [WPE] Drag 'n' Drop of tag from palette doesn't notify team system of edit
+ notifyTeamFrameworkOfEdit();
formatNode(element);
}
this._element = element;
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java
index 2974929f0..b1a504fa4 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/commands/SourceViewerCommand.java
@@ -11,12 +11,16 @@
*******************************************************************************/
package org.eclipse.jst.pagedesigner.commands;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.gef.commands.Command;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
import org.eclipse.jst.pagedesigner.PDPlugin;
+import org.eclipse.jst.pagedesigner.utils.StructuredModelUtil;
import org.eclipse.wst.html.core.internal.format.HTMLFormatProcessorImpl;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.sse.ui.internal.provisional.extensions.ISourceEditingTextTools;
@@ -99,6 +103,22 @@ public abstract class SourceViewerCommand extends Command {
}
/**
+ * Notifies the team framework of an edit to the model's underlying file.
+ */
+ public void notifyTeamFrameworkOfEdit() {
+ IFile file = StructuredModelUtil.getFileFor(getModel());
+ if (file != null) {
+ IWorkspace workspace = file.getWorkspace();
+ if (workspace != null) {
+ IStatus status = workspace.validateEdit(new IFile[]{file}, null);
+ if (!status.isOK()) {
+ _log.info(status.getMessage());
+ }
+ }
+ }
+ }
+
+ /**
* @return the dom model
*/
protected IDOMModel getModel() {

Back to the top