diff --git a/plugins/properties/properties.iml b/plugins/properties/properties.iml
index 60abeffd223e..622bbd29189a 100644
--- a/plugins/properties/properties.iml
+++ b/plugins/properties/properties.iml
@@ -17,6 +17,7 @@
+
diff --git a/plugins/properties/src/META-INF/plugin.xml b/plugins/properties/src/META-INF/plugin.xml
index 1e6f414ba1f3..7edea916f9df 100644
--- a/plugins/properties/src/META-INF/plugin.xml
+++ b/plugins/properties/src/META-INF/plugin.xml
@@ -3,6 +3,7 @@
Properties Support
com.intellij.modules.xml
com.intellij.spellchecker
+ com.intellij.uml
This plugin enables smart editing of properties files.
diff --git a/plugins/properties/src/META-INF/uml.xml b/plugins/properties/src/META-INF/uml.xml
new file mode 100644
index 000000000000..67f22df85011
--- /dev/null
+++ b/plugins/properties/src/META-INF/uml.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeProvider.java b/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeProvider.java
new file mode 100644
index 000000000000..b8c2ea7964d9
--- /dev/null
+++ b/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeProvider.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.lang.properties.uml;
+
+import com.intellij.lang.properties.PropertiesFileType;
+import com.intellij.openapi.fileTypes.FileType;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiFile;
+import com.intellij.uml.UmlChangeTracker;
+import com.intellij.uml.UmlChangesProvider;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class PropertyChangeProvider extends UmlChangesProvider{
+ @Override
+ public boolean accept(FileType type) {
+ return type == PropertiesFileType.FILE_TYPE;
+ }
+
+ @Override
+ public UmlChangeTracker createTracker(Project project, @Nullable PsiFile before, @Nullable PsiFile after) {
+ return new PropertyChangeTracker(project, before, after);
+ }
+}
diff --git a/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeTracker.java b/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeTracker.java
new file mode 100644
index 000000000000..aa74c1516897
--- /dev/null
+++ b/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeTracker.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2000-2010 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.lang.properties.uml;
+
+import com.intellij.lang.properties.psi.PropertiesFile;
+import com.intellij.lang.properties.psi.Property;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vcs.FileStatus;
+import com.intellij.openapi.vcs.changes.PsiChangeTracker;
+import com.intellij.openapi.vfs.LocalFileSystem;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.PsiManager;
+import com.intellij.psi.PsiNamedElement;
+import com.intellij.psi.util.PsiFilter;
+import com.intellij.uml.UmlChangeTracker;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Konstantin Bulenkov
+ */
+public class PropertyChangeTracker extends UmlChangeTracker {
+ private static final PsiFilter PROPERTY_FILTER =
+ new PsiFilter(Property.class) {
+ @Override
+ public boolean areEquivalent(Property e1, Property e2) {
+ final String key1 = e1.getKey();
+ return key1 != null && key1.equals(e2.getKey());
+ }
+ };
+ private HashMap map;
+
+ public PropertyChangeTracker(Project project, @Nullable PsiFile before, @Nullable PsiFile after) {
+ super(project, before, after);
+ }
+
+ @Override
+ public PsiFilter[] getNodeFilters() {
+ return new PsiFilter[] {new PsiFilter(PropertiesFile.class)};
+ }
+
+ @Override
+ public PsiFilter[] getNodeContentFilters() {
+ return new PsiFilter[] {PROPERTY_FILTER};
+ }
+
+ @Override
+ public Map getNodeElements() {
+ if (map == null) {
+ map = new HashMap();
+ for (PsiFilter filter : getNodeFilters()) {
+ map.putAll(PsiChangeTracker.getElementsChanged(getAfter(), getBefore(), filter));
+ }
+ }
+ return map;
+ }
+
+ @Override
+ public RelationshipInfo[] getRelationships() {
+ return RelationshipInfo.EMPTY;
+ }
+
+ @Override
+ public PsiNamedElement findElementByFQN(Project project, String fqn) {
+ final File file = new File(fqn);
+ if (file.exists()) {
+ final VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(file);
+ if (vf != null) {
+ final PsiFile psiFile = PsiManager.getInstance(project).findFile(vf);
+ if (psiFile instanceof PropertiesFile) {
+ return psiFile;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getPresentableName(PsiNamedElement e) {
+ return e instanceof Property ? ((Property)e).getKey() : super.getPresentableName(e);
+ }
+}