From f652fd5aa8d081d0d6cc476b59aa07a8b034164e Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 15 Feb 2010 17:29:25 +0300 Subject: [PATCH] reverse dependency: should be dependency on community plugin --- plugins/properties/properties.iml | 1 - plugins/properties/src/META-INF/plugin.xml | 1 - .../properties/uml/PropertyChangeProvider.java | 39 -------- .../lang/properties/uml/PropertyChangeTracker.java | 105 --------------------- 4 files changed, 146 deletions(-) delete mode 100644 plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeProvider.java delete mode 100644 plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeTracker.java diff --git a/plugins/properties/properties.iml b/plugins/properties/properties.iml index 622bbd2918..60abeffd22 100644 --- a/plugins/properties/properties.iml +++ b/plugins/properties/properties.iml @@ -17,7 +17,6 @@ - diff --git a/plugins/properties/src/META-INF/plugin.xml b/plugins/properties/src/META-INF/plugin.xml index 7edea916f9..1e6f414ba1 100644 --- a/plugins/properties/src/META-INF/plugin.xml +++ b/plugins/properties/src/META-INF/plugin.xml @@ -3,7 +3,6 @@ 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/com/intellij/lang/properties/uml/PropertyChangeProvider.java b/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeProvider.java deleted file mode 100644 index b8c2ea7964..0000000000 --- a/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 deleted file mode 100644 index 8c6ec5f863..0000000000 --- a/plugins/properties/src/com/intellij/lang/properties/uml/PropertyChangeTracker.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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.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(); - final PropertiesFile after = (PropertiesFile)getAfter(); - final PropertiesFile before = (PropertiesFile)getBefore(); - if (after == null) { - map.put(before, FileStatus.DELETED); - } else if (before == null) { - map.put(after, FileStatus.ADDED); - } else { - map.put(after, FileStatus.MODIFIED); - } - } - 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); - } -} -- 2.11.4.GIT