@Override public void apply() { Set<UserFileType> modifiedUserTypes = myOriginalToEditedMap.keySet(); for (UserFileType oldType : modifiedUserTypes) { oldType.copyFrom(myOriginalToEditedMap.get(oldType)); } myOriginalToEditedMap.clear(); ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) { myManager.setIgnoredFilesList(myFileTypePanel.myIgnoreFilesField.getText()); } myManager.setPatternsTable(myTempFileTypes, myTempPatternsTable); for (FileNameMatcher matcher : myReassigned.keySet()) { myManager.getRemovedMappings().put(matcher, Pair.create(myReassigned.get(matcher), true)); } TemplateDataLanguagePatterns.getInstance().setAssocTable(myTempTemplateDataLanguages); } }); }
@Override public void apply() throws ConfigurationException { Set<UserFileType> modifiedUserTypes = myOriginalToEditedMap.keySet(); for (UserFileType oldType : modifiedUserTypes) { UserFileType newType = myOriginalToEditedMap.get(oldType); oldType.copyFrom(newType); } myOriginalToEditedMap.clear(); ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) { myManager.setIgnoredFilesList(myFileTypePanel.myIgnoreFilesField.getText()); } myManager.setPatternsTable(myTempFileTypes, myTempPatternsTable); for (FileNameMatcher matcher : myReassigned.keySet()) { myManager.getRemovedMappings().put(matcher, Pair.create(myReassigned.get(matcher), true)); } TemplateDataLanguagePatterns.getInstance().setAssocTable(myTempTemplateDataLanguages); } }); }
@RequiredDispatchThread @Override public void apply() throws ConfigurationException { Set<UserFileType> modifiedUserTypes = myOriginalToEditedMap.keySet(); for (UserFileType oldType : modifiedUserTypes) { UserFileType newType = myOriginalToEditedMap.get(oldType); oldType.copyFrom(newType); } myOriginalToEditedMap.clear(); ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) { myManager.setIgnoredFilesList(myFileTypePanel.myIgnoreFilesField.getText()); } myManager.setPatternsTable(myTempFileTypes, myTempPatternsTable); for (FileNameMatcher matcher : myReassigned.keySet()) { myManager.getRemovedMappings().put(matcher, Pair.create(myReassigned.get(matcher), true)); } TemplateDataLanguagePatterns.getInstance().setAssocTable(myTempTemplateDataLanguages); } }); }
@Override public void reset() { myTempPatternsTable = myManager.getExtensionMap().copy(); myTempTemplateDataLanguages = TemplateDataLanguagePatterns.getInstance().getAssocTable(); myTempFileTypes = new HashSet<FileType>(Arrays.asList(getModifiableFileTypes())); myOriginalToEditedMap.clear(); updateFileTypeList(); updateExtensionList(); myFileTypePanel.myIgnoreFilesField.setText(myManager.getIgnoredFilesList()); }
@Override public boolean isModified() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) return true; HashSet<FileType> types = new HashSet<FileType>(Arrays.asList(getModifiableFileTypes())); return !myTempPatternsTable.equals(myManager.getExtensionMap()) || !myTempFileTypes.equals(types) || !myOriginalToEditedMap.isEmpty() || !myTempTemplateDataLanguages.equals(TemplateDataLanguagePatterns.getInstance().getAssocTable()); }
@Override public boolean isModified() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) return true; HashSet types = new HashSet(Arrays.asList(getModifiableFileTypes())); return !myTempPatternsTable.equals(myManager.getExtensionMap()) || !myTempFileTypes.equals(types) || !myOriginalToEditedMap.isEmpty() || !myTempTemplateDataLanguages.equals(TemplateDataLanguagePatterns.getInstance().getAssocTable()); }
@RequiredDispatchThread @Override public void reset() { myTempPatternsTable = myManager.getExtensionMap().copy(); myTempTemplateDataLanguages = TemplateDataLanguagePatterns.getInstance().getAssocTable(); myTempFileTypes = new HashSet<FileType>(Arrays.asList(getModifiableFileTypes())); myOriginalToEditedMap.clear(); updateFileTypeList(); updateExtensionList(); myFileTypePanel.myIgnoreFilesField.setText(myManager.getIgnoredFilesList()); }
@RequiredDispatchThread @Override public boolean isModified() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) return true; HashSet types = new HashSet(Arrays.asList(getModifiableFileTypes())); return !myTempPatternsTable.equals(myManager.getExtensionMap()) || !myTempFileTypes.equals(types) || !myOriginalToEditedMap.isEmpty() || !myTempTemplateDataLanguages.equals(TemplateDataLanguagePatterns.getInstance().getAssocTable()); }