Author: sdzmitrovich
Date: 2009-03-02 14:59:36 -0500 (Mon, 02 Mar 2009)
New Revision: 13925
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3869
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-03-02
19:21:59 UTC (rev 13924)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-03-02
19:59:36 UTC (rev 13925)
@@ -65,6 +65,7 @@
private CSSStyleSheet styleSheet = null;
private ICSSStyleSheet eclipseStyleSheet = null;
private String COPY_SUFFIX = "_copy";
+ private boolean copy = false;
/**
@@ -82,6 +83,7 @@
if (model != null) {
releaseModel();
}
+ copy = false;
formatProcessorCSS = new FormatProcessorCSS();
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getExistingModelForEdit(styleFile);
@@ -90,7 +92,8 @@
if (model == null)
model = modelManager.getModelForEdit(styleFile);
else {
-
+
+ copy = true;
// copy the model
model = modelManager.copyModelForEdit(model.getId(), model
.getId()
@@ -318,12 +321,21 @@
public void saveModel() {
try {
- // it is necessary not to dialog appears when "dirty" css file is
- // being saved
- IFileBuffer buffer = FileBuffers.getTextFileBufferManager()
- .getFileBuffer(styleFile.getFullPath(),
- LocationKind.NORMALIZE);
- buffer.setDirty(false);
+ /*
+ * it is necessary not to dialog appears when "dirty" css file is
+ * being saved ( test case : 1) open css file 2) make same changes
+ * 3) open css dialog 4) make some changes 5)press ok )
+ *
+ *
+ * it is necessary to distinguish real model from copy. For real
+ * model next step reject all changes
+ */
+ if (copy) {
+ IFileBuffer buffer = FileBuffers.getTextFileBufferManager()
+ .getFileBuffer(styleFile.getFullPath(),
+ LocationKind.NORMALIZE);
+ buffer.setDirty(false);
+ }
model.save();
} catch (IOException e) {