[313571] [XML Catalog] XML Catalog should provide a way to re-load cached entries.
diff --git a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
index acfbd16..e9e7661 100644
--- a/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
+++ b/bundles/org.eclipse.wst.xml.core/src-catalog/org/eclipse/wst/xml/core/internal/catalog/CatalogSet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation and others.
+ * Copyright (c) 2002, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,4 +62,8 @@
public String getCatalogPersistenceLocation(String id) {
return (String) catalogPersistenceLocations.get(id);
}
+
+ public void clearResourceCache() {//Clearing only uriResourceMap is required
+ uriResourceMap.clear();
+ }
}
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
index bb148a2..b31c95a 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/XMLCorePlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -77,4 +77,10 @@
return catalogSet.lookupOrCreateCatalog(DEFAULT_CATALOG_ID, defaultCatalogFileStateLocation);
}
+ public void clearCatalogCache() {
+ if (catalogSet != null) {
+ catalogSet.clearResourceCache();
+ }
+ }
+
}
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
index 92f8bb5..8b32068 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogEntriesView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2008 IBM Corporation and others.
+ * Copyright (c) 2002, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
import org.eclipse.wst.xml.core.internal.catalog.Catalog;
import org.eclipse.wst.xml.core.internal.catalog.CatalogElement;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
@@ -43,6 +44,7 @@
protected Button newButton;
protected Button editButton;
protected Button deleteButton;
+ protected Button clearCacheButton;
protected XMLCatalogTreeViewer tableViewer;
protected ICatalog workingUserCatalog;
protected ICatalog systemCatalog;
@@ -126,6 +128,9 @@
else if (e.widget == deleteButton) {
performDelete();
}
+ else if (e.widget == clearCacheButton) {
+ performRefresh();
+ }
}
};
@@ -169,6 +174,15 @@
gd = new GridData();
gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = true;
+ gd.verticalIndent = 9;
+ clearCacheButton = new Button(composite, SWT.NONE);
+ clearCacheButton.setText(XMLCatalogMessages.UI_BUTTON_RELOAD_CATALOG);
+ clearCacheButton.setLayoutData(gd);
+ clearCacheButton.addSelectionListener(selectionListener);
+
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 4;
Button hiddenButton = new Button(composite, SWT.NONE);
@@ -237,6 +251,10 @@
}
}
+ protected void performRefresh() {
+ XMLCorePlugin.getDefault().clearCatalogCache();
+ }
+
protected void performDelete() {
ISelection selection = tableViewer.getSelection();
if(selection instanceof IStructuredSelection) {
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
index fc526b6..4f33585 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -81,6 +81,7 @@
public static String UI_BUTTON_EDIT;
public static String UI_BUTTON_DELETE;
public static String UI_BUTTON_REMOVE;
+ public static String UI_BUTTON_RELOAD_CATALOG;
public static String UI_LABEL_NEW_DIALOG_TITLE;
public static String UI_LABEL_EDIT_DIALOG_TITLE;
diff --git a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
index 9af908a..6edbb78 100644
--- a/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src-catalog/org/eclipse/wst/xml/ui/internal/catalog/XMLCatalogResources.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2004, 2010 IBM Corporation and others.
+# Copyright (c) 2004, 2011 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -79,6 +79,7 @@
UI_BUTTON_EDIT = &Edit...
UI_BUTTON_DELETE = &Delete
UI_BUTTON_REMOVE = &Remove
+UI_BUTTON_RELOAD_CATALOG = Re&load Entries
UI_LABEL_NEW_DIALOG_TITLE = Add XML Catalog Element
UI_LABEL_EDIT_DIALOG_TITLE = Edit XML Catalog Element